From bcc548e20fab2a9761e47e78035593197f8664fb Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 13 Feb 2025 22:22:09 +0000 Subject: [PATCH 01/89] devcontainer --- .devcontainer/devcontainer.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..2616ae1d9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + "ghcr.io/devcontainers/features/terraform:1": {} + } +} \ No newline at end of file From 876453703564e8b1fd722a13c8cf3e85710a5b49 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 18:22:07 +0000 Subject: [PATCH 02/89] schema and model to support global data tags --- internal/fleet/agent_policy/create.go | 4 +- internal/fleet/agent_policy/models.go | 55 ++++++++- internal/fleet/agent_policy/read.go | 2 +- internal/fleet/agent_policy/schema.go | 161 +++++++++++++++----------- internal/fleet/agent_policy/update.go | 4 +- 5 files changed, 151 insertions(+), 75 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 86e4a9d25..3cc917dc0 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -22,7 +22,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body := planModel.toAPICreateModel() + body := planModel.toAPICreateModel(ctx) sysMonitoring := planModel.SysMonitoring.ValueBool() policy, diags := fleet.CreateAgentPolicy(ctx, client, body, sysMonitoring) @@ -31,7 +31,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - planModel.populateFromAPI(policy) + planModel.populateFromAPI(ctx, policy) resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 0f06dce37..6a604382e 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -1,13 +1,39 @@ package agent_policy import ( + "context" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" ) +type globalDataTagModel struct { + Name types.String `tfsdk:"name"` + Value types.String `tfsdk:"value"` +} + +func newGlobalDataTagModel(data struct { + Name string "json:\"name\"" + Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" +}, meta utils.ListMeta) globalDataTagModel { + val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() + if err != nil { + panic(err) + } + return globalDataTagModel{ + Name: types.StringValue(data.Name), + Value: types.StringValue(val), + } +} + +var minVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) + type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -22,9 +48,10 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` + GlobalDataTags types.List `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy) { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy) (diags diag.Diagnostics) { if data == nil { return } @@ -54,10 +81,19 @@ func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy) { model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) + if *data.GlobalDataTags != nil { + model.GlobalDataTags = utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diags, newGlobalDataTagModel) + } + return } -func (model agentPolicyModel) toAPICreateModel() kbapi.PostFleetAgentPoliciesJSONRequestBody { +func (model agentPolicyModel) toAPICreateModel(ctx context.Context) kbapi.PostFleetAgentPoliciesJSONRequestBody { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) + tags := make([]struct { + Name string `json:"name"` + Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` + }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) + if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabledLogs) } @@ -77,10 +113,14 @@ func (model agentPolicyModel) toAPICreateModel() kbapi.PostFleetAgentPoliciesJSO Namespace: model.Namespace.ValueString(), } + if len(tags) > 0 { + body.GlobalDataTags = &tags + } + return body } -func (model agentPolicyModel) toAPIUpdateModel() kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody { +func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -89,6 +129,11 @@ func (model agentPolicyModel) toAPIUpdateModel() kbapi.PutFleetAgentPoliciesAgen monitoring = append(monitoring, kbapi.Metrics) } + tags := make([]struct { + Name string `json:"name"` + Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` + }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) + body := kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), @@ -100,5 +145,9 @@ func (model agentPolicyModel) toAPIUpdateModel() kbapi.PutFleetAgentPoliciesAgen Namespace: model.Namespace.ValueString(), } + if len(tags) > 0 { + body.GlobalDataTags = &tags + } + return body } diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index 7d6714c13..c28725654 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -34,7 +34,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - stateModel.populateFromAPI(policy) + stateModel.populateFromAPI(ctx, policy) resp.State.Set(ctx, stateModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 7b0e4507d..92b402e17 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,6 +3,7 @@ package agent_policy import ( "context" + "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" @@ -12,74 +13,100 @@ import ( ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema.Description = "Creates a new Fleet Agent Policy. See https://www.elastic.co/guide/en/fleet/current/agent-policy.html" - resp.Schema.Attributes = map[string]schema.Attribute{ - "id": schema.StringAttribute{ - Description: "The ID of this resource.", - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), + resp.Schema = getSchema() +} + +func getSchema() schema.Schema { + return schema.Schema{ + Description: "Creates a new Fleet Agent Policy. See https://www.elastic.co/guide/en/fleet/current/agent-policy.html", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "The ID of this resource.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "policy_id": schema.StringAttribute{ + Description: "Unique identifier of the agent policy.", + Computed: true, + Optional: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + stringplanmodifier.RequiresReplace(), + }, + }, + "name": schema.StringAttribute{ + Description: "The name of the agent policy.", + Required: true, + }, + "namespace": schema.StringAttribute{ + Description: "The namespace of the agent policy.", + Required: true, + }, + "description": schema.StringAttribute{ + Description: "The description of the agent policy.", + Optional: true, + }, + "data_output_id": schema.StringAttribute{ + Description: "The identifier for the data output.", + Optional: true, + }, + "monitoring_output_id": schema.StringAttribute{ + Description: "The identifier for monitoring output.", + Optional: true, }, - }, - "policy_id": schema.StringAttribute{ - Description: "Unique identifier of the agent policy.", - Computed: true, - Optional: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), + "fleet_server_host_id": schema.StringAttribute{ + Description: "The identifier for the Fleet server host.", + Optional: true, }, - }, - "name": schema.StringAttribute{ - Description: "The name of the agent policy.", - Required: true, - }, - "namespace": schema.StringAttribute{ - Description: "The namespace of the agent policy.", - Required: true, - }, - "description": schema.StringAttribute{ - Description: "The description of the agent policy.", - Optional: true, - }, - "data_output_id": schema.StringAttribute{ - Description: "The identifier for the data output.", - Optional: true, - }, - "monitoring_output_id": schema.StringAttribute{ - Description: "The identifier for monitoring output.", - Optional: true, - }, - "fleet_server_host_id": schema.StringAttribute{ - Description: "The identifier for the Fleet server host.", - Optional: true, - }, - "download_source_id": schema.StringAttribute{ - Description: "The identifier for the Elastic Agent binary download server.", - Optional: true, - }, - "monitor_logs": schema.BoolAttribute{ - Description: "Enable collection of agent logs.", - Computed: true, - Optional: true, - Default: booldefault.StaticBool(false), - }, - "monitor_metrics": schema.BoolAttribute{ - Description: "Enable collection of agent metrics.", - Computed: true, - Optional: true, - Default: booldefault.StaticBool(false), - }, - "skip_destroy": schema.BoolAttribute{ - Description: "Set to true if you do not wish the agent policy to be deleted at destroy time, and instead just remove the agent policy from the Terraform state.", - Optional: true, - }, - "sys_monitoring": schema.BoolAttribute{ - Description: "Enable collection of system logs and metrics.", - Optional: true, - PlanModifiers: []planmodifier.Bool{ - boolplanmodifier.RequiresReplace(), + "download_source_id": schema.StringAttribute{ + Description: "The identifier for the Elastic Agent binary download server.", + Optional: true, }, - }, - } + "monitor_logs": schema.BoolAttribute{ + Description: "Enable collection of agent logs.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(false), + }, + "monitor_metrics": schema.BoolAttribute{ + Description: "Enable collection of agent metrics.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(false), + }, + "skip_destroy": schema.BoolAttribute{ + Description: "Set to true if you do not wish the agent policy to be deleted at destroy time, and instead just remove the agent policy from the Terraform state.", + Optional: true, + }, + "sys_monitoring": schema.BoolAttribute{ + Description: "Enable collection of system logs and metrics.", + Optional: true, + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.RequiresReplace(), + }, + }, + "global_data_tags": schema.ListNestedAttribute{ + Description: "User defined data tags to apply to all inputs. Values can be strings, or numbers", + Optional: true, + + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "The name of the data tag.", + Required: true, + }, + "value": schema.StringAttribute{ + Description: "The value of the data tag.", + Required: true, + }, + }, + }, + }, + }} +} + +func getGlobalDataTagsType() attr.Type { + return getSchema().Attributes["global_data_tags"].GetType().(attr.TypeWithElementType).ElementType() } diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 68313eeee..e7785c74b 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -22,7 +22,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body := planModel.toAPIUpdateModel() + body := planModel.toAPIUpdateModel(ctx) policyID := planModel.PolicyID.ValueString() policy, diags := fleet.UpdateAgentPolicy(ctx, client, policyID, body) @@ -31,7 +31,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(policy) + planModel.populateFromAPI(ctx, policy) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From 7f3aed77cefb4107f8c04aeebe7ff1b97bedcfc6 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 20:47:07 +0000 Subject: [PATCH 03/89] minimum version --- internal/fleet/agent_policy/create.go | 11 ++++++- internal/fleet/agent_policy/models.go | 43 +++++++++++++++---------- internal/fleet/agent_policy/resource.go | 3 ++ internal/fleet/agent_policy/update.go | 12 ++++++- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 3cc917dc0..1aeb7eb78 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -22,7 +22,16 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body := planModel.toAPICreateModel(ctx) + sVersion, e := r.client.ServerVersion(ctx) + if e != nil { + return + } + + body, diags := planModel.toAPICreateModel(ctx, sVersion) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } sysMonitoring := planModel.SysMonitoring.ValueBool() policy, diags := fleet.CreateAgentPolicy(ctx, client, body, sysMonitoring) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 6a604382e..11a138e87 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -87,12 +87,8 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. return } -func (model agentPolicyModel) toAPICreateModel(ctx context.Context) kbapi.PostFleetAgentPoliciesJSONRequestBody { +func (model agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) - tags := make([]struct { - Name string `json:"name"` - Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` - }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabledLogs) @@ -113,14 +109,23 @@ func (model agentPolicyModel) toAPICreateModel(ctx context.Context) kbapi.PostFl Namespace: model.Namespace.ValueString(), } - if len(tags) > 0 { - body.GlobalDataTags = &tags + if len(model.GlobalDataTags.Elements()) > 0 { + if serverVersion.LessThan(MinVersionGlobalDataTags) { + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diag.Diagnostics{ + diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), + } + + } + diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) + if diags.HasError() { + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags + } } - return body + return body, nil } -func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody { +func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -129,11 +134,6 @@ func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFle monitoring = append(monitoring, kbapi.Metrics) } - tags := make([]struct { - Name string `json:"name"` - Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` - }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) - body := kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), @@ -145,9 +145,18 @@ func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFle Namespace: model.Namespace.ValueString(), } - if len(tags) > 0 { - body.GlobalDataTags = &tags + if len(model.GlobalDataTags.Elements()) > 0 { + if serverVersion.LessThan(MinVersionGlobalDataTags) { + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diag.Diagnostics{ + diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), + } + + } + diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) + if diags.HasError() { + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags + } } - return body + return body, nil } diff --git a/internal/fleet/agent_policy/resource.go b/internal/fleet/agent_policy/resource.go index 5d0628d33..917bec042 100644 --- a/internal/fleet/agent_policy/resource.go +++ b/internal/fleet/agent_policy/resource.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/elastic/terraform-provider-elasticstack/internal/clients" + "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -15,6 +16,8 @@ var ( _ resource.ResourceWithImportState = &agentPolicyResource{} ) +var MinVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) + // NewResource is a helper function to simplify the provider implementation. func NewResource() resource.Resource { return &agentPolicyResource{} diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index e7785c74b..504d3a4aa 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -22,7 +22,17 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body := planModel.toAPIUpdateModel(ctx) + sVersion, e := r.client.ServerVersion(ctx) + if e != nil { + return + } + + body, diags := planModel.toAPIUpdateModel(ctx, sVersion) + + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } policyID := planModel.PolicyID.ValueString() policy, diags := fleet.UpdateAgentPolicy(ctx, client, policyID, body) From 7306278a6e55fc258795ea8992d5ef33a8783afa Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 21:10:39 +0000 Subject: [PATCH 04/89] tests --- internal/fleet/agent_policy/resource_test.go | 123 +++++++++++++++++++ internal/fleet/agent_policy/update.go | 2 +- 2 files changed, 124 insertions(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index cd0d41d1f..0ba6cdedc 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -18,6 +18,7 @@ import ( ) var minVersionAgentPolicy = version.Must(version.NewVersion("8.6.0")) +var minVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) func TestAccResourceAgentPolicyFromSDK(t *testing.T) { policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) @@ -63,6 +64,8 @@ func TestAccResourceAgentPolicyFromSDK(t *testing.T) { func TestAccResourceAgentPolicy(t *testing.T) { policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) + policyNameGlobalDataTags := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) + var originalPolicyId string resource.Test(t, resource.TestCase{ @@ -118,6 +121,51 @@ func TestAccResourceAgentPolicy(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"skip_destroy"}, }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyCreateWithGlobalDataTags(policyNameGlobalDataTags, false), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "name", fmt.Sprintf("Policy %s", policyNameGlobalDataTags)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "namespace", "default"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "description", "Test Agent Policy"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "true"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3", "value3"), + ), + }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyUpdateWithGlobalDataTags(policyNameGlobalDataTags, false), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "name", fmt.Sprintf("Updated Policy %s", policyNameGlobalDataTags)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "namespace", "default"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "description", "This policy was updated"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1a"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2b"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), + ), + }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyUpdateWithNoGlobalDataTags(policyNameGlobalDataTags, false), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "name", fmt.Sprintf("Updated Policy %s", policyNameGlobalDataTags)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "namespace", "default"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "description", "This policy was updated without global data tags"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), + ), + }, }, }) } @@ -168,6 +216,81 @@ data "elasticstack_fleet_enrollment_tokens" "test_policy" { `, fmt.Sprintf("Policy %s", id), skipDestroy) } +func testAccResourceAgentPolicyCreateWithGlobalDataTags(id string, skipDestroy bool) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_fleet_agent_policy" "test_policy" { + name = "%s" + namespace = "default" + description = "Test Agent Policy" + monitor_logs = true + monitor_metrics = false + skip_destroy = %t + global_data_tags = { + tag1 = "value1" + tag2 = "value2" + tag3 = "value3" + } +} + +data "elasticstack_fleet_enrollment_tokens" "test_policy" { + policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id +} + +`, fmt.Sprintf("Policy %s", id), skipDestroy) +} + +func testAccResourceAgentPolicyUpdateWithGlobalDataTags(id string, skipDestroy bool) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_fleet_agent_policy" "test_policy" { + name = "%s" + namespace = "default" + description = "This policy was updated" + monitor_logs = false + monitor_metrics = true + skip_destroy = %t + global_data_tags = { + tag1 = "value1a" + tag2 = "value2b" + } +} + +data "elasticstack_fleet_enrollment_tokens" "test_policy" { + policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id +} +`, fmt.Sprintf("Updated Policy %s", id), skipDestroy) +} + +func testAccResourceAgentPolicyUpdateWithNoGlobalDataTags(id string, skipDestroy bool) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_fleet_agent_policy" "test_policy" { + name = "%s" + namespace = "default" + description = "This policy was updated without global data tags" + monitor_logs = false + monitor_metrics = true + skip_destroy = %t +} + +data "elasticstack_fleet_enrollment_tokens" "test_policy" { + policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id +} +`, fmt.Sprintf("Updated Policy %s", id), skipDestroy) +} func testAccResourceAgentPolicyUpdate(id string, skipDestroy bool) string { return fmt.Sprintf(` diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 504d3a4aa..2bdac21e8 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -28,7 +28,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq } body, diags := planModel.toAPIUpdateModel(ctx, sVersion) - + resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return From 7327d0aaf49b91f28e7721139c8b0d360da67294 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 22:05:06 +0000 Subject: [PATCH 05/89] test cleanup --- internal/fleet/agent_policy/create.go | 2 +- internal/fleet/agent_policy/models.go | 17 ++++++++++------- internal/fleet/agent_policy/read.go | 7 ++++++- internal/fleet/agent_policy/update.go | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 1aeb7eb78..e797b9688 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -40,7 +40,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - planModel.populateFromAPI(ctx, policy) + planModel.populateFromAPI(ctx, policy, sVersion) resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 11a138e87..254d5ce89 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -32,8 +32,6 @@ func newGlobalDataTagModel(data struct { } } -var minVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) - type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -51,7 +49,7 @@ type agentPolicyModel struct { GlobalDataTags types.List `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy) (diags diag.Diagnostics) { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) { if data == nil { return } @@ -81,13 +79,18 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if *data.GlobalDataTags != nil { - model.GlobalDataTags = utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diags, newGlobalDataTagModel) + if *data.GlobalDataTags != nil && serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) { + var diag diag.Diagnostics + gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) + if diag.HasError() { + return + } + model.GlobalDataTags = gdt } return } -func (model agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { @@ -125,7 +128,7 @@ func (model agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersio return body, nil } -func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index c28725654..c52c903bc 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -22,6 +22,11 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } + sVersion, e := r.client.ServerVersion(ctx) + if e != nil { + return + } + policyID := stateModel.PolicyID.ValueString() policy, diags := fleet.GetAgentPolicy(ctx, client, policyID) resp.Diagnostics.Append(diags...) @@ -34,7 +39,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - stateModel.populateFromAPI(ctx, policy) + stateModel.populateFromAPI(ctx, policy, sVersion) resp.State.Set(ctx, stateModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 2bdac21e8..8099e842b 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -41,7 +41,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(ctx, policy) + planModel.populateFromAPI(ctx, policy, sVersion) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From 8c0e117fcd98c679402c6f482c4b770a642fc966 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 04:47:25 +0000 Subject: [PATCH 06/89] lint --- internal/fleet/agent_policy/models.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 254d5ce89..55bc8ad52 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -87,7 +87,6 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. } model.GlobalDataTags = gdt } - return } func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { From 0073c53a03d4c2311ad9c56d21d15220ddf58a2c Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 05:10:50 +0000 Subject: [PATCH 07/89] schema description --- internal/fleet/agent_policy/schema.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 92b402e17..8c7c62cee 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -88,7 +88,7 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.ListNestedAttribute{ - Description: "User defined data tags to apply to all inputs. Values can be strings, or numbers", + Description: "User defined data tags to apply to all inputs.", Optional: true, NestedObject: schema.NestedAttributeObject{ @@ -98,7 +98,7 @@ func getSchema() schema.Schema { Required: true, }, "value": schema.StringAttribute{ - Description: "The value of the data tag.", + Description: "The string value of the data tag.", Required: true, }, }, From 1ae728f9e94be8763101ab0c9ed10fc31b779753 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 05:11:16 +0000 Subject: [PATCH 08/89] docs --- docs/resources/fleet_agent_policy.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index 431593ceb..92025f637 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,6 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. +- `global_data_tags` (Attributes List) User defined data tags to apply to all inputs. (see [below for nested schema](#nestedatt--global_data_tags)) - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. @@ -52,6 +53,14 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `id` (String) The ID of this resource. + +### Nested Schema for `global_data_tags` + +Required: + +- `name` (String) The name of the data tag. +- `value` (String) The string value of the data tag. + ## Import Import is supported using the following syntax: From 741b3f2fb62bf4b490687f271a2e0967b0a4ad70 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:08:28 +0000 Subject: [PATCH 09/89] if datatags is nil --- internal/fleet/agent_policy/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 55bc8ad52..0c85a0ee2 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -79,7 +79,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if *data.GlobalDataTags != nil && serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) { + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && data.GlobalDataTags != nil { var diag diag.Diagnostics gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) if diag.HasError() { From 80e5831f7892affa6ceaf32b57a5be701d659901 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:13:07 +0000 Subject: [PATCH 10/89] len not nil --- internal/fleet/agent_policy/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 0c85a0ee2..6511beabb 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -79,7 +79,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && data.GlobalDataTags != nil { + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && len(*data.GlobalDataTags) > 0 { var diag diag.Diagnostics gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) if diag.HasError() { From 0f10127befd9db0b5ffd18048cff48a2123852a4 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:26:43 +0000 Subject: [PATCH 11/89] reflect instead --- internal/fleet/agent_policy/models.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 6511beabb..59dbce08c 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -2,6 +2,7 @@ package agent_policy import ( "context" + "reflect" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -32,6 +33,18 @@ func newGlobalDataTagModel(data struct { } } +func hasKey(s interface{}, key string) bool { + val := reflect.ValueOf(s) + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + if val.Kind() != reflect.Struct { + return false + } + field := val.FieldByName(key) + return field.IsValid() +} + type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -79,7 +92,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && len(*data.GlobalDataTags) > 0 { + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && hasKey(data, "GlobalDataTags") { var diag diag.Diagnostics gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) if diag.HasError() { From edb361375a8651cc1c87f53c0e6e4a19240f8184 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:52:52 +0000 Subject: [PATCH 12/89] ehh --- internal/fleet/agent_policy/models.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 59dbce08c..e37fa09b9 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -22,7 +21,7 @@ type globalDataTagModel struct { func newGlobalDataTagModel(data struct { Name string "json:\"name\"" Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" -}, meta utils.ListMeta) globalDataTagModel { +}) globalDataTagModel { val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() if err != nil { panic(err) @@ -94,11 +93,18 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Namespace = types.StringValue(data.Namespace) if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && hasKey(data, "GlobalDataTags") { var diag diag.Diagnostics - gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) + gdt := []globalDataTagModel{} + for _, val := range *data.GlobalDataTags { + gdt = append(gdt, newGlobalDataTagModel(val)) + } + gdtList, diags := types.ListValueFrom(ctx, getGlobalDataTagsType(), gdt) + if diags.HasError() { + return + } + model.GlobalDataTags = gdtList if diag.HasError() { return } - model.GlobalDataTags = gdt } } From a84e867d9849f70ed0427ecbc5125d08dd7108d2 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 17:16:28 +0000 Subject: [PATCH 13/89] deref --- internal/fleet/agent_policy/models.go | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index e37fa09b9..b553735eb 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -2,7 +2,6 @@ package agent_policy import ( "context" - "reflect" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -32,18 +31,6 @@ func newGlobalDataTagModel(data struct { } } -func hasKey(s interface{}, key string) bool { - val := reflect.ValueOf(s) - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - if val.Kind() != reflect.Struct { - return false - } - field := val.FieldByName(key) - return field.IsValid() -} - type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -91,10 +78,10 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && hasKey(data, "GlobalDataTags") { - var diag diag.Diagnostics + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { + gdt := []globalDataTagModel{} - for _, val := range *data.GlobalDataTags { + for _, val := range utils.Deref(data.GlobalDataTags) { gdt = append(gdt, newGlobalDataTagModel(val)) } gdtList, diags := types.ListValueFrom(ctx, getGlobalDataTagsType(), gdt) @@ -102,9 +89,6 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. return } model.GlobalDataTags = gdtList - if diag.HasError() { - return - } } } From 4559698b1194aeb5d5f65963172a62a5ae3c86f3 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 17:35:47 +0000 Subject: [PATCH 14/89] test mod --- internal/fleet/agent_policy/resource_test.go | 32 ++++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 0ba6cdedc..450725b2b 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -147,7 +147,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1a"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2b"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2a"), resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), ), }, @@ -230,11 +230,18 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = true monitor_metrics = false skip_destroy = %t - global_data_tags = { - tag1 = "value1" - tag2 = "value2" - tag3 = "value3" - } + global_data_tags = [ + { + name = "tag1" + value = "value1" + },{ + name = "tag2" + value = "value2" + },{ + name = "tag3" + value = "value3" + } + ] } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -258,10 +265,15 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = false monitor_metrics = true skip_destroy = %t - global_data_tags = { - tag1 = "value1a" - tag2 = "value2b" - } + global_data_tags = [ + { + name = "tag1" + value = "value1a" + },{ + name = "tag2" + value = "value2a" + } + ] } data "elasticstack_fleet_enrollment_tokens" "test_policy" { From 443d9e3efdb496ab25f6f153f22ff54aec1242d5 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 13:12:22 -0500 Subject: [PATCH 15/89] temp dev --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2616ae1d9..950a94b8d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { - "image": "mcr.microsoft.com/devcontainers/universal:2", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/terraform:1": {} } -} \ No newline at end of file +} From 221bceb88f49cbd809e4da46bf94f52ffdbdd697 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 13:14:33 -0500 Subject: [PATCH 16/89] temp dev2 --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 950a94b8d..cb3325196 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "image": "mcr.microsoft.com/devcontainers/go", "features": { "ghcr.io/devcontainers/features/terraform:1": {} } From d33762f2fdea2efd7439fe3cd5c77c121d9b8d7d Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 13:48:33 -0500 Subject: [PATCH 17/89] temp dev 3 --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cb3325196..12198c044 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,7 @@ { "image": "mcr.microsoft.com/devcontainers/go", "features": { - "ghcr.io/devcontainers/features/terraform:1": {} + "ghcr.io/devcontainers/features/terraform:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": {} } } From 5934e7814cf025e5b213e9faac49660f58a483eb Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 16:38:16 -0500 Subject: [PATCH 18/89] to jsonencode --- .devcontainer/devcontainer.json | 7 -- internal/fleet/agent_policy/create.go | 6 +- internal/fleet/agent_policy/models.go | 94 ++++++++++---------- internal/fleet/agent_policy/read.go | 6 +- internal/fleet/agent_policy/resource_test.go | 8 +- internal/fleet/agent_policy/schema.go | 22 +---- 6 files changed, 65 insertions(+), 78 deletions(-) delete mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 12198c044..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "image": "mcr.microsoft.com/devcontainers/go", - "features": { - "ghcr.io/devcontainers/features/terraform:1": {}, - "ghcr.io/devcontainers/features/docker-in-docker:2": {} - } -} diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index e797b9688..ea4420777 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -40,7 +40,11 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - planModel.populateFromAPI(ctx, policy, sVersion) + diags = planModel.populateFromAPI(ctx, policy, sVersion) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index b553735eb..10014417e 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -2,6 +2,7 @@ package agent_policy import ( "context" + "encoding/json" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -12,24 +13,24 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -type globalDataTagModel struct { - Name types.String `tfsdk:"name"` - Value types.String `tfsdk:"value"` -} - -func newGlobalDataTagModel(data struct { - Name string "json:\"name\"" - Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" -}) globalDataTagModel { - val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() - if err != nil { - panic(err) - } - return globalDataTagModel{ - Name: types.StringValue(data.Name), - Value: types.StringValue(val), - } -} +// type globalDataTagModel struct { +// Name types.String `tfsdk:"name"` +// Value types.String `tfsdk:"value"` +// } + +// func newGlobalDataTagModel(data struct { +// Name string "json:\"name\"" +// Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" +// }) globalDataTagModel { +// val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() +// if err != nil { +// panic(err) +// } +// return globalDataTagModel{ +// Name: types.StringValue(data.Name), +// Value: types.StringValue(val), +// } +// } type agentPolicyModel struct { ID types.String `tfsdk:"id"` @@ -45,12 +46,12 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` - GlobalDataTags types.List `tfsdk:"global_data_tags"` + GlobalDataTags types.String `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { if data == nil { - return + return nil } model.ID = types.StringValue(data.Id) @@ -79,17 +80,16 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { - - gdt := []globalDataTagModel{} - for _, val := range utils.Deref(data.GlobalDataTags) { - gdt = append(gdt, newGlobalDataTagModel(val)) + diags := diag.Diagnostics{} + d, err := json.Marshal(data.GlobalDataTags) + if err != nil { + diags.AddError("Failed to marshal global data tags", err.Error()) + return diags } - gdtList, diags := types.ListValueFrom(ctx, getGlobalDataTagsType(), gdt) - if diags.HasError() { - return - } - model.GlobalDataTags = gdtList + model.GlobalDataTags = types.StringValue(string(d)) } + + return nil } func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { @@ -114,19 +114,20 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.Elements()) > 0 { + if len(model.GlobalDataTags.ValueString()) > 0 { + var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diag.Diagnostics{ - diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), - } - + diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) - if diags.HasError() { + + str := model.GlobalDataTags.ValueString() + err := json.Unmarshal([]byte(str), body.GlobalDataTags) + if err != nil { + diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } } - return body, nil } @@ -150,17 +151,20 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.Elements()) > 0 { + if len(model.GlobalDataTags.ValueString()) > 0 { + var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diag.Diagnostics{ - diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), - } - + diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) - if diags.HasError() { + + str := model.GlobalDataTags.ValueString() + err := json.Unmarshal([]byte(str), body.GlobalDataTags) + if err != nil { + diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } + } return body, nil diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index c52c903bc..34916f0bd 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -39,7 +39,11 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - stateModel.populateFromAPI(ctx, policy, sVersion) + diags = stateModel.populateFromAPI(ctx, policy, sVersion) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } resp.State.Set(ctx, stateModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 450725b2b..51b5c7258 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -230,7 +230,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = true monitor_metrics = false skip_destroy = %t - global_data_tags = [ + global_data_tags = jsonencode([ { name = "tag1" value = "value1" @@ -241,7 +241,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { name = "tag3" value = "value3" } - ] + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -265,7 +265,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = false monitor_metrics = true skip_destroy = %t - global_data_tags = [ + global_data_tags = jsonencode([ { name = "tag1" value = "value1a" @@ -273,7 +273,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { name = "tag2" value = "value2a" } - ] + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 8c7c62cee..bebd16a9c 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,7 +3,6 @@ package agent_policy import ( "context" - "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" @@ -87,26 +86,9 @@ func getSchema() schema.Schema { boolplanmodifier.RequiresReplace(), }, }, - "global_data_tags": schema.ListNestedAttribute{ - Description: "User defined data tags to apply to all inputs.", + "global_data_tags": schema.StringAttribute{ + Description: "JSON encoded defined data tags to apply to all inputs.", Optional: true, - - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "name": schema.StringAttribute{ - Description: "The name of the data tag.", - Required: true, - }, - "value": schema.StringAttribute{ - Description: "The string value of the data tag.", - Required: true, - }, - }, - }, }, }} } - -func getGlobalDataTagsType() attr.Type { - return getSchema().Attributes["global_data_tags"].GetType().(attr.TypeWithElementType).ElementType() -} From 16295270474533122e8ee05fbd09c8dcde912278 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 16:41:25 -0500 Subject: [PATCH 19/89] docs --- docs/resources/fleet_agent_policy.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index 92025f637..ec223b928 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,7 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (Attributes List) User defined data tags to apply to all inputs. (see [below for nested schema](#nestedatt--global_data_tags)) +- `global_data_tags` (String) JSON encoded defined data tags to apply to all inputs. - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. @@ -53,14 +53,6 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `id` (String) The ID of this resource. - -### Nested Schema for `global_data_tags` - -Required: - -- `name` (String) The name of the data tag. -- `value` (String) The string value of the data tag. - ## Import Import is supported using the following syntax: From 82a0348bf6e59b5f23497420473dee7302c15bad Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 16:53:47 -0500 Subject: [PATCH 20/89] pointers --- internal/fleet/agent_policy/models.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 10014417e..58796faef 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -121,8 +121,8 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueString() - err := json.Unmarshal([]byte(str), body.GlobalDataTags) + str := model.GlobalDataTags.ValueStringPointer() + err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) if err != nil { diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags @@ -158,8 +158,8 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueString() - err := json.Unmarshal([]byte(str), body.GlobalDataTags) + str := model.GlobalDataTags.ValueStringPointer() + err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) if err != nil { diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags From 945f95e4ac1f41838524ecd410232a56e359d08e Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 19:26:17 -0500 Subject: [PATCH 21/89] maybe json --- internal/fleet/agent_policy/models.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 58796faef..4c1250ba8 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -122,11 +122,17 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi } str := model.GlobalDataTags.ValueStringPointer() - err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) + var items []struct { + Name string `json:"name"` + Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` + } + + err := json.Unmarshal([]byte(utils.Deref(str)), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } + *body.GlobalDataTags = items } return body, nil } @@ -157,14 +163,17 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueStringPointer() - err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) + var items []struct { + Name string `json:"name"` + Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` + } + err := json.Unmarshal([]byte(utils.Deref(str)), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - + *body.GlobalDataTags = items } return body, nil From 75977b165c8bba3146bd8fcf36625430148f4d99 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 18:09:00 -0500 Subject: [PATCH 22/89] 8.17.3 generate with new transform to combine global_data_tags schemas --- generated/kbapi/kibana.gen.go | 1186 ++++++++++++++++++++++----- generated/kbapi/transform_schema.go | 20 + 2 files changed, 1001 insertions(+), 205 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index 93472041d..a2ea9c046 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -39,11 +39,11 @@ const ( AgentPolicyMonitoringEnabledTraces AgentPolicyMonitoringEnabled = "traces" ) -// Defines values for AgentPolicyPackagePolicies1InputsStreamsRelease. +// Defines values for AgentPolicyPackagePolicies1Inputs0StreamsRelease. const ( - AgentPolicyPackagePolicies1InputsStreamsReleaseBeta AgentPolicyPackagePolicies1InputsStreamsRelease = "beta" - AgentPolicyPackagePolicies1InputsStreamsReleaseExperimental AgentPolicyPackagePolicies1InputsStreamsRelease = "experimental" - AgentPolicyPackagePolicies1InputsStreamsReleaseGa AgentPolicyPackagePolicies1InputsStreamsRelease = "ga" + AgentPolicyPackagePolicies1Inputs0StreamsReleaseBeta AgentPolicyPackagePolicies1Inputs0StreamsRelease = "beta" + AgentPolicyPackagePolicies1Inputs0StreamsReleaseExperimental AgentPolicyPackagePolicies1Inputs0StreamsRelease = "experimental" + AgentPolicyPackagePolicies1Inputs0StreamsReleaseGa AgentPolicyPackagePolicies1Inputs0StreamsRelease = "ga" ) // Defines values for AgentPolicyStatus. @@ -795,16 +795,28 @@ type DataViewsUpdateDataViewRequestObjectInner struct { // 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"` + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` + AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` + AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` Name string `json:"name"` } `json:"agent_features,omitempty"` + Agentless *struct { + Resources *struct { + Requests *struct { + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` + } `json:"requests,omitempty"` + } `json:"resources,omitempty"` + } `json:"agentless,omitempty"` Agents *float32 `json:"agents,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` @@ -812,17 +824,14 @@ type AgentPolicy struct { 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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -845,7 +854,7 @@ type AgentPolicy struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -855,12 +864,19 @@ type AgentPolicy struct { 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"` + Overrides *map[string]interface{} `json:"overrides"` + PackagePolicies *AgentPolicy_PackagePolicies `json:"package_policies,omitempty"` + RequiredVersions *[]struct { + // Percentage Target percentage of agents to auto upgrade + Percentage float32 `json:"percentage"` + + // Version Target version for automatic agent upgrade + Version string `json:"version"` + } `json:"required_versions"` + 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"` @@ -871,17 +887,6 @@ type AgentPolicy struct { 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 @@ -890,69 +895,17 @@ 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"` + 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 *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"` + Inputs AgentPolicy_PackagePolicies_1_Inputs `json:"inputs"` + IsManaged *bool `json:"is_managed,omitempty"` // Name Package policy name (should be unique) Name string `json:"name"` @@ -993,16 +946,14 @@ type AgentPolicyPackagePolicies1 = []struct { SecretReferences *[]struct { Id string `json:"id"` } `json:"secret_references,omitempty"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` + SpaceIds *[]string `json:"spaceIds,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"` - Version *string `json:"version,omitempty"` + // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. + SupportsAgentless *bool `json:"supports_agentless"` + UpdatedAt string `json:"updated_at"` + UpdatedBy string `json:"updated_by"` + Vars *AgentPolicy_PackagePolicies_1_Vars `json:"vars,omitempty"` + Version *string `json:"version,omitempty"` } // AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges defines model for AgentPolicy.PackagePolicies.1.Elasticsearch.Privileges. @@ -1017,8 +968,180 @@ type AgentPolicy_PackagePolicies_1_Elasticsearch struct { AdditionalProperties map[string]interface{} `json:"-"` } -// AgentPolicyPackagePolicies1InputsStreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.Streams.Release. -type AgentPolicyPackagePolicies1InputsStreamsRelease string +// AgentPolicyPackagePolicies1Inputs0 defines model for . +type AgentPolicyPackagePolicies1Inputs0 = []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 *AgentPolicyPackagePolicies1Inputs0StreamsRelease `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"` +} + +// AgentPolicyPackagePolicies1Inputs0StreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.0.Streams.Release. +type AgentPolicyPackagePolicies1Inputs0StreamsRelease string + +// AgentPolicyPackagePolicies1Inputs1 Package policy inputs (see integration documentation to know what inputs are available) +type AgentPolicyPackagePolicies1Inputs1 map[string]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]struct { + // Enabled enable or disable that stream, (default to true) + Enabled *bool `json:"enabled,omitempty"` + + // Vars Input/stream level variable (see integration documentation for more information) + Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties `json:"vars,omitempty"` + } `json:"streams,omitempty"` + + // Vars Input/stream level variable (see integration documentation for more information) + Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties `json:"vars,omitempty"` +} + +// AgentPolicyPackagePolicies1Inputs1StreamsVars0 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars0 = bool + +// AgentPolicyPackagePolicies1Inputs1StreamsVars1 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars1 = string + +// AgentPolicyPackagePolicies1Inputs1StreamsVars2 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars2 = float32 + +// AgentPolicyPackagePolicies1Inputs1StreamsVars3 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars3 = []string + +// AgentPolicyPackagePolicies1Inputs1StreamsVars4 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars4 = []float32 + +// AgentPolicyPackagePolicies1Inputs1StreamsVars5 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars5 struct { + Id string `json:"id"` + IsSecretRef bool `json:"isSecretRef"` +} + +// AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Streams.Vars.AdditionalProperties. +type AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties struct { + union json.RawMessage +} + +// AgentPolicyPackagePolicies1Inputs1Vars0 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars0 = bool + +// AgentPolicyPackagePolicies1Inputs1Vars1 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars1 = string + +// AgentPolicyPackagePolicies1Inputs1Vars2 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars2 = float32 + +// AgentPolicyPackagePolicies1Inputs1Vars3 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars3 = []string + +// AgentPolicyPackagePolicies1Inputs1Vars4 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars4 = []float32 + +// AgentPolicyPackagePolicies1Inputs1Vars5 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars5 struct { + Id string `json:"id"` + IsSecretRef bool `json:"isSecretRef"` +} + +// AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Vars.AdditionalProperties. +type AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties struct { + union json.RawMessage +} + +// AgentPolicy_PackagePolicies_1_Inputs defines model for AgentPolicy.PackagePolicies.1.Inputs. +type AgentPolicy_PackagePolicies_1_Inputs struct { + union json.RawMessage +} + +// AgentPolicyPackagePolicies1Vars0 Package variable (see integration documentation for more information) +type AgentPolicyPackagePolicies1Vars0 map[string]struct { + Frozen *bool `json:"frozen,omitempty"` + Type *string `json:"type,omitempty"` + Value interface{} `json:"value"` +} + +// AgentPolicyPackagePolicies1Vars1 Input/stream level variable (see integration documentation for more information) +type AgentPolicyPackagePolicies1Vars1 map[string]*AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties + +// AgentPolicyPackagePolicies1Vars10 defines model for . +type AgentPolicyPackagePolicies1Vars10 = bool + +// AgentPolicyPackagePolicies1Vars11 defines model for . +type AgentPolicyPackagePolicies1Vars11 = string + +// AgentPolicyPackagePolicies1Vars12 defines model for . +type AgentPolicyPackagePolicies1Vars12 = float32 + +// AgentPolicyPackagePolicies1Vars13 defines model for . +type AgentPolicyPackagePolicies1Vars13 = []string + +// AgentPolicyPackagePolicies1Vars14 defines model for . +type AgentPolicyPackagePolicies1Vars14 = []float32 + +// AgentPolicyPackagePolicies1Vars15 defines model for . +type AgentPolicyPackagePolicies1Vars15 struct { + Id string `json:"id"` + IsSecretRef bool `json:"isSecretRef"` +} + +// AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Vars.1.AdditionalProperties. +type AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties struct { + union json.RawMessage +} + +// AgentPolicy_PackagePolicies_1_Vars defines model for AgentPolicy.PackagePolicies.1.Vars. +type AgentPolicy_PackagePolicies_1_Vars struct { + union json.RawMessage +} // AgentPolicy_PackagePolicies defines model for AgentPolicy.PackagePolicies. type AgentPolicy_PackagePolicies struct { @@ -1028,6 +1151,23 @@ type AgentPolicy_PackagePolicies struct { // AgentPolicyStatus defines model for AgentPolicy.Status. type AgentPolicyStatus string +// AgentPolicyGlobalDataTagsItem defines model for agent_policy_global_data_tags_item. +type AgentPolicyGlobalDataTagsItem struct { + Name string `json:"name"` + Value AgentPolicyGlobalDataTagsItem_Value `json:"value"` +} + +// AgentPolicyGlobalDataTagsItemValue0 defines model for . +type AgentPolicyGlobalDataTagsItemValue0 = string + +// AgentPolicyGlobalDataTagsItemValue1 defines model for . +type AgentPolicyGlobalDataTagsItemValue1 = float32 + +// AgentPolicyGlobalDataTagsItem_Value defines model for AgentPolicyGlobalDataTagsItem.Value. +type AgentPolicyGlobalDataTagsItem_Value struct { + union json.RawMessage +} + // 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. @@ -2065,10 +2205,13 @@ type PackagePolicy struct { 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"` + + // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. + SupportsAgentless *bool `json:"supports_agentless"` + 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. @@ -2114,7 +2257,10 @@ type PackagePolicyRequest struct { Package PackagePolicyRequestPackage `json:"package"` PolicyId *string `json:"policy_id"` PolicyIds *[]string `json:"policy_ids,omitempty"` - Vars *map[string]interface{} `json:"vars,omitempty"` + + // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. + SupportsAgentless *bool `json:"supports_agentless"` + Vars *map[string]interface{} `json:"vars,omitempty"` } // PackagePolicyRequestInput defines model for package_policy_request_input. @@ -2441,16 +2587,28 @@ type GetFleetAgentPoliciesParamsFormat string // PostFleetAgentPoliciesJSONBody defines parameters for PostFleetAgentPolicies. type PostFleetAgentPoliciesJSONBody 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"` + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` + AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` + AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` Name string `json:"name"` } `json:"agent_features,omitempty"` + Agentless *struct { + Resources *struct { + Requests *struct { + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` + } `json:"requests,omitempty"` + } `json:"resources,omitempty"` + } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2458,17 +2616,14 @@ type PostFleetAgentPoliciesJSONBody struct { 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 PostFleetAgentPoliciesJSONBody_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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -2488,7 +2643,7 @@ type PostFleetAgentPoliciesJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2499,8 +2654,14 @@ type PostFleetAgentPoliciesJSONBody struct { // 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"` - RequiredVersions *interface{} `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *[]struct { + // Percentage Target percentage of agents to auto upgrade + Percentage float32 `json:"percentage"` + + // Version Target version for automatic agent upgrade + Version string `json:"version"` + } `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -2512,17 +2673,6 @@ type PostFleetAgentPoliciesParams struct { SysMonitoring *bool `form:"sys_monitoring,omitempty" json:"sys_monitoring,omitempty"` } -// PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue0 defines parameters for PostFleetAgentPolicies. -type PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue0 = string - -// PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue1 defines parameters for PostFleetAgentPolicies. -type PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue1 = float32 - -// PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value defines parameters for PostFleetAgentPolicies. -type PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value struct { - union json.RawMessage -} - // PostFleetAgentPoliciesJSONBodyMonitoringEnabled defines parameters for PostFleetAgentPolicies. type PostFleetAgentPoliciesJSONBodyMonitoringEnabled string @@ -2545,16 +2695,28 @@ type GetFleetAgentPoliciesAgentpolicyidParamsFormat string // PutFleetAgentPoliciesAgentpolicyidJSONBody defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidJSONBody 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"` + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` + AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` + AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` Name string `json:"name"` } `json:"agent_features,omitempty"` + Agentless *struct { + Resources *struct { + Requests *struct { + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` + } `json:"requests,omitempty"` + } `json:"resources,omitempty"` + } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2562,17 +2724,14 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { 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 PutFleetAgentPoliciesAgentpolicyidJSONBody_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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -2592,7 +2751,7 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2603,8 +2762,14 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { // 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"` - RequiredVersions *interface{} `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *[]struct { + // Percentage Target percentage of agents to auto upgrade + Percentage float32 `json:"percentage"` + + // Version Target version for automatic agent upgrade + Version string `json:"version"` + } `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -2619,17 +2784,6 @@ type PutFleetAgentPoliciesAgentpolicyidParams struct { // PutFleetAgentPoliciesAgentpolicyidParamsFormat defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidParamsFormat string -// PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue0 defines parameters for PutFleetAgentPoliciesAgentpolicyid. -type PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue0 = string - -// PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue1 defines parameters for PutFleetAgentPoliciesAgentpolicyid. -type PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue1 = float32 - -// PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value defines parameters for PutFleetAgentPoliciesAgentpolicyid. -type PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value struct { - union json.RawMessage -} - // PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled string @@ -10231,22 +10385,126 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { 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 +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars3 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars3() (AgentPolicyPackagePolicies1Inputs1StreamsVars3, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars4 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars4() (AgentPolicyPackagePolicies1Inputs1StreamsVars4, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars4 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 { +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) error { b, err := json.Marshal(v) if err != nil { return err @@ -10257,22 +10515,22 @@ func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue0( 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 +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars5 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars5() (AgentPolicyPackagePolicies1Inputs1StreamsVars5, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars5 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 { +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) error { b, err := json.Marshal(v) if err != nil { return err @@ -10283,32 +10541,32 @@ func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue1( return err } -func (t AgentPolicy_GlobalDataTags_Value) MarshalJSON() ([]byte, error) { +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *AgentPolicy_GlobalDataTags_Value) UnmarshalJSON(b []byte) error { +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) 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 +// AsAgentPolicyPackagePolicies1Inputs1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars0 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars0() (AgentPolicyPackagePolicies1Inputs1Vars0, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars0 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 { +// FromAgentPolicyPackagePolicies1Inputs1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) error { b, err := json.Marshal(v) if err != nil { return err @@ -10319,22 +10577,22 @@ func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies0(v AgentPo return err } -// AsAgentPolicyPackagePolicies1 returns the union data inside the AgentPolicy_PackagePolicies as a AgentPolicyPackagePolicies1 -func (t AgentPolicy_PackagePolicies) AsAgentPolicyPackagePolicies1() (AgentPolicyPackagePolicies1, error) { - var body AgentPolicyPackagePolicies1 +// AsAgentPolicyPackagePolicies1Inputs1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars1 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars1() (AgentPolicyPackagePolicies1Inputs1Vars1, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars1 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 { +// FromAgentPolicyPackagePolicies1Inputs1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) error { b, err := json.Marshal(v) if err != nil { return err @@ -10345,12 +10603,530 @@ func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies1(v AgentPo return err } -func (t AgentPolicy_PackagePolicies) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// AsAgentPolicyPackagePolicies1Inputs1Vars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars2 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars2() (AgentPolicyPackagePolicies1Inputs1Vars2, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars2 + err := json.Unmarshal(t.union, &body) + return body, err } -func (t *AgentPolicy_PackagePolicies) UnmarshalJSON(b []byte) error { +// FromAgentPolicyPackagePolicies1Inputs1Vars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1Vars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars3 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars3() (AgentPolicyPackagePolicies1Inputs1Vars3, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1Vars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1Vars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars4 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars4() (AgentPolicyPackagePolicies1Inputs1Vars4, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars4 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1Vars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1Vars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars5 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars5() (AgentPolicyPackagePolicies1Inputs1Vars5, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars5 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1Vars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) 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_1_Inputs_1_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Inputs0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs0 +func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs0() (AgentPolicyPackagePolicies1Inputs0, error) { + var body AgentPolicyPackagePolicies1Inputs0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs0 +func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs0 +func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs1 +func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs1() (AgentPolicyPackagePolicies1Inputs1, error) { + var body AgentPolicyPackagePolicies1Inputs1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs1 +func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs1 +func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) 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_1_Inputs) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Inputs) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Vars10 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars10 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars10() (AgentPolicyPackagePolicies1Vars10, error) { + var body AgentPolicyPackagePolicies1Vars10 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars10 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars10 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars10 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars10 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars11 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars11 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars11() (AgentPolicyPackagePolicies1Vars11, error) { + var body AgentPolicyPackagePolicies1Vars11 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars11 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars11 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars11 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars11 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars12 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars12 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars12() (AgentPolicyPackagePolicies1Vars12, error) { + var body AgentPolicyPackagePolicies1Vars12 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars12 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars12 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars12 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars12 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars13 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars13 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars13() (AgentPolicyPackagePolicies1Vars13, error) { + var body AgentPolicyPackagePolicies1Vars13 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars13 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars13 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars13 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars13 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars14 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars14 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars14() (AgentPolicyPackagePolicies1Vars14, error) { + var body AgentPolicyPackagePolicies1Vars14 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars14 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars14 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars14 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars14 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars15 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars15 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars15() (AgentPolicyPackagePolicies1Vars15, error) { + var body AgentPolicyPackagePolicies1Vars15 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars15 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars15 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars15 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars15 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) 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_1_Vars_1_AdditionalProperties) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars0 +func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars0() (AgentPolicyPackagePolicies1Vars0, error) { + var body AgentPolicyPackagePolicies1Vars0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars1 +func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars1() (AgentPolicyPackagePolicies1Vars1, error) { + var body AgentPolicyPackagePolicies1Vars1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) 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_1_Vars) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Vars) 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 +} + +// AsAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue0 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue0() (AgentPolicyGlobalDataTagsItemValue0, error) { + var body AgentPolicyGlobalDataTagsItemValue0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue1 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue1() (AgentPolicyGlobalDataTagsItemValue1, error) { + var body AgentPolicyGlobalDataTagsItemValue1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue1 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyGlobalDataTagsItemValue1 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue1 +func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) 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 AgentPolicyGlobalDataTagsItem_Value) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } diff --git a/generated/kbapi/transform_schema.go b/generated/kbapi/transform_schema.go index 62a5cfd53..240f99a06 100644 --- a/generated/kbapi/transform_schema.go +++ b/generated/kbapi/transform_schema.go @@ -838,6 +838,26 @@ func transformFleetPaths(schema *Schema) { agentPolicyPath.Put.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) } + // do global_data_tags refs + schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") + // Define the value types for the GlobalDataTags + schema.Components.Set("schemas.agent_policy_global_data_tags_item", Map{ + "type": "object", + "properties": Map{ + "name": Map{"type": "string"}, + "value": Map{ + "oneOf": []Map{ + {"type": "string"}, + {"type": "number"}, + }, + }, + }, + "required": []string{"name", "value"}, + }) + + agentPoliciesPath.Post.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") + agentPolicyPath.Put.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") + // 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 From a01a80c9fb0803901b572eb398857ecdd46b357e Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 18:54:07 -0500 Subject: [PATCH 23/89] amazing, types arent screaming and tests pass --- docs/resources/fleet_agent_policy.md | 2 +- internal/fleet/agent_policy/create.go | 4 +- internal/fleet/agent_policy/models.go | 54 ++++++------------- internal/fleet/agent_policy/read.go | 2 +- internal/fleet/agent_policy/resource_test.go | 56 ++++++++------------ internal/fleet/agent_policy/schema.go | 5 +- internal/fleet/agent_policy/update.go | 4 +- 7 files changed, 49 insertions(+), 78 deletions(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index ec223b928..860d9fc10 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,7 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (String) JSON encoded defined data tags to apply to all inputs. +- `global_data_tags` (String) JSON encoded user-defined data tags to apply to all inputs. - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index ea4420777..3ed965cf2 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body, diags := planModel.toAPICreateModel(ctx, sVersion) + body, diags := planModel.toAPICreateModel(sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -40,7 +40,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - diags = planModel.populateFromAPI(ctx, policy, sVersion) + diags = planModel.populateFromAPI(policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 4c1250ba8..f41cefc84 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -1,7 +1,6 @@ package agent_policy import ( - "context" "encoding/json" "slices" @@ -13,25 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -// type globalDataTagModel struct { -// Name types.String `tfsdk:"name"` -// Value types.String `tfsdk:"value"` -// } - -// func newGlobalDataTagModel(data struct { -// Name string "json:\"name\"" -// Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" -// }) globalDataTagModel { -// val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() -// if err != nil { -// panic(err) -// } -// return globalDataTagModel{ -// Name: types.StringValue(data.Name), -// Value: types.StringValue(val), -// } -// } - type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -49,7 +29,7 @@ type agentPolicyModel struct { GlobalDataTags types.String `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { +func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { if data == nil { return nil } @@ -81,18 +61,19 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Namespace = types.StringValue(data.Namespace) if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { diags := diag.Diagnostics{} - d, err := json.Marshal(data.GlobalDataTags) + d, err := json.Marshal(utils.Deref(data.GlobalDataTags)) if err != nil { diags.AddError("Failed to marshal global data tags", err.Error()) return diags } - model.GlobalDataTags = types.StringValue(string(d)) + strD := string(d) + model.GlobalDataTags = types.StringPointerValue(&strD) } return nil } -func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { @@ -122,22 +103,21 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi } str := model.GlobalDataTags.ValueStringPointer() - var items []struct { - Name string `json:"name"` - Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` - } + var items []kbapi.AgentPolicyGlobalDataTagsItem - err := json.Unmarshal([]byte(utils.Deref(str)), &items) + err := json.Unmarshal([]byte(*str), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - *body.GlobalDataTags = items + + body.GlobalDataTags = &items } + return body, nil } -func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPIUpdateModel(serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -163,17 +143,17 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } + str := model.GlobalDataTags.ValueStringPointer() - var items []struct { - Name string `json:"name"` - Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` - } - err := json.Unmarshal([]byte(utils.Deref(str)), &items) + var items []kbapi.AgentPolicyGlobalDataTagsItem + + err := json.Unmarshal([]byte(*str), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - *body.GlobalDataTags = items + + body.GlobalDataTags = &items } return body, nil diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index 34916f0bd..5a8fd1f09 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -39,7 +39,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - diags = stateModel.populateFromAPI(ctx, policy, sVersion) + diags = stateModel.populateFromAPI(policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 51b5c7258..368247587 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -131,9 +131,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3", "value3"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1"},{"name":"tag2","value":1.1}]`), ), }, { @@ -146,10 +144,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1a"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2a"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), - ), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1a"}]`)), }, { SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), @@ -161,9 +156,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags"), ), }, }, @@ -231,17 +224,15 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_metrics = false skip_destroy = %t global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1" - },{ - name = "tag2" - value = "value2" - },{ - name = "tag3" - value = "value3" - } - ]) + { + name = "tag1" + value = "value1" + }, + { + name = "tag2" + value = 1.1 + } + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -259,21 +250,18 @@ provider "elasticstack" { } resource "elasticstack_fleet_agent_policy" "test_policy" { - name = "%s" - namespace = "default" - description = "This policy was updated" - monitor_logs = false + name = "%s" + namespace = "default" + description = "This policy was updated" + monitor_logs = false monitor_metrics = true - skip_destroy = %t + skip_destroy = %t global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1a" - },{ - name = "tag2" - value = "value2a" - } - ]) + { + name = "tag1" + value = "value1a" + } + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index bebd16a9c..123b3c740 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -87,8 +87,11 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.StringAttribute{ - Description: "JSON encoded defined data tags to apply to all inputs.", + Description: "JSON encoded user-defined data tags to apply to all inputs.", Optional: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, }} } diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 8099e842b..822ad68bd 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body, diags := planModel.toAPIUpdateModel(ctx, sVersion) + body, diags := planModel.toAPIUpdateModel(sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { @@ -41,7 +41,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(ctx, policy, sVersion) + planModel.populateFromAPI(policy, sVersion) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From faa7d25ed1e8bc5cf7131fc1f6e8aacdfceb5b75 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 19:10:42 -0500 Subject: [PATCH 24/89] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e5c7959..9d9875960 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Add `max_primary_shard_docs` condition to ILM rollover ([#845](https://github.com/elastic/terraform-provider-elasticstack/pull/845)) - Add missing entries to `data_view.field_formats.params` ([#1001](https://github.com/elastic/terraform-provider-elasticstack/pull/1001)) - Fix namespaces inconsistency when creating elasticstack_kibana_data_view resources ([#1011](https://github.com/elastic/terraform-provider-elasticstack/pull/1011)) +- Add `global_data_tags` to fleet agent policies. ([#1044](https://github.com/elastic/terraform-provider-elasticstack/pull/1044)) ## [0.11.13] - 2025-01-09 From e7227582c8c8e40d52f6ac7dc4ec80610228510c Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 20:29:19 -0500 Subject: [PATCH 25/89] seems like this breaks other things --- generated/kbapi/kibana.gen.go | 3325 ++++++++++++++++++++++----- generated/kbapi/transform_schema.go | 5 +- 2 files changed, 2767 insertions(+), 563 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index a2ea9c046..c212b610d 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -218,20 +218,20 @@ const ( OutputSslVerificationModeStrict OutputSslVerificationMode = "strict" ) -// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType. +// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0. 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" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" ) // Defines values for PackageInfoInstallationInfoInstallSource. @@ -261,20 +261,20 @@ const ( PackageInfoInstallationInfoInstalledEsTypeTransform PackageInfoInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageInfoInstallationInfoInstalledKibanaType. +// Defines values for PackageInfoInstallationInfoInstalledKibanaType0. 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" + PackageInfoInstallationInfoInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoInstalledKibanaType0 = "csp-rule-template" + PackageInfoInstallationInfoInstalledKibanaType0Dashboard PackageInfoInstallationInfoInstalledKibanaType0 = "dashboard" + PackageInfoInstallationInfoInstalledKibanaType0IndexPattern PackageInfoInstallationInfoInstalledKibanaType0 = "index-pattern" + PackageInfoInstallationInfoInstalledKibanaType0Lens PackageInfoInstallationInfoInstalledKibanaType0 = "lens" + PackageInfoInstallationInfoInstalledKibanaType0Map PackageInfoInstallationInfoInstalledKibanaType0 = "map" + PackageInfoInstallationInfoInstalledKibanaType0MlModule PackageInfoInstallationInfoInstalledKibanaType0 = "ml-module" + PackageInfoInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" + PackageInfoInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-saved-query" + PackageInfoInstallationInfoInstalledKibanaType0Search PackageInfoInstallationInfoInstalledKibanaType0 = "search" + PackageInfoInstallationInfoInstalledKibanaType0SecurityRule PackageInfoInstallationInfoInstalledKibanaType0 = "security-rule" + PackageInfoInstallationInfoInstalledKibanaType0Tag PackageInfoInstallationInfoInstalledKibanaType0 = "tag" + PackageInfoInstallationInfoInstalledKibanaType0Visualization PackageInfoInstallationInfoInstalledKibanaType0 = "visualization" ) // Defines values for PackageInfoInstallationInfoVerificationStatus. @@ -298,27 +298,35 @@ const ( PackageInfoReleaseGa PackageInfoRelease = "ga" ) -// Defines values for PackageInfoType. +// Defines values for PackageInfoType0. const ( - PackageInfoTypeContent PackageInfoType = "content" - PackageInfoTypeInput PackageInfoType = "input" - PackageInfoTypeIntegration PackageInfoType = "integration" + PackageInfoType0Integration PackageInfoType0 = "integration" ) -// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType. +// Defines values for PackageInfoType1. 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" + PackageInfoType1Input PackageInfoType1 = "input" +) + +// Defines values for PackageInfoType2. +const ( + PackageInfoType2Content PackageInfoType2 = "content" +) + +// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0. +const ( + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" ) // Defines values for PackageListItemInstallationInfoInstallSource. @@ -348,20 +356,20 @@ const ( PackageListItemInstallationInfoInstalledEsTypeTransform PackageListItemInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageListItemInstallationInfoInstalledKibanaType. +// Defines values for PackageListItemInstallationInfoInstalledKibanaType0. 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" + PackageListItemInstallationInfoInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoInstalledKibanaType0 = "csp-rule-template" + PackageListItemInstallationInfoInstalledKibanaType0Dashboard PackageListItemInstallationInfoInstalledKibanaType0 = "dashboard" + PackageListItemInstallationInfoInstalledKibanaType0IndexPattern PackageListItemInstallationInfoInstalledKibanaType0 = "index-pattern" + PackageListItemInstallationInfoInstalledKibanaType0Lens PackageListItemInstallationInfoInstalledKibanaType0 = "lens" + PackageListItemInstallationInfoInstalledKibanaType0Map PackageListItemInstallationInfoInstalledKibanaType0 = "map" + PackageListItemInstallationInfoInstalledKibanaType0MlModule PackageListItemInstallationInfoInstalledKibanaType0 = "ml-module" + PackageListItemInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" + PackageListItemInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-saved-query" + PackageListItemInstallationInfoInstalledKibanaType0Search PackageListItemInstallationInfoInstalledKibanaType0 = "search" + PackageListItemInstallationInfoInstalledKibanaType0SecurityRule PackageListItemInstallationInfoInstalledKibanaType0 = "security-rule" + PackageListItemInstallationInfoInstalledKibanaType0Tag PackageListItemInstallationInfoInstalledKibanaType0 = "tag" + PackageListItemInstallationInfoInstalledKibanaType0Visualization PackageListItemInstallationInfoInstalledKibanaType0 = "visualization" ) // Defines values for PackageListItemInstallationInfoVerificationStatus. @@ -385,11 +393,26 @@ const ( Ga PackageListItemRelease = "ga" ) -// Defines values for PackageListItemType. +// Defines values for PackageListItemType0. +const ( + PackageListItemType0Integration PackageListItemType0 = "integration" +) + +// Defines values for PackageListItemType1. +const ( + PackageListItemType1Input PackageListItemType1 = "input" +) + +// Defines values for PackageListItemType2. const ( - PackageListItemTypeContent PackageListItemType = "content" - PackageListItemTypeInput PackageListItemType = "input" - PackageListItemTypeIntegration PackageListItemType = "integration" + PackageListItemType2Content PackageListItemType2 = "content" +) + +// Defines values for ServerHostSslClientAuth. +const ( + ServerHostSslClientAuthNone ServerHostSslClientAuth = "none" + ServerHostSslClientAuthOptional ServerHostSslClientAuth = "optional" + ServerHostSslClientAuthRequired ServerHostSslClientAuth = "required" ) // Defines values for UpdateOutputElasticsearchPreset. @@ -469,10 +492,10 @@ const ( // Defines values for UpdateOutputSslVerificationMode. const ( - Certificate UpdateOutputSslVerificationMode = "certificate" - Full UpdateOutputSslVerificationMode = "full" - None UpdateOutputSslVerificationMode = "none" - Strict UpdateOutputSslVerificationMode = "strict" + UpdateOutputSslVerificationModeCertificate UpdateOutputSslVerificationMode = "certificate" + UpdateOutputSslVerificationModeFull UpdateOutputSslVerificationMode = "full" + UpdateOutputSslVerificationModeNone UpdateOutputSslVerificationMode = "none" + UpdateOutputSslVerificationModeStrict UpdateOutputSslVerificationMode = "strict" ) // Defines values for GetFleetAgentPoliciesParamsSortOrder. @@ -513,6 +536,20 @@ const ( Traces PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled = "traces" ) +// Defines values for PostFleetFleetServerHostsJSONBodySslClientAuth. +const ( + PostFleetFleetServerHostsJSONBodySslClientAuthNone PostFleetFleetServerHostsJSONBodySslClientAuth = "none" + PostFleetFleetServerHostsJSONBodySslClientAuthOptional PostFleetFleetServerHostsJSONBodySslClientAuth = "optional" + PostFleetFleetServerHostsJSONBodySslClientAuthRequired PostFleetFleetServerHostsJSONBodySslClientAuth = "required" +) + +// Defines values for PutFleetFleetServerHostsItemidJSONBodySslClientAuth. +const ( + PutFleetFleetServerHostsItemidJSONBodySslClientAuthNone PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "none" + PutFleetFleetServerHostsItemidJSONBodySslClientAuthOptional PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "optional" + PutFleetFleetServerHostsItemidJSONBodySslClientAuthRequired PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "required" +) + // Defines values for GetFleetPackagePoliciesParamsSortOrder. const ( GetFleetPackagePoliciesParamsSortOrderAsc GetFleetPackagePoliciesParamsSortOrder = "asc" @@ -792,6 +829,23 @@ type DataViewsUpdateDataViewRequestObjectInner struct { TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` } +// FleetAgentPolicyGlobalDataTagsItem defines model for Fleet_agent_policy_global_data_tags_item. +type FleetAgentPolicyGlobalDataTagsItem struct { + Name string `json:"name"` + Value FleetAgentPolicyGlobalDataTagsItem_Value `json:"value"` +} + +// FleetAgentPolicyGlobalDataTagsItemValue0 defines model for . +type FleetAgentPolicyGlobalDataTagsItemValue0 = string + +// FleetAgentPolicyGlobalDataTagsItemValue1 defines model for . +type FleetAgentPolicyGlobalDataTagsItemValue1 = float32 + +// FleetAgentPolicyGlobalDataTagsItem_Value defines model for FleetAgentPolicyGlobalDataTagsItem.Value. +type FleetAgentPolicyGlobalDataTagsItem_Value struct { + union json.RawMessage +} + // AgentPolicy defines model for agent_policy. type AgentPolicy struct { AdvancedSettings *struct { @@ -824,14 +878,14 @@ type AgentPolicy struct { 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 *[]AgentPolicyGlobalDataTagsItem `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"` + GlobalDataTags *[]FleetAgentPolicyGlobalDataTagsItem `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"` @@ -895,9 +949,11 @@ 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 { - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -1212,14 +1268,32 @@ type NewOutputElasticsearch struct { 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"` + Secrets *struct { + Ssl *struct { + Key *NewOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Type NewOutputElasticsearchType `json:"type"` } // NewOutputElasticsearchPreset defines model for NewOutputElasticsearch.Preset. type NewOutputElasticsearchPreset string +// NewOutputElasticsearchSecretsSslKey0 defines model for . +type NewOutputElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// NewOutputElasticsearchSecretsSslKey1 defines model for . +type NewOutputElasticsearchSecretsSslKey1 = string + +// NewOutputElasticsearch_Secrets_Ssl_Key defines model for NewOutputElasticsearch.Secrets.Ssl.Key. +type NewOutputElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // NewOutputElasticsearchType defines model for NewOutputElasticsearch.Type. type NewOutputElasticsearchType string @@ -1375,21 +1449,41 @@ type NewOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + KibanaApiKey *string `json:"kibana_api_key"` + KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *NewOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { + KibanaApiKey *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *NewOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + Ssl *struct { + Key *NewOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Type NewOutputRemoteElasticsearchType `json:"type"` + ServiceToken *string `json:"service_token"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + SyncIntegrations *bool `json:"sync_integrations,omitempty"` + Type NewOutputRemoteElasticsearchType `json:"type"` } // NewOutputRemoteElasticsearchPreset defines model for NewOutputRemoteElasticsearch.Preset. type NewOutputRemoteElasticsearchPreset string +// NewOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . +type NewOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { + Id string `json:"id"` +} + +// NewOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . +type NewOutputRemoteElasticsearchSecretsKibanaApiKey1 = string + +// NewOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for NewOutputRemoteElasticsearch.Secrets.KibanaApiKey. +type NewOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { + union json.RawMessage +} + // NewOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type NewOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1403,6 +1497,19 @@ type NewOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } +// NewOutputRemoteElasticsearchSecretsSslKey0 defines model for . +type NewOutputRemoteElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// NewOutputRemoteElasticsearchSecretsSslKey1 defines model for . +type NewOutputRemoteElasticsearchSecretsSslKey1 = string + +// NewOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for NewOutputRemoteElasticsearch.Secrets.Ssl.Key. +type NewOutputRemoteElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // NewOutputRemoteElasticsearchType defines model for NewOutputRemoteElasticsearch.Type. type NewOutputRemoteElasticsearchType string @@ -1438,28 +1545,55 @@ type NewOutputUnion struct { // 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:"-"` + 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"` + Secrets *OutputElasticsearch_Secrets `json:"secrets,omitempty"` + 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 +// OutputElasticsearchSecretsSslKey0 defines model for . +type OutputElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputElasticsearchSecretsSslKey1 defines model for . +type OutputElasticsearchSecretsSslKey1 = string + +// OutputElasticsearch_Secrets_Ssl_Key defines model for OutputElasticsearch.Secrets.Ssl.Key. +type OutputElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// OutputElasticsearch_Secrets_Ssl defines model for OutputElasticsearch.Secrets.Ssl. +type OutputElasticsearch_Secrets_Ssl struct { + Key *OutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputElasticsearch_Secrets defines model for OutputElasticsearch.Secrets. +type OutputElasticsearch_Secrets struct { + Ssl *OutputElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + // OutputElasticsearchType defines model for OutputElasticsearch.Type. type OutputElasticsearchType string @@ -1656,6 +1790,8 @@ type OutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + KibanaApiKey *string `json:"kibana_api_key"` + KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *OutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id"` @@ -1663,6 +1799,7 @@ type OutputRemoteElasticsearch struct { ServiceToken *string `json:"service_token"` Shipper *OutputShipper `json:"shipper"` Ssl *OutputSsl `json:"ssl"` + SyncIntegrations *bool `json:"sync_integrations,omitempty"` Type OutputRemoteElasticsearchType `json:"type"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1670,6 +1807,20 @@ type OutputRemoteElasticsearch struct { // OutputRemoteElasticsearchPreset defines model for OutputRemoteElasticsearch.Preset. type OutputRemoteElasticsearchPreset string +// OutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . +type OutputRemoteElasticsearchSecretsKibanaApiKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . +type OutputRemoteElasticsearchSecretsKibanaApiKey1 = string + +// OutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for OutputRemoteElasticsearch.Secrets.KibanaApiKey. +type OutputRemoteElasticsearch_Secrets_KibanaApiKey struct { + union json.RawMessage +} + // OutputRemoteElasticsearchSecretsServiceToken0 defines model for . type OutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1684,9 +1835,31 @@ type OutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } +// OutputRemoteElasticsearchSecretsSslKey0 defines model for . +type OutputRemoteElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputRemoteElasticsearchSecretsSslKey1 defines model for . +type OutputRemoteElasticsearchSecretsSslKey1 = string + +// OutputRemoteElasticsearch_Secrets_Ssl_Key defines model for OutputRemoteElasticsearch.Secrets.Ssl.Key. +type OutputRemoteElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// OutputRemoteElasticsearch_Secrets_Ssl defines model for OutputRemoteElasticsearch.Secrets.Ssl. +type OutputRemoteElasticsearch_Secrets_Ssl struct { + Key *OutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + // OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. type OutputRemoteElasticsearch_Secrets struct { + KibanaApiKey *OutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + Ssl *OutputRemoteElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1772,7 +1945,7 @@ type PackageInfo struct { Source *PackageInfo_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageInfoType `json:"type,omitempty"` + Type *PackageInfo_Type `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -1821,15 +1994,23 @@ type PackageInfo_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType string +// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. +type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 string + +// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . +type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 = string + +// PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. +type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` } // PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageInfo.InstallationInfo.ExperimentalDataStreamFeatures.Features. @@ -1866,22 +2047,30 @@ type PackageInfo_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoInstalledKibanaType defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. -type PackageInfoInstallationInfoInstalledKibanaType string +// PackageInfoInstallationInfoInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.InstalledKibana.Type.0. +type PackageInfoInstallationInfoInstalledKibanaType0 string + +// PackageInfoInstallationInfoInstalledKibanaType1 defines model for . +type PackageInfoInstallationInfoInstalledKibanaType1 = string + +// PackageInfo_InstallationInfo_InstalledKibana_Type defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. +type PackageInfo_InstallationInfo_InstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageInfo_InstallationInfo_InstalledKibana_Type `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"` + Name *string `json:"name,omitempty"` + StartedAt *string `json:"started_at,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1946,8 +2135,22 @@ type PackageInfo_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoType defines model for PackageInfo.Type. -type PackageInfoType string +// PackageInfoType0 defines model for PackageInfo.Type.0. +type PackageInfoType0 string + +// PackageInfoType1 defines model for PackageInfo.Type.1. +type PackageInfoType1 string + +// PackageInfoType2 defines model for PackageInfo.Type.2. +type PackageInfoType2 string + +// PackageInfoType3 defines model for . +type PackageInfoType3 = string + +// PackageInfo_Type defines model for PackageInfo.Type. +type PackageInfo_Type struct { + union json.RawMessage +} // PackageListItem defines model for package_list_item. type PackageListItem struct { @@ -1974,7 +2177,7 @@ type PackageListItem struct { Source *PackageListItem_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageListItemType `json:"type,omitempty"` + Type *PackageListItem_Type `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -2023,15 +2226,23 @@ type PackageListItem_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType string +// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. +type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 string + +// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . +type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 = string + +// PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. +type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` } // PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageListItem.InstallationInfo.ExperimentalDataStreamFeatures.Features. @@ -2068,22 +2279,30 @@ type PackageListItem_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoInstalledKibanaType defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. -type PackageListItemInstallationInfoInstalledKibanaType string +// PackageListItemInstallationInfoInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.InstalledKibana.Type.0. +type PackageListItemInstallationInfoInstalledKibanaType0 string + +// PackageListItemInstallationInfoInstalledKibanaType1 defines model for . +type PackageListItemInstallationInfoInstalledKibanaType1 = string + +// PackageListItem_InstallationInfo_InstalledKibana_Type defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. +type PackageListItem_InstallationInfo_InstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageListItem_InstallationInfo_InstalledKibana_Type `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"` + Name *string `json:"name,omitempty"` + StartedAt *string `json:"started_at,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2148,14 +2367,30 @@ type PackageListItem_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemType defines model for PackageListItem.Type. -type PackageListItemType string +// PackageListItemType0 defines model for PackageListItem.Type.0. +type PackageListItemType0 string + +// PackageListItemType1 defines model for PackageListItem.Type.1. +type PackageListItemType1 string + +// PackageListItemType2 defines model for PackageListItem.Type.2. +type PackageListItemType2 string + +// PackageListItemType3 defines model for . +type PackageListItemType3 = string + +// PackageListItem_Type defines model for PackageListItem.Type. +type PackageListItem_Type struct { + union json.RawMessage +} // PackagePolicy defines model for package_policy. type PackagePolicy struct { - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -2245,9 +2480,11 @@ type PackagePolicyInputStream struct { // 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"` + // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + 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"` @@ -2315,8 +2552,52 @@ type ServerHost struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id"` + Secrets *struct { + Ssl *struct { + EsKey *ServerHost_Secrets_Ssl_EsKey `json:"es_key,omitempty"` + Key *ServerHost_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Ssl *struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + ClientAuth *ServerHostSslClientAuth `json:"client_auth,omitempty"` + EsCertificate *string `json:"es_certificate,omitempty"` + EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` + EsKey *string `json:"es_key,omitempty"` + Key *string `json:"key,omitempty"` + } `json:"ssl"` +} + +// ServerHostSecretsSslEsKey0 defines model for . +type ServerHostSecretsSslEsKey0 struct { + Id string `json:"id"` +} + +// ServerHostSecretsSslEsKey1 defines model for . +type ServerHostSecretsSslEsKey1 = string + +// ServerHost_Secrets_Ssl_EsKey defines model for ServerHost.Secrets.Ssl.EsKey. +type ServerHost_Secrets_Ssl_EsKey struct { + union json.RawMessage } +// ServerHostSecretsSslKey0 defines model for . +type ServerHostSecretsSslKey0 struct { + Id string `json:"id"` +} + +// ServerHostSecretsSslKey1 defines model for . +type ServerHostSecretsSslKey1 = string + +// ServerHost_Secrets_Ssl_Key defines model for ServerHost.Secrets.Ssl.Key. +type ServerHost_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// ServerHostSslClientAuth defines model for ServerHost.Ssl.ClientAuth. +type ServerHostSslClientAuth string + // UpdateOutputElasticsearch defines model for update_output_elasticsearch. type UpdateOutputElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` @@ -2331,14 +2612,32 @@ type UpdateOutputElasticsearch struct { 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"` + Secrets *struct { + Ssl *struct { + Key *UpdateOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,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 +// UpdateOutputElasticsearchSecretsSslKey0 defines model for . +type UpdateOutputElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputElasticsearchSecretsSslKey1 defines model for . +type UpdateOutputElasticsearchSecretsSslKey1 = string + +// UpdateOutputElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputElasticsearch.Secrets.Ssl.Key. +type UpdateOutputElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. type UpdateOutputElasticsearchType string @@ -2491,21 +2790,41 @@ type UpdateOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + KibanaApiKey *string `json:"kibana_api_key"` + KibanaUrl *string `json:"kibana_url"` Name *string `json:"name,omitempty"` Preset *UpdateOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { + KibanaApiKey *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + Ssl *struct { + Key *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputRemoteElasticsearchType `json:"type,omitempty"` + ServiceToken *string `json:"service_token"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + SyncIntegrations *bool `json:"sync_integrations,omitempty"` + Type *UpdateOutputRemoteElasticsearchType `json:"type,omitempty"` } // UpdateOutputRemoteElasticsearchPreset defines model for UpdateOutputRemoteElasticsearch.Preset. type UpdateOutputRemoteElasticsearchPreset string +// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . +type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . +type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 = string + +// UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for UpdateOutputRemoteElasticsearch.Secrets.KibanaApiKey. +type UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { + union json.RawMessage +} + // UpdateOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type UpdateOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -2519,6 +2838,19 @@ type UpdateOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } +// UpdateOutputRemoteElasticsearchSecretsSslKey0 defines model for . +type UpdateOutputRemoteElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputRemoteElasticsearchSecretsSslKey1 defines model for . +type UpdateOutputRemoteElasticsearchSecretsSslKey1 = string + +// UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputRemoteElasticsearch.Secrets.Ssl.Key. +type UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // UpdateOutputRemoteElasticsearchType defines model for UpdateOutputRemoteElasticsearch.Type. type UpdateOutputRemoteElasticsearchType string @@ -2717,6 +3049,7 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { } `json:"requests,omitempty"` } `json:"resources,omitempty"` } `json:"agentless,omitempty"` + BumpRevision *bool `json:"bumpRevision,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2842,8 +3175,52 @@ type PostFleetFleetServerHostsJSONBody struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + Ssl *struct { + EsKey *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` + Key *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Ssl *struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + ClientAuth *PostFleetFleetServerHostsJSONBodySslClientAuth `json:"client_auth,omitempty"` + EsCertificate *string `json:"es_certificate,omitempty"` + EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` + EsKey *string `json:"es_key,omitempty"` + Key *string `json:"key,omitempty"` + } `json:"ssl"` +} + +// PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 struct { + Id string `json:"id"` +} + +// PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 = string + +// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey struct { + union json.RawMessage +} + +// PostFleetFleetServerHostsJSONBodySecretsSslKey0 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslKey0 struct { + Id string `json:"id"` +} + +// PostFleetFleetServerHostsJSONBodySecretsSslKey1 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslKey1 = string + +// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key struct { + union json.RawMessage } +// PostFleetFleetServerHostsJSONBodySslClientAuth defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySslClientAuth string + // PutFleetFleetServerHostsItemidJSONBody defines parameters for PutFleetFleetServerHostsItemid. type PutFleetFleetServerHostsItemidJSONBody struct { HostUrls *[]string `json:"host_urls,omitempty"` @@ -2851,8 +3228,52 @@ type PutFleetFleetServerHostsItemidJSONBody struct { IsInternal *bool `json:"is_internal,omitempty"` Name *string `json:"name,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + Ssl *struct { + EsKey *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` + Key *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Ssl *struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + ClientAuth *PutFleetFleetServerHostsItemidJSONBodySslClientAuth `json:"client_auth,omitempty"` + EsCertificate *string `json:"es_certificate,omitempty"` + EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` + EsKey *string `json:"es_key,omitempty"` + Key *string `json:"key,omitempty"` + } `json:"ssl"` +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 struct { + Id string `json:"id"` +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 = string + +// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey struct { + union json.RawMessage +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 struct { + Id string `json:"id"` +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 = string + +// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key struct { + union json.RawMessage } +// PutFleetFleetServerHostsItemidJSONBodySslClientAuth defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySslClientAuth string + // GetFleetPackagePoliciesParams defines parameters for GetFleetPackagePolicies. type GetFleetPackagePoliciesParams struct { Page *float32 `form:"page,omitempty" json:"page,omitempty"` @@ -3201,6 +3622,14 @@ func (a *OutputElasticsearch) UnmarshalJSON(b []byte) error { 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 { @@ -3331,6 +3760,13 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { } } + 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 { @@ -3359,54 +3795,256 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputKafka. Returns the specified +// Getter for additional properties for OutputElasticsearchSecretsSslKey0. Returns the specified // element and whether it was found -func (a OutputKafka) Get(fieldName string) (value interface{}, found bool) { +func (a OutputElasticsearchSecretsSslKey0) 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{}) { +// Setter for additional properties for OutputElasticsearchSecretsSslKey0 +func (a *OutputElasticsearchSecretsSslKey0) 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 { +// Override default JSON handling for OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a *OutputElasticsearchSecretsSslKey0) 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 raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) if err != nil { - return fmt.Errorf("error reading 'allow_edit': %w", err) + return fmt.Errorf("error reading 'id': %w", err) } - delete(object, "allow_edit") + delete(object, "id") } - 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) + 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 } - delete(object, "auth_type") } + return nil +} - 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") - } +// Override default JSON handling for OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a OutputElasticsearchSecretsSslKey0) 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 OutputElasticsearch_Secrets_Ssl. Returns the specified +// element and whether it was found +func (a OutputElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputElasticsearch_Secrets_Ssl +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a OutputElasticsearch_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 OutputElasticsearch_Secrets. Returns the specified +// element and whether it was found +func (a OutputElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputElasticsearch_Secrets +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties +func (a OutputElasticsearch_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 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) @@ -5162,6 +5800,22 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "is_preconfigured") } + if raw, found := object["kibana_api_key"]; found { + err = json.Unmarshal(raw, &a.KibanaApiKey) + if err != nil { + return fmt.Errorf("error reading 'kibana_api_key': %w", err) + } + delete(object, "kibana_api_key") + } + + if raw, found := object["kibana_url"]; found { + err = json.Unmarshal(raw, &a.KibanaUrl) + if err != nil { + return fmt.Errorf("error reading 'kibana_url': %w", err) + } + delete(object, "kibana_url") + } + if raw, found := object["name"]; found { err = json.Unmarshal(raw, &a.Name) if err != nil { @@ -5218,6 +5872,14 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "ssl") } + if raw, found := object["sync_integrations"]; found { + err = json.Unmarshal(raw, &a.SyncIntegrations) + if err != nil { + return fmt.Errorf("error reading 'sync_integrations': %w", err) + } + delete(object, "sync_integrations") + } + if raw, found := object["type"]; found { err = json.Unmarshal(raw, &a.Type) if err != nil { @@ -5313,6 +5975,20 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } + if a.KibanaApiKey != nil { + object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_api_key': %w", err) + } + } + + if a.KibanaUrl != nil { + object["kibana_url"], err = json.Marshal(a.KibanaUrl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_url': %w", err) + } + } + object["name"], err = json.Marshal(a.Name) if err != nil { return nil, fmt.Errorf("error marshaling 'name': %w", err) @@ -5360,6 +6036,13 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } + if a.SyncIntegrations != nil { + object["sync_integrations"], err = json.Marshal(a.SyncIntegrations) + if err != nil { + return nil, fmt.Errorf("error marshaling 'sync_integrations': %w", err) + } + } + object["type"], err = json.Marshal(a.Type) if err != nil { return nil, fmt.Errorf("error marshaling 'type': %w", err) @@ -5374,25 +6057,25 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearchSecretsServiceToken0) Get(fieldName string) (value interface{}, found bool) { +func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) 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{}) { +// Setter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) 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 { +// Override default JSON handling for OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties +func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) UnmarshalJSON(b []byte) error { object := make(map[string]json.RawMessage) err := json.Unmarshal(b, &object) if err != nil { @@ -5421,8 +6104,8 @@ func (a *OutputRemoteElasticsearchSecretsServiceToken0) UnmarshalJSON(b []byte) return nil } -// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties -func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, error) { +// Override default JSON handling for OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties +func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) @@ -5440,37 +6123,37 @@ func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, er return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearch_Secrets. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { +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 OutputRemoteElasticsearch_Secrets -func (a *OutputRemoteElasticsearch_Secrets) Set(fieldName string, value interface{}) { +// 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 OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { +// 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["service_token"]; found { - err = json.Unmarshal(raw, &a.ServiceToken) + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) if err != nil { - return fmt.Errorf("error reading 'service_token': %w", err) + return fmt.Errorf("error reading 'id': %w", err) } - delete(object, "service_token") + delete(object, "id") } if len(object) != 0 { @@ -5487,16 +6170,14 @@ func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { return nil } -// Override default JSON handling for OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { +// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties +func (a OutputRemoteElasticsearchSecretsServiceToken0) 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) - } + 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 { @@ -5508,34 +6189,266 @@ func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputShipper. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearchSecretsSslKey0. Returns the specified // element and whether it was found -func (a OutputShipper) Get(fieldName string) (value interface{}, found bool) { +func (a OutputRemoteElasticsearchSecretsSslKey0) 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{}) { +// Setter for additional properties for OutputRemoteElasticsearchSecretsSslKey0 +func (a *OutputRemoteElasticsearchSecretsSslKey0) 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 { +// Override default JSON handling for OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a *OutputRemoteElasticsearchSecretsSslKey0) 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 { + 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 OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a OutputRemoteElasticsearchSecretsSslKey0) 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_Ssl. Returns the specified +// element and whether it was found +func (a OutputRemoteElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputRemoteElasticsearch_Secrets_Ssl +func (a *OutputRemoteElasticsearch_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 OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a *OutputRemoteElasticsearch_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 OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a OutputRemoteElasticsearch_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 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["kibana_api_key"]; found { + err = json.Unmarshal(raw, &a.KibanaApiKey) + if err != nil { + return fmt.Errorf("error reading 'kibana_api_key': %w", err) + } + delete(object, "kibana_api_key") + } + + 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["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 OutputRemoteElasticsearch_Secrets to handle AdditionalProperties +func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.KibanaApiKey != nil { + object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_api_key': %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.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 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") @@ -7419,14 +8332,18 @@ func (a PackageInfo_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, } } - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) + if a.Name != nil { + 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) + if a.StartedAt != nil { + 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 { @@ -9588,14 +10505,18 @@ func (a PackageListItem_InstallationInfo_LatestExecutedState) MarshalJSON() ([]b } } - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) + if a.Name != nil { + 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) + if a.StartedAt != nil { + 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 { @@ -10385,22 +11306,22 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 +// AsFleetAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue0 +func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue0() (FleetAgentPolicyGlobalDataTagsItemValue0, error) { + var body FleetAgentPolicyGlobalDataTagsItemValue0 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// FromFleetAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue0 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// MergeFleetAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue0 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) if err != nil { return err @@ -10411,22 +11332,22 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 +// AsFleetAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue1 +func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue1() (FleetAgentPolicyGlobalDataTagsItemValue1, error) { + var body FleetAgentPolicyGlobalDataTagsItemValue1 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// FromFleetAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue1 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// MergeFleetAgentPolicyGlobalDataTagsItemValue1 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue1 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) error { b, err := json.Marshal(v) if err != nil { return err @@ -10437,14 +11358,76 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 - err := json.Unmarshal(t.union, &body) - return body, err +func (t FleetAgentPolicyGlobalDataTagsItem_Value) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { b, err := json.Marshal(v) t.union = b @@ -11131,6 +12114,68 @@ func (t *AgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { return err } +// AsNewOutputElasticsearchSecretsSslKey0 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey0 +func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey0() (NewOutputElasticsearchSecretsSslKey0, error) { + var body NewOutputElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey0 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey0 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputElasticsearchSecretsSslKey1 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey1 +func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey1() (NewOutputElasticsearchSecretsSslKey1, error) { + var body NewOutputElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey1 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey1 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) 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 NewOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) 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 @@ -11317,6 +12362,68 @@ func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } +// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0() (NewOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body NewOutputRemoteElasticsearchSecretsKibanaApiKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1() (NewOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body NewOutputRemoteElasticsearchSecretsKibanaApiKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -11379,6 +12486,68 @@ func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []by return err } +// AsNewOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey0 +func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey0() (NewOutputRemoteElasticsearchSecretsSslKey0, error) { + var body NewOutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey1 +func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey1() (NewOutputRemoteElasticsearchSecretsSslKey1, error) { + var body NewOutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 @@ -11438,15 +12607,898 @@ func (t NewOutputUnion) AsNewOutputLogstash() (NewOutputLogstash, error) { return body, err } -// FromNewOutputLogstash overwrites any union data inside the NewOutputUnion as the provided NewOutputLogstash -func (t *NewOutputUnion) FromNewOutputLogstash(v NewOutputLogstash) error { +// 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 +} + +// AsOutputElasticsearchSecretsSslKey0 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey0 +func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey0() (OutputElasticsearchSecretsSslKey0, error) { + var body OutputElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearchSecretsSslKey0 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey0 +func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey0 +func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputElasticsearchSecretsSslKey1 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey1 +func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey1() (OutputElasticsearchSecretsSslKey1, error) { + var body OutputElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearchSecretsSslKey1 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey1 +func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey1 +func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) 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 OutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputElasticsearch_Secrets_Ssl_Key) 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 +} + +// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 +} + +// AsOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey0 +func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey0() (OutputRemoteElasticsearchSecretsSslKey0, error) { + var body OutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey0 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey0 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey1 +func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey1() (OutputRemoteElasticsearchSecretsSslKey1, error) { + var body OutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey1 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey1 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) 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 +} + +// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { + var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { + var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) 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 PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageInfoInstallationInfoInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType0 +func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType0() (PackageInfoInstallationInfoInstalledKibanaType0, error) { + var body PackageInfoInstallationInfoInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoInstallationInfoInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType1 +func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType1() (PackageInfoInstallationInfoInstalledKibanaType1, error) { + var body PackageInfoInstallationInfoInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) 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 PackageInfo_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageInfoType0 returns the union data inside the PackageInfo_Type as a PackageInfoType0 +func (t PackageInfo_Type) AsPackageInfoType0() (PackageInfoType0, error) { + var body PackageInfoType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType0 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType0 +func (t *PackageInfo_Type) FromPackageInfoType0(v PackageInfoType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType0 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType0 +func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType1 returns the union data inside the PackageInfo_Type as a PackageInfoType1 +func (t PackageInfo_Type) AsPackageInfoType1() (PackageInfoType1, error) { + var body PackageInfoType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType1 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType1 +func (t *PackageInfo_Type) FromPackageInfoType1(v PackageInfoType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType1 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType1 +func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType2 returns the union data inside the PackageInfo_Type as a PackageInfoType2 +func (t PackageInfo_Type) AsPackageInfoType2() (PackageInfoType2, error) { + var body PackageInfoType2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType2 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType2 +func (t *PackageInfo_Type) FromPackageInfoType2(v PackageInfoType2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType2 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType2 +func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType3 returns the union data inside the PackageInfo_Type as a PackageInfoType3 +func (t PackageInfo_Type) AsPackageInfoType3() (PackageInfoType3, error) { + var body PackageInfoType3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType3 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType3 +func (t *PackageInfo_Type) FromPackageInfoType3(v PackageInfoType3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType3 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType3 +func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) 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 PackageInfo_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { + var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) 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 { +// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11457,22 +13509,22 @@ func (t *NewOutputUnion) MergeNewOutputLogstash(v NewOutputLogstash) error { return err } -// AsNewOutputKafka returns the union data inside the NewOutputUnion as a NewOutputKafka -func (t NewOutputUnion) AsNewOutputKafka() (NewOutputKafka, error) { - var body NewOutputKafka +// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { + var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 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 { +// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) 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 { +// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11483,32 +13535,32 @@ func (t *NewOutputUnion) MergeNewOutputKafka(v NewOutputKafka) error { return err } -func (t NewOutputUnion) MarshalJSON() ([]byte, error) { +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) 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 +// AsPackageListItemInstallationInfoInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType0 +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType0() (PackageListItemInstallationInfoInstalledKibanaType0, error) { + var body PackageListItemInstallationInfoInstalledKibanaType0 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 { +// FromPackageListItemInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) 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 { +// MergePackageListItemInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11519,22 +13571,22 @@ func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword0(v Output 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 +// AsPackageListItemInstallationInfoInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType1 +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType1() (PackageListItemInstallationInfoInstalledKibanaType1, error) { + var body PackageListItemInstallationInfoInstalledKibanaType1 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 { +// FromPackageListItemInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) 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 { +// MergePackageListItemInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11545,32 +13597,32 @@ func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword1(v Output return err } -func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) 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 +// AsPackageListItemType0 returns the union data inside the PackageListItem_Type as a PackageListItemType0 +func (t PackageListItem_Type) AsPackageListItemType0() (PackageListItemType0, error) { + var body PackageListItemType0 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 { +// FromPackageListItemType0 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType0 +func (t *PackageListItem_Type) FromPackageListItemType0(v PackageListItemType0) 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 { +// MergePackageListItemType0 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType0 +func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11581,22 +13633,22 @@ func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey0(v OutputKaf 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 +// AsPackageListItemType1 returns the union data inside the PackageListItem_Type as a PackageListItemType1 +func (t PackageListItem_Type) AsPackageListItemType1() (PackageListItemType1, error) { + var body PackageListItemType1 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 { +// FromPackageListItemType1 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType1 +func (t *PackageListItem_Type) FromPackageListItemType1(v PackageListItemType1) 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 { +// MergePackageListItemType1 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType1 +func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11607,32 +13659,22 @@ func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey1(v OutputKaf 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 +// AsPackageListItemType2 returns the union data inside the PackageListItem_Type as a PackageListItemType2 +func (t PackageListItem_Type) AsPackageListItemType2() (PackageListItemType2, error) { + var body PackageListItemType2 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 { +// FromPackageListItemType2 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType2 +func (t *PackageListItem_Type) FromPackageListItemType2(v PackageListItemType2) 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 { +// MergePackageListItemType2 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType2 +func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) error { b, err := json.Marshal(v) if err != nil { return err @@ -11643,22 +13685,22 @@ func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey0(v Out 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 +// AsPackageListItemType3 returns the union data inside the PackageListItem_Type as a PackageListItemType3 +func (t PackageListItem_Type) AsPackageListItemType3() (PackageListItemType3, error) { + var body PackageListItemType3 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 { +// FromPackageListItemType3 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType3 +func (t *PackageListItem_Type) FromPackageListItemType3(v PackageListItemType3) 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 { +// MergePackageListItemType3 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType3 +func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) error { b, err := json.Marshal(v) if err != nil { return err @@ -11669,32 +13711,32 @@ func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey1(v Out return err } -func (t OutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { +func (t PackageListItem_Type) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { +func (t *PackageListItem_Type) 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 +// AsServerHostSecretsSslEsKey0 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey0 +func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey0() (ServerHostSecretsSslEsKey0, error) { + var body ServerHostSecretsSslEsKey0 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 { +// FromServerHostSecretsSslEsKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey0 +func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) 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 { +// MergeServerHostSecretsSslEsKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey0 +func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11705,22 +13747,22 @@ func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasti 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 +// AsServerHostSecretsSslEsKey1 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey1 +func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey1() (ServerHostSecretsSslEsKey1, error) { + var body ServerHostSecretsSslEsKey1 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 { +// FromServerHostSecretsSslEsKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey1 +func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) 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 { +// MergeServerHostSecretsSslEsKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey1 +func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11731,34 +13773,32 @@ func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasti return err } -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { +func (t ServerHost_Secrets_Ssl_EsKey) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { +func (t *ServerHost_Secrets_Ssl_EsKey) 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 +// AsServerHostSecretsSslKey0 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey0 +func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey0() (ServerHostSecretsSslKey0, error) { + var body ServerHostSecretsSslKey0 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" +// FromServerHostSecretsSslKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey0 +func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { 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" +// MergeServerHostSecretsSslKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey0 +func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11769,24 +13809,22 @@ func (t *OutputUnion) MergeOutputElasticsearch(v OutputElasticsearch) error { return err } -// AsOutputRemoteElasticsearch returns the union data inside the OutputUnion as a OutputRemoteElasticsearch -func (t OutputUnion) AsOutputRemoteElasticsearch() (OutputRemoteElasticsearch, error) { - var body OutputRemoteElasticsearch +// AsServerHostSecretsSslKey1 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey1 +func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey1() (ServerHostSecretsSslKey1, error) { + var body ServerHostSecretsSslKey1 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" +// FromServerHostSecretsSslKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey1 +func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { 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" +// MergeServerHostSecretsSslKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey1 +func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11797,24 +13835,32 @@ func (t *OutputUnion) MergeOutputRemoteElasticsearch(v OutputRemoteElasticsearch return err } -// AsOutputLogstash returns the union data inside the OutputUnion as a OutputLogstash -func (t OutputUnion) AsOutputLogstash() (OutputLogstash, error) { - var body OutputLogstash +func (t ServerHost_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ServerHost_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUpdateOutputElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey0 +func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey0() (UpdateOutputElasticsearchSecretsSslKey0, error) { + var body UpdateOutputElasticsearchSecretsSslKey0 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" +// FromUpdateOutputElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey0 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { 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" +// MergeUpdateOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey0 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11825,24 +13871,22 @@ func (t *OutputUnion) MergeOutputLogstash(v OutputLogstash) error { return err } -// AsOutputKafka returns the union data inside the OutputUnion as a OutputKafka -func (t OutputUnion) AsOutputKafka() (OutputKafka, error) { - var body OutputKafka +// AsUpdateOutputElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey1 +func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey1() (UpdateOutputElasticsearchSecretsSslKey1, error) { + var body UpdateOutputElasticsearchSecretsSslKey1 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" +// FromUpdateOutputElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey1 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { 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" +// MergeUpdateOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey1 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11853,39 +13897,12 @@ func (t *OutputUnion) MergeOutputKafka(v OutputKafka) error { 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) { +func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputUnion) UnmarshalJSON(b []byte) error { +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } @@ -12076,6 +14093,68 @@ func (t *UpdateOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } +// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -12138,6 +14217,68 @@ func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b [ return err } +// AsUpdateOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey0 +func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey0() (UpdateOutputRemoteElasticsearchSecretsSslKey0, error) { + var body UpdateOutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey1 +func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey1() (UpdateOutputRemoteElasticsearchSecretsSslKey1, error) { + var body UpdateOutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 @@ -15046,9 +17187,10 @@ type GetFleetAgentPoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15075,9 +17217,10 @@ type PostFleetAgentPoliciesResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15105,9 +17248,10 @@ type PostFleetAgentPoliciesDeleteResponse struct { Name string `json:"name"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15134,9 +17278,10 @@ type GetFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15163,9 +17308,10 @@ type PutFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15214,9 +17360,10 @@ type GetFleetEnrollmentApiKeysResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15243,9 +17390,10 @@ type GetFleetEpmPackagesResponse struct { Items []PackageListItem `json:"items"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15293,17 +17441,22 @@ type DeleteFleetEpmPackagesPkgnamePkgversionResponse struct { Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type DeleteFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` +} +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type0 string +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string +type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { + union json.RawMessage } -type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type string type DeleteFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -15341,9 +17494,10 @@ type GetFleetEpmPackagesPkgnamePkgversionResponse struct { } `json:"metadata,omitempty"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15373,17 +17527,22 @@ type PostFleetEpmPackagesPkgnamePkgversionResponse struct { Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type PostFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PostFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` +} +type PostFleetEpmPackagesPkgnamePkgversion200Items0Type0 string +type PostFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string +type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { + union json.RawMessage } -type PostFleetEpmPackagesPkgnamePkgversion200Items0Type string type PostFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -15421,9 +17580,10 @@ type GetFleetFleetServerHostsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15450,9 +17610,10 @@ type PostFleetFleetServerHostsResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15479,9 +17640,10 @@ type DeleteFleetFleetServerHostsItemidResponse struct { Id string `json:"id"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15508,9 +17670,10 @@ type GetFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15537,9 +17700,10 @@ type PutFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15569,9 +17733,10 @@ type GetFleetOutputsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15598,9 +17763,10 @@ type PostFleetOutputsResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15627,14 +17793,16 @@ type DeleteFleetOutputsOutputidResponse struct { Id string `json:"id"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + 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"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15661,9 +17829,10 @@ type GetFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15690,9 +17859,10 @@ type PutFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15722,9 +17892,10 @@ type GetFleetPackagePoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15751,14 +17922,16 @@ type PostFleetPackagePoliciesResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + 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"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15785,9 +17958,10 @@ type DeleteFleetPackagePoliciesPackagepolicyidResponse struct { Id string `json:"id"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15814,9 +17988,10 @@ type GetFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON404 *struct { Message string `json:"message"` @@ -15846,14 +18021,16 @@ type PutFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + 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"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -16392,9 +18569,10 @@ func ParseGetFleetAgentPoliciesResponse(rsp *http.Response) (*GetFleetAgentPolic 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16431,9 +18609,10 @@ func ParsePostFleetAgentPoliciesResponse(rsp *http.Response) (*PostFleetAgentPol 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16471,9 +18650,10 @@ func ParsePostFleetAgentPoliciesDeleteResponse(rsp *http.Response) (*PostFleetAg 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16510,9 +18690,10 @@ func ParseGetFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*GetFl 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16549,9 +18730,10 @@ func ParsePutFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*PutFl 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16610,9 +18792,10 @@ func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnroll 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16649,9 +18832,10 @@ func ParseGetFleetEpmPackagesResponse(rsp *http.Response) (*GetFleetEpmPackagesR 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16704,9 +18888,10 @@ func ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (* 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16746,9 +18931,10 @@ func ParseGetFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Get 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16788,9 +18974,10 @@ func ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Po 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16830,9 +19017,10 @@ func ParseGetFleetFleetServerHostsResponse(rsp *http.Response) (*GetFleetFleetSe 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16869,9 +19057,10 @@ func ParsePostFleetFleetServerHostsResponse(rsp *http.Response) (*PostFleetFleet 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16908,9 +19097,10 @@ func ParseDeleteFleetFleetServerHostsItemidResponse(rsp *http.Response) (*Delete 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16947,9 +19137,10 @@ func ParseGetFleetFleetServerHostsItemidResponse(rsp *http.Response) (*GetFleetF 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16986,9 +19177,10 @@ func ParsePutFleetFleetServerHostsItemidResponse(rsp *http.Response) (*PutFleetF 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17028,9 +19220,10 @@ func ParseGetFleetOutputsResponse(rsp *http.Response) (*GetFleetOutputsResponse, 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17067,9 +19260,10 @@ func ParsePostFleetOutputsResponse(rsp *http.Response) (*PostFleetOutputsRespons 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17106,9 +19300,10 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17117,9 +19312,10 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17156,9 +19352,10 @@ func ParseGetFleetOutputsOutputidResponse(rsp *http.Response) (*GetFleetOutputsO 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17195,9 +19392,10 @@ func ParsePutFleetOutputsOutputidResponse(rsp *http.Response) (*PutFleetOutputsO 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17237,9 +19435,10 @@ func ParseGetFleetPackagePoliciesResponse(rsp *http.Response) (*GetFleetPackageP 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17276,9 +19475,10 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17287,9 +19487,10 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17326,9 +19527,10 @@ func ParseDeleteFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17365,9 +19567,10 @@ func ParseGetFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*G 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17413,9 +19616,10 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17424,9 +19628,10 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P 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"` + Attributes interface{} `json:"attributes"` + 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 diff --git a/generated/kbapi/transform_schema.go b/generated/kbapi/transform_schema.go index 240f99a06..54b5cc395 100644 --- a/generated/kbapi/transform_schema.go +++ b/generated/kbapi/transform_schema.go @@ -837,10 +837,8 @@ func transformFleetPaths(schema *Schema) { 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) } - - // do global_data_tags refs schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") - // Define the value types for the GlobalDataTags + schema.Components.Set("schemas.agent_policy_global_data_tags_item", Map{ "type": "object", "properties": Map{ @@ -855,6 +853,7 @@ func transformFleetPaths(schema *Schema) { "required": []string{"name", "value"}, }) + // Define the value types for the GlobalDataTags agentPoliciesPath.Post.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") agentPolicyPath.Put.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") From b2c7842e4662940a311b1b5be7f97aadc3e06de8 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 23:19:27 -0500 Subject: [PATCH 26/89] using elastic/kibana 4f38cf96d24a66c98ac6dbaede2a9b92fa460b75 to generate kibana.gen.go --- generated/kbapi/kibana.gen.go | 3039 ++++++--------------------- generated/kbapi/transform_schema.go | 15 +- 2 files changed, 600 insertions(+), 2454 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index c212b610d..b8608bc75 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -218,20 +218,20 @@ const ( OutputSslVerificationModeStrict OutputSslVerificationMode = "strict" ) -// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0. +// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType. const ( - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" + 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. @@ -261,20 +261,20 @@ const ( PackageInfoInstallationInfoInstalledEsTypeTransform PackageInfoInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageInfoInstallationInfoInstalledKibanaType0. +// Defines values for PackageInfoInstallationInfoInstalledKibanaType. const ( - PackageInfoInstallationInfoInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoInstalledKibanaType0 = "csp-rule-template" - PackageInfoInstallationInfoInstalledKibanaType0Dashboard PackageInfoInstallationInfoInstalledKibanaType0 = "dashboard" - PackageInfoInstallationInfoInstalledKibanaType0IndexPattern PackageInfoInstallationInfoInstalledKibanaType0 = "index-pattern" - PackageInfoInstallationInfoInstalledKibanaType0Lens PackageInfoInstallationInfoInstalledKibanaType0 = "lens" - PackageInfoInstallationInfoInstalledKibanaType0Map PackageInfoInstallationInfoInstalledKibanaType0 = "map" - PackageInfoInstallationInfoInstalledKibanaType0MlModule PackageInfoInstallationInfoInstalledKibanaType0 = "ml-module" - PackageInfoInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" - PackageInfoInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-saved-query" - PackageInfoInstallationInfoInstalledKibanaType0Search PackageInfoInstallationInfoInstalledKibanaType0 = "search" - PackageInfoInstallationInfoInstalledKibanaType0SecurityRule PackageInfoInstallationInfoInstalledKibanaType0 = "security-rule" - PackageInfoInstallationInfoInstalledKibanaType0Tag PackageInfoInstallationInfoInstalledKibanaType0 = "tag" - PackageInfoInstallationInfoInstalledKibanaType0Visualization PackageInfoInstallationInfoInstalledKibanaType0 = "visualization" + 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. @@ -298,35 +298,27 @@ const ( PackageInfoReleaseGa PackageInfoRelease = "ga" ) -// Defines values for PackageInfoType0. +// Defines values for PackageInfoType. const ( - PackageInfoType0Integration PackageInfoType0 = "integration" + PackageInfoTypeContent PackageInfoType = "content" + PackageInfoTypeInput PackageInfoType = "input" + PackageInfoTypeIntegration PackageInfoType = "integration" ) -// Defines values for PackageInfoType1. +// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType. const ( - PackageInfoType1Input PackageInfoType1 = "input" -) - -// Defines values for PackageInfoType2. -const ( - PackageInfoType2Content PackageInfoType2 = "content" -) - -// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0. -const ( - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" + 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. @@ -356,20 +348,20 @@ const ( PackageListItemInstallationInfoInstalledEsTypeTransform PackageListItemInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageListItemInstallationInfoInstalledKibanaType0. +// Defines values for PackageListItemInstallationInfoInstalledKibanaType. const ( - PackageListItemInstallationInfoInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoInstalledKibanaType0 = "csp-rule-template" - PackageListItemInstallationInfoInstalledKibanaType0Dashboard PackageListItemInstallationInfoInstalledKibanaType0 = "dashboard" - PackageListItemInstallationInfoInstalledKibanaType0IndexPattern PackageListItemInstallationInfoInstalledKibanaType0 = "index-pattern" - PackageListItemInstallationInfoInstalledKibanaType0Lens PackageListItemInstallationInfoInstalledKibanaType0 = "lens" - PackageListItemInstallationInfoInstalledKibanaType0Map PackageListItemInstallationInfoInstalledKibanaType0 = "map" - PackageListItemInstallationInfoInstalledKibanaType0MlModule PackageListItemInstallationInfoInstalledKibanaType0 = "ml-module" - PackageListItemInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" - PackageListItemInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-saved-query" - PackageListItemInstallationInfoInstalledKibanaType0Search PackageListItemInstallationInfoInstalledKibanaType0 = "search" - PackageListItemInstallationInfoInstalledKibanaType0SecurityRule PackageListItemInstallationInfoInstalledKibanaType0 = "security-rule" - PackageListItemInstallationInfoInstalledKibanaType0Tag PackageListItemInstallationInfoInstalledKibanaType0 = "tag" - PackageListItemInstallationInfoInstalledKibanaType0Visualization PackageListItemInstallationInfoInstalledKibanaType0 = "visualization" + 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. @@ -393,26 +385,11 @@ const ( Ga PackageListItemRelease = "ga" ) -// Defines values for PackageListItemType0. -const ( - PackageListItemType0Integration PackageListItemType0 = "integration" -) - -// Defines values for PackageListItemType1. -const ( - PackageListItemType1Input PackageListItemType1 = "input" -) - -// Defines values for PackageListItemType2. +// Defines values for PackageListItemType. const ( - PackageListItemType2Content PackageListItemType2 = "content" -) - -// Defines values for ServerHostSslClientAuth. -const ( - ServerHostSslClientAuthNone ServerHostSslClientAuth = "none" - ServerHostSslClientAuthOptional ServerHostSslClientAuth = "optional" - ServerHostSslClientAuthRequired ServerHostSslClientAuth = "required" + PackageListItemTypeContent PackageListItemType = "content" + PackageListItemTypeInput PackageListItemType = "input" + PackageListItemTypeIntegration PackageListItemType = "integration" ) // Defines values for UpdateOutputElasticsearchPreset. @@ -492,10 +469,10 @@ const ( // Defines values for UpdateOutputSslVerificationMode. const ( - UpdateOutputSslVerificationModeCertificate UpdateOutputSslVerificationMode = "certificate" - UpdateOutputSslVerificationModeFull UpdateOutputSslVerificationMode = "full" - UpdateOutputSslVerificationModeNone UpdateOutputSslVerificationMode = "none" - UpdateOutputSslVerificationModeStrict UpdateOutputSslVerificationMode = "strict" + Certificate UpdateOutputSslVerificationMode = "certificate" + Full UpdateOutputSslVerificationMode = "full" + None UpdateOutputSslVerificationMode = "none" + Strict UpdateOutputSslVerificationMode = "strict" ) // Defines values for GetFleetAgentPoliciesParamsSortOrder. @@ -536,20 +513,6 @@ const ( Traces PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled = "traces" ) -// Defines values for PostFleetFleetServerHostsJSONBodySslClientAuth. -const ( - PostFleetFleetServerHostsJSONBodySslClientAuthNone PostFleetFleetServerHostsJSONBodySslClientAuth = "none" - PostFleetFleetServerHostsJSONBodySslClientAuthOptional PostFleetFleetServerHostsJSONBodySslClientAuth = "optional" - PostFleetFleetServerHostsJSONBodySslClientAuthRequired PostFleetFleetServerHostsJSONBodySslClientAuth = "required" -) - -// Defines values for PutFleetFleetServerHostsItemidJSONBodySslClientAuth. -const ( - PutFleetFleetServerHostsItemidJSONBodySslClientAuthNone PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "none" - PutFleetFleetServerHostsItemidJSONBodySslClientAuthOptional PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "optional" - PutFleetFleetServerHostsItemidJSONBodySslClientAuthRequired PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "required" -) - // Defines values for GetFleetPackagePoliciesParamsSortOrder. const ( GetFleetPackagePoliciesParamsSortOrderAsc GetFleetPackagePoliciesParamsSortOrder = "asc" @@ -829,23 +792,6 @@ type DataViewsUpdateDataViewRequestObjectInner struct { TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` } -// FleetAgentPolicyGlobalDataTagsItem defines model for Fleet_agent_policy_global_data_tags_item. -type FleetAgentPolicyGlobalDataTagsItem struct { - Name string `json:"name"` - Value FleetAgentPolicyGlobalDataTagsItem_Value `json:"value"` -} - -// FleetAgentPolicyGlobalDataTagsItemValue0 defines model for . -type FleetAgentPolicyGlobalDataTagsItemValue0 = string - -// FleetAgentPolicyGlobalDataTagsItemValue1 defines model for . -type FleetAgentPolicyGlobalDataTagsItemValue1 = float32 - -// FleetAgentPolicyGlobalDataTagsItem_Value defines model for FleetAgentPolicyGlobalDataTagsItem.Value. -type FleetAgentPolicyGlobalDataTagsItem_Value struct { - union json.RawMessage -} - // AgentPolicy defines model for agent_policy. type AgentPolicy struct { AdvancedSettings *struct { @@ -878,14 +824,14 @@ type AgentPolicy struct { 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 *[]FleetAgentPolicyGlobalDataTagsItem `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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -949,11 +895,9 @@ 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 { - // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -1268,32 +1212,14 @@ type NewOutputElasticsearch struct { Name string `json:"name"` Preset *NewOutputElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - Key *NewOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Type NewOutputElasticsearchType `json:"type"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Type NewOutputElasticsearchType `json:"type"` } // NewOutputElasticsearchPreset defines model for NewOutputElasticsearch.Preset. type NewOutputElasticsearchPreset string -// NewOutputElasticsearchSecretsSslKey0 defines model for . -type NewOutputElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// NewOutputElasticsearchSecretsSslKey1 defines model for . -type NewOutputElasticsearchSecretsSslKey1 = string - -// NewOutputElasticsearch_Secrets_Ssl_Key defines model for NewOutputElasticsearch.Secrets.Ssl.Key. -type NewOutputElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // NewOutputElasticsearchType defines model for NewOutputElasticsearch.Type. type NewOutputElasticsearchType string @@ -1457,9 +1383,6 @@ type NewOutputRemoteElasticsearch struct { Secrets *struct { KibanaApiKey *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *NewOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - Ssl *struct { - Key *NewOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` ServiceToken *string `json:"service_token"` Shipper *NewOutputShipper `json:"shipper,omitempty"` @@ -1497,19 +1420,6 @@ type NewOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } -// NewOutputRemoteElasticsearchSecretsSslKey0 defines model for . -type NewOutputRemoteElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// NewOutputRemoteElasticsearchSecretsSslKey1 defines model for . -type NewOutputRemoteElasticsearchSecretsSslKey1 = string - -// NewOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for NewOutputRemoteElasticsearch.Secrets.Ssl.Key. -type NewOutputRemoteElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // NewOutputRemoteElasticsearchType defines model for NewOutputRemoteElasticsearch.Type. type NewOutputRemoteElasticsearchType string @@ -1545,55 +1455,28 @@ type NewOutputUnion struct { // 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"` - Secrets *OutputElasticsearch_Secrets `json:"secrets,omitempty"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` - Type OutputElasticsearchType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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 -// OutputElasticsearchSecretsSslKey0 defines model for . -type OutputElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputElasticsearchSecretsSslKey1 defines model for . -type OutputElasticsearchSecretsSslKey1 = string - -// OutputElasticsearch_Secrets_Ssl_Key defines model for OutputElasticsearch.Secrets.Ssl.Key. -type OutputElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// OutputElasticsearch_Secrets_Ssl defines model for OutputElasticsearch.Secrets.Ssl. -type OutputElasticsearch_Secrets_Ssl struct { - Key *OutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputElasticsearch_Secrets defines model for OutputElasticsearch.Secrets. -type OutputElasticsearch_Secrets struct { - Ssl *OutputElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - // OutputElasticsearchType defines model for OutputElasticsearch.Type. type OutputElasticsearchType string @@ -1835,31 +1718,10 @@ type OutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } -// OutputRemoteElasticsearchSecretsSslKey0 defines model for . -type OutputRemoteElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputRemoteElasticsearchSecretsSslKey1 defines model for . -type OutputRemoteElasticsearchSecretsSslKey1 = string - -// OutputRemoteElasticsearch_Secrets_Ssl_Key defines model for OutputRemoteElasticsearch.Secrets.Ssl.Key. -type OutputRemoteElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// OutputRemoteElasticsearch_Secrets_Ssl defines model for OutputRemoteElasticsearch.Secrets.Ssl. -type OutputRemoteElasticsearch_Secrets_Ssl struct { - Key *OutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - // OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. type OutputRemoteElasticsearch_Secrets struct { KibanaApiKey *OutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - Ssl *OutputRemoteElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1945,7 +1807,7 @@ type PackageInfo struct { Source *PackageInfo_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageInfo_Type `json:"type,omitempty"` + Type *PackageInfoType `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -1994,23 +1856,15 @@ type PackageInfo_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. -type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 string - -// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . -type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 = string - -// PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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. @@ -2047,30 +1901,22 @@ type PackageInfo_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.InstalledKibana.Type.0. -type PackageInfoInstallationInfoInstalledKibanaType0 string - -// PackageInfoInstallationInfoInstalledKibanaType1 defines model for . -type PackageInfoInstallationInfoInstalledKibanaType1 = string - -// PackageInfo_InstallationInfo_InstalledKibana_Type defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. -type PackageInfo_InstallationInfo_InstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageInfo_InstallationInfo_InstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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,omitempty"` - StartedAt *string `json:"started_at,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2135,22 +1981,8 @@ type PackageInfo_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoType0 defines model for PackageInfo.Type.0. -type PackageInfoType0 string - -// PackageInfoType1 defines model for PackageInfo.Type.1. -type PackageInfoType1 string - -// PackageInfoType2 defines model for PackageInfo.Type.2. -type PackageInfoType2 string - -// PackageInfoType3 defines model for . -type PackageInfoType3 = string - -// PackageInfo_Type defines model for PackageInfo.Type. -type PackageInfo_Type struct { - union json.RawMessage -} +// PackageInfoType defines model for PackageInfo.Type. +type PackageInfoType string // PackageListItem defines model for package_list_item. type PackageListItem struct { @@ -2177,7 +2009,7 @@ type PackageListItem struct { Source *PackageListItem_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageListItem_Type `json:"type,omitempty"` + Type *PackageListItemType `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -2226,23 +2058,15 @@ type PackageListItem_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. -type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 string - -// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . -type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 = string - -// PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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. @@ -2279,30 +2103,22 @@ type PackageListItem_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.InstalledKibana.Type.0. -type PackageListItemInstallationInfoInstalledKibanaType0 string - -// PackageListItemInstallationInfoInstalledKibanaType1 defines model for . -type PackageListItemInstallationInfoInstalledKibanaType1 = string - -// PackageListItem_InstallationInfo_InstalledKibana_Type defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. -type PackageListItem_InstallationInfo_InstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageListItem_InstallationInfo_InstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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,omitempty"` - StartedAt *string `json:"started_at,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2367,30 +2183,14 @@ type PackageListItem_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemType0 defines model for PackageListItem.Type.0. -type PackageListItemType0 string - -// PackageListItemType1 defines model for PackageListItem.Type.1. -type PackageListItemType1 string - -// PackageListItemType2 defines model for PackageListItem.Type.2. -type PackageListItemType2 string - -// PackageListItemType3 defines model for . -type PackageListItemType3 = string - -// PackageListItem_Type defines model for PackageListItem.Type. -type PackageListItem_Type struct { - union json.RawMessage -} +// PackageListItemType defines model for PackageListItem.Type. +type PackageListItemType string // PackagePolicy defines model for package_policy. type PackagePolicy struct { - // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -2480,11 +2280,9 @@ type PackagePolicyInputStream struct { // PackagePolicyRequest defines model for package_policy_request. type PackagePolicyRequest struct { - // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` - Description *string `json:"description,omitempty"` - Force *bool `json:"force,omitempty"` - Id *string `json:"id,omitempty"` + 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"` @@ -2552,52 +2350,8 @@ type ServerHost struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id"` - Secrets *struct { - Ssl *struct { - EsKey *ServerHost_Secrets_Ssl_EsKey `json:"es_key,omitempty"` - Key *ServerHost_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Ssl *struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - ClientAuth *ServerHostSslClientAuth `json:"client_auth,omitempty"` - EsCertificate *string `json:"es_certificate,omitempty"` - EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` - EsKey *string `json:"es_key,omitempty"` - Key *string `json:"key,omitempty"` - } `json:"ssl"` -} - -// ServerHostSecretsSslEsKey0 defines model for . -type ServerHostSecretsSslEsKey0 struct { - Id string `json:"id"` -} - -// ServerHostSecretsSslEsKey1 defines model for . -type ServerHostSecretsSslEsKey1 = string - -// ServerHost_Secrets_Ssl_EsKey defines model for ServerHost.Secrets.Ssl.EsKey. -type ServerHost_Secrets_Ssl_EsKey struct { - union json.RawMessage -} - -// ServerHostSecretsSslKey0 defines model for . -type ServerHostSecretsSslKey0 struct { - Id string `json:"id"` -} - -// ServerHostSecretsSslKey1 defines model for . -type ServerHostSecretsSslKey1 = string - -// ServerHost_Secrets_Ssl_Key defines model for ServerHost.Secrets.Ssl.Key. -type ServerHost_Secrets_Ssl_Key struct { - union json.RawMessage } -// ServerHostSslClientAuth defines model for ServerHost.Ssl.ClientAuth. -type ServerHostSslClientAuth string - // UpdateOutputElasticsearch defines model for update_output_elasticsearch. type UpdateOutputElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` @@ -2612,32 +2366,14 @@ type UpdateOutputElasticsearch struct { Name *string `json:"name,omitempty"` Preset *UpdateOutputElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - Key *UpdateOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputElasticsearchType `json:"type,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 -// UpdateOutputElasticsearchSecretsSslKey0 defines model for . -type UpdateOutputElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputElasticsearchSecretsSslKey1 defines model for . -type UpdateOutputElasticsearchSecretsSslKey1 = string - -// UpdateOutputElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputElasticsearch.Secrets.Ssl.Key. -type UpdateOutputElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. type UpdateOutputElasticsearchType string @@ -2798,9 +2534,6 @@ type UpdateOutputRemoteElasticsearch struct { Secrets *struct { KibanaApiKey *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - Ssl *struct { - Key *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` ServiceToken *string `json:"service_token"` Shipper *UpdateOutputShipper `json:"shipper,omitempty"` @@ -2838,19 +2571,6 @@ type UpdateOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } -// UpdateOutputRemoteElasticsearchSecretsSslKey0 defines model for . -type UpdateOutputRemoteElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputRemoteElasticsearchSecretsSslKey1 defines model for . -type UpdateOutputRemoteElasticsearchSecretsSslKey1 = string - -// UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputRemoteElasticsearch.Secrets.Ssl.Key. -type UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // UpdateOutputRemoteElasticsearchType defines model for UpdateOutputRemoteElasticsearch.Type. type UpdateOutputRemoteElasticsearchType string @@ -3049,7 +2769,6 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { } `json:"requests,omitempty"` } `json:"resources,omitempty"` } `json:"agentless,omitempty"` - BumpRevision *bool `json:"bumpRevision,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -3175,52 +2894,8 @@ type PostFleetFleetServerHostsJSONBody struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - EsKey *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` - Key *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Ssl *struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - ClientAuth *PostFleetFleetServerHostsJSONBodySslClientAuth `json:"client_auth,omitempty"` - EsCertificate *string `json:"es_certificate,omitempty"` - EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` - EsKey *string `json:"es_key,omitempty"` - Key *string `json:"key,omitempty"` - } `json:"ssl"` -} - -// PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 struct { - Id string `json:"id"` -} - -// PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 = string - -// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey struct { - union json.RawMessage -} - -// PostFleetFleetServerHostsJSONBodySecretsSslKey0 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslKey0 struct { - Id string `json:"id"` -} - -// PostFleetFleetServerHostsJSONBodySecretsSslKey1 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslKey1 = string - -// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key struct { - union json.RawMessage } -// PostFleetFleetServerHostsJSONBodySslClientAuth defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySslClientAuth string - // PutFleetFleetServerHostsItemidJSONBody defines parameters for PutFleetFleetServerHostsItemid. type PutFleetFleetServerHostsItemidJSONBody struct { HostUrls *[]string `json:"host_urls,omitempty"` @@ -3228,52 +2903,8 @@ type PutFleetFleetServerHostsItemidJSONBody struct { IsInternal *bool `json:"is_internal,omitempty"` Name *string `json:"name,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - EsKey *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` - Key *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Ssl *struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - ClientAuth *PutFleetFleetServerHostsItemidJSONBodySslClientAuth `json:"client_auth,omitempty"` - EsCertificate *string `json:"es_certificate,omitempty"` - EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` - EsKey *string `json:"es_key,omitempty"` - Key *string `json:"key,omitempty"` - } `json:"ssl"` -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 struct { - Id string `json:"id"` -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 = string - -// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey struct { - union json.RawMessage -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 struct { - Id string `json:"id"` -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 = string - -// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key struct { - union json.RawMessage } -// PutFleetFleetServerHostsItemidJSONBodySslClientAuth defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySslClientAuth string - // GetFleetPackagePoliciesParams defines parameters for GetFleetPackagePolicies. type GetFleetPackagePoliciesParams struct { Page *float32 `form:"page,omitempty" json:"page,omitempty"` @@ -3622,14 +3253,6 @@ func (a *OutputElasticsearch) UnmarshalJSON(b []byte) error { 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 { @@ -3760,13 +3383,6 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { } } - 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 { @@ -3795,271 +3411,69 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputElasticsearchSecretsSslKey0. Returns the specified +// Getter for additional properties for OutputKafka. Returns the specified // element and whether it was found -func (a OutputElasticsearchSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { +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 OutputElasticsearchSecretsSslKey0 -func (a *OutputElasticsearchSecretsSslKey0) Set(fieldName string, value interface{}) { +// 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 OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a *OutputElasticsearchSecretsSslKey0) UnmarshalJSON(b []byte) error { +// 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["id"]; found { - err = json.Unmarshal(raw, &a.Id) + if raw, found := object["allow_edit"]; found { + err = json.Unmarshal(raw, &a.AllowEdit) if err != nil { - return fmt.Errorf("error reading 'id': %w", err) + return fmt.Errorf("error reading 'allow_edit': %w", err) } - delete(object, "id") + delete(object, "allow_edit") } - 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 + 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") } - return nil -} - -// Override default JSON handling for OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a OutputElasticsearchSecretsSslKey0) 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 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") } - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) + if raw, found := object["ca_sha256"]; found { + err = json.Unmarshal(raw, &a.CaSha256) if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + return fmt.Errorf("error reading 'ca_sha256': %w", err) } + delete(object, "ca_sha256") } - return json.Marshal(object) -} -// Getter for additional properties for OutputElasticsearch_Secrets_Ssl. Returns the specified -// element and whether it was found -func (a OutputElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputElasticsearch_Secrets_Ssl -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a OutputElasticsearch_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 OutputElasticsearch_Secrets. Returns the specified -// element and whether it was found -func (a OutputElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputElasticsearch_Secrets -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties -func (a OutputElasticsearch_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 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["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 { @@ -6189,37 +5603,45 @@ func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, er return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearchSecretsSslKey0. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearch_Secrets. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearchSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { +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 OutputRemoteElasticsearchSecretsSslKey0 -func (a *OutputRemoteElasticsearchSecretsSslKey0) Set(fieldName string, value interface{}) { +// 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 OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a *OutputRemoteElasticsearchSecretsSslKey0) UnmarshalJSON(b []byte) error { +// 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["id"]; found { - err = json.Unmarshal(raw, &a.Id) + if raw, found := object["kibana_api_key"]; found { + err = json.Unmarshal(raw, &a.KibanaApiKey) if err != nil { - return fmt.Errorf("error reading 'id': %w", err) + return fmt.Errorf("error reading 'kibana_api_key': %w", err) } - delete(object, "id") + delete(object, "kibana_api_key") + } + + 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 { @@ -6236,14 +5658,23 @@ func (a *OutputRemoteElasticsearchSecretsSslKey0) UnmarshalJSON(b []byte) error return nil } -// Override default JSON handling for OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a OutputRemoteElasticsearchSecretsSslKey0) MarshalJSON() ([]byte, error) { +// 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) - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) + if a.KibanaApiKey != nil { + object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_api_key': %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) + } } for fieldName, field := range a.AdditionalProperties { @@ -6255,211 +5686,45 @@ func (a OutputRemoteElasticsearchSecretsSslKey0) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearch_Secrets_Ssl. Returns the specified +// Getter for additional properties for OutputShipper. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { +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 OutputRemoteElasticsearch_Secrets_Ssl -func (a *OutputRemoteElasticsearch_Secrets_Ssl) Set(fieldName string, value interface{}) { +// 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 OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a *OutputRemoteElasticsearch_Secrets_Ssl) UnmarshalJSON(b []byte) error { +// 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["key"]; found { - err = json.Unmarshal(raw, &a.Key) + if raw, found := object["compression_level"]; found { + err = json.Unmarshal(raw, &a.CompressionLevel) 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 fmt.Errorf("error reading 'compression_level': %w", err) } + delete(object, "compression_level") } - return nil -} - -// Override default JSON handling for OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a OutputRemoteElasticsearch_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 raw, found := object["disk_queue_compression_enabled"]; found { + err = json.Unmarshal(raw, &a.DiskQueueCompressionEnabled) if err != nil { - return nil, fmt.Errorf("error marshaling 'key': %w", err) + return fmt.Errorf("error reading 'disk_queue_compression_enabled': %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["kibana_api_key"]; found { - err = json.Unmarshal(raw, &a.KibanaApiKey) - if err != nil { - return fmt.Errorf("error reading 'kibana_api_key': %w", err) - } - delete(object, "kibana_api_key") - } - - 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["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 OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.KibanaApiKey != nil { - object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_api_key': %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.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 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") + delete(object, "disk_queue_compression_enabled") } if raw, found := object["disk_queue_enabled"]; found { @@ -8332,18 +7597,14 @@ func (a PackageInfo_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, } } - if a.Name != nil { - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) } - if a.StartedAt != nil { - object["started_at"], err = json.Marshal(a.StartedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'started_at': %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 { @@ -10505,18 +9766,14 @@ func (a PackageListItem_InstallationInfo_LatestExecutedState) MarshalJSON() ([]b } } - if a.Name != nil { - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) } - if a.StartedAt != nil { - object["started_at"], err = json.Marshal(a.StartedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'started_at': %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 { @@ -11306,68 +10563,6 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// AsFleetAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue0 -func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue0() (FleetAgentPolicyGlobalDataTagsItemValue0, error) { - var body FleetAgentPolicyGlobalDataTagsItemValue0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromFleetAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue0 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeFleetAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue0 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsFleetAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue1 -func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue1() (FleetAgentPolicyGlobalDataTagsItemValue1, error) { - var body FleetAgentPolicyGlobalDataTagsItemValue1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromFleetAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue1 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeFleetAgentPolicyGlobalDataTagsItemValue1 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue1 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) 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 FleetAgentPolicyGlobalDataTagsItem_Value) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - // AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 @@ -12114,68 +11309,6 @@ func (t *AgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { return err } -// AsNewOutputElasticsearchSecretsSslKey0 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey0 -func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey0() (NewOutputElasticsearchSecretsSslKey0, error) { - var body NewOutputElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey0 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey0 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputElasticsearchSecretsSslKey1 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey1 -func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey1() (NewOutputElasticsearchSecretsSslKey1, error) { - var body NewOutputElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey1 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey1 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) 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 NewOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) 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 @@ -12431,898 +11564,15 @@ func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElas 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 -} - -// AsNewOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey0 -func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey0() (NewOutputRemoteElasticsearchSecretsSslKey0, error) { - var body NewOutputRemoteElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey1 -func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey1() (NewOutputRemoteElasticsearchSecretsSslKey1, error) { - var body NewOutputRemoteElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 -} - -// AsOutputElasticsearchSecretsSslKey0 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey0 -func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey0() (OutputElasticsearchSecretsSslKey0, error) { - var body OutputElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputElasticsearchSecretsSslKey0 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey0 -func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey0 -func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputElasticsearchSecretsSslKey1 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey1 -func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey1() (OutputElasticsearchSecretsSslKey1, error) { - var body OutputElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputElasticsearchSecretsSslKey1 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey1 -func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey1 -func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) 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 OutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputElasticsearch_Secrets_Ssl_Key) 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 -} - -// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 -} - -// AsOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey0 -func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey0() (OutputRemoteElasticsearchSecretsSslKey0, error) { - var body OutputRemoteElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey0 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey0 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey1 -func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey1() (OutputRemoteElasticsearchSecretsSslKey1, error) { - var body OutputRemoteElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey1 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey1 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) 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 -} - -// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { - var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { - var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) 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 PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsPackageInfoInstallationInfoInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType0 -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType0() (PackageInfoInstallationInfoInstalledKibanaType0, error) { - var body PackageInfoInstallationInfoInstalledKibanaType0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromPackageInfoInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { +// 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 } -// MergePackageInfoInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { +// 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 @@ -13333,22 +11583,22 @@ func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInst return err } -// AsPackageInfoInstallationInfoInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType1 -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType1() (PackageInfoInstallationInfoInstalledKibanaType1, error) { - var body PackageInfoInstallationInfoInstalledKibanaType1 +// 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 } -// FromPackageInfoInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { +// 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 } -// MergePackageInfoInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { +// 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 @@ -13359,32 +11609,32 @@ func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInst return err } -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageInfoType0 returns the union data inside the PackageInfo_Type as a PackageInfoType0 -func (t PackageInfo_Type) AsPackageInfoType0() (PackageInfoType0, error) { - var body PackageInfoType0 +// 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 } -// FromPackageInfoType0 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType0 -func (t *PackageInfo_Type) FromPackageInfoType0(v PackageInfoType0) error { +// 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 } -// MergePackageInfoType0 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType0 -func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { +// 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 @@ -13395,22 +11645,22 @@ func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { return err } -// AsPackageInfoType1 returns the union data inside the PackageInfo_Type as a PackageInfoType1 -func (t PackageInfo_Type) AsPackageInfoType1() (PackageInfoType1, error) { - var body PackageInfoType1 +// 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 } -// FromPackageInfoType1 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType1 -func (t *PackageInfo_Type) FromPackageInfoType1(v PackageInfoType1) error { +// 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 } -// MergePackageInfoType1 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType1 -func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { +// 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 @@ -13421,22 +11671,22 @@ func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { return err } -// AsPackageInfoType2 returns the union data inside the PackageInfo_Type as a PackageInfoType2 -func (t PackageInfo_Type) AsPackageInfoType2() (PackageInfoType2, error) { - var body PackageInfoType2 +// 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 } -// FromPackageInfoType2 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType2 -func (t *PackageInfo_Type) FromPackageInfoType2(v PackageInfoType2) error { +// 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 } -// MergePackageInfoType2 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType2 -func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { +// 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 @@ -13447,22 +11697,22 @@ func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { return err } -// AsPackageInfoType3 returns the union data inside the PackageInfo_Type as a PackageInfoType3 -func (t PackageInfo_Type) AsPackageInfoType3() (PackageInfoType3, error) { - var body PackageInfoType3 +// 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 } -// FromPackageInfoType3 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType3 -func (t *PackageInfo_Type) FromPackageInfoType3(v PackageInfoType3) error { +// 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 } -// MergePackageInfoType3 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType3 -func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) error { +// 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 @@ -13473,32 +11723,32 @@ func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) error { return err } -func (t PackageInfo_Type) MarshalJSON() ([]byte, error) { +func (t NewOutputUnion) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageInfo_Type) UnmarshalJSON(b []byte) error { +func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { - var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +// 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 } -// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// 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 } -// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// 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 @@ -13509,22 +11759,22 @@ func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) return err } -// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { - var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +// 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 } -// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// 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 } -// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// 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 @@ -13535,32 +11785,32 @@ func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) return err } -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { +func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { +func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageListItemInstallationInfoInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType0 -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType0() (PackageListItemInstallationInfoInstalledKibanaType0, error) { - var body PackageListItemInstallationInfoInstalledKibanaType0 +// 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 } -// FromPackageListItemInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { +// 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 } -// MergePackageListItemInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { +// 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 @@ -13571,22 +11821,22 @@ func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageList return err } -// AsPackageListItemInstallationInfoInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType1 -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType1() (PackageListItemInstallationInfoInstalledKibanaType1, error) { - var body PackageListItemInstallationInfoInstalledKibanaType1 +// 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 } -// FromPackageListItemInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { +// 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 } -// MergePackageListItemInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { +// 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 @@ -13597,32 +11847,32 @@ func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageList return err } -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { +func (t OutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { +func (t *OutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageListItemType0 returns the union data inside the PackageListItem_Type as a PackageListItemType0 -func (t PackageListItem_Type) AsPackageListItemType0() (PackageListItemType0, error) { - var body PackageListItemType0 +// 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 } -// FromPackageListItemType0 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType0 -func (t *PackageListItem_Type) FromPackageListItemType0(v PackageListItemType0) error { +// 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 } -// MergePackageListItemType0 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType0 -func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) error { +// 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 @@ -13633,22 +11883,22 @@ func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) return err } -// AsPackageListItemType1 returns the union data inside the PackageListItem_Type as a PackageListItemType1 -func (t PackageListItem_Type) AsPackageListItemType1() (PackageListItemType1, error) { - var body PackageListItemType1 +// 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 } -// FromPackageListItemType1 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType1 -func (t *PackageListItem_Type) FromPackageListItemType1(v PackageListItemType1) error { +// 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 } -// MergePackageListItemType1 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType1 -func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) error { +// 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 @@ -13659,22 +11909,32 @@ func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) return err } -// AsPackageListItemType2 returns the union data inside the PackageListItem_Type as a PackageListItemType2 -func (t PackageListItem_Type) AsPackageListItemType2() (PackageListItemType2, error) { - var body PackageListItemType2 +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 +} + +// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey0 err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType2 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType2 -func (t *PackageListItem_Type) FromPackageListItemType2(v PackageListItemType2) error { +// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType2 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType2 -func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) error { +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -13685,22 +11945,22 @@ func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) return err } -// AsPackageListItemType3 returns the union data inside the PackageListItem_Type as a PackageListItemType3 -func (t PackageListItem_Type) AsPackageListItemType3() (PackageListItemType3, error) { - var body PackageListItemType3 +// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey1 err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType3 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType3 -func (t *PackageListItem_Type) FromPackageListItemType3(v PackageListItemType3) error { +// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType3 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType3 -func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) error { +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -13711,32 +11971,32 @@ func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) return err } -func (t PackageListItem_Type) MarshalJSON() ([]byte, error) { +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageListItem_Type) UnmarshalJSON(b []byte) error { +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsServerHostSecretsSslEsKey0 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey0 -func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey0() (ServerHostSecretsSslEsKey0, error) { - var body ServerHostSecretsSslEsKey0 +// 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 } -// FromServerHostSecretsSslEsKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey0 -func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { +// 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 } -// MergeServerHostSecretsSslEsKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey0 -func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { +// 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 @@ -13747,22 +12007,22 @@ func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerH return err } -// AsServerHostSecretsSslEsKey1 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey1 -func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey1() (ServerHostSecretsSslEsKey1, error) { - var body ServerHostSecretsSslEsKey1 +// 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 } -// FromServerHostSecretsSslEsKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey1 -func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { +// 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 } -// MergeServerHostSecretsSslEsKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey1 -func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { +// 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 @@ -13773,32 +12033,34 @@ func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerH return err } -func (t ServerHost_Secrets_Ssl_EsKey) MarshalJSON() ([]byte, error) { +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *ServerHost_Secrets_Ssl_EsKey) UnmarshalJSON(b []byte) error { +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsServerHostSecretsSslKey0 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey0 -func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey0() (ServerHostSecretsSslKey0, error) { - var body ServerHostSecretsSslKey0 +// 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 } -// FromServerHostSecretsSslKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey0 -func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { +// 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 } -// MergeServerHostSecretsSslKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey0 -func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { +// 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 @@ -13809,22 +12071,24 @@ func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostS return err } -// AsServerHostSecretsSslKey1 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey1 -func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey1() (ServerHostSecretsSslKey1, error) { - var body ServerHostSecretsSslKey1 +// 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 } -// FromServerHostSecretsSslKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey1 -func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { +// 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 } -// MergeServerHostSecretsSslKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey1 -func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { +// 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 @@ -13835,32 +12099,24 @@ func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostS return err } -func (t ServerHost_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *ServerHost_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsUpdateOutputElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey0 -func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey0() (UpdateOutputElasticsearchSecretsSslKey0, error) { - var body UpdateOutputElasticsearchSecretsSslKey0 +// 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 } -// FromUpdateOutputElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey0 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { +// 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 } -// MergeUpdateOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey0 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { +// 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 @@ -13871,22 +12127,24 @@ func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsear return err } -// AsUpdateOutputElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey1 -func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey1() (UpdateOutputElasticsearchSecretsSslKey1, error) { - var body UpdateOutputElasticsearchSecretsSslKey1 +// 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 } -// FromUpdateOutputElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey1 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { +// 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 } -// MergeUpdateOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey1 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { +// 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 @@ -13897,12 +12155,39 @@ func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsear return err } -func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { +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 *UpdateOutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { +func (t *OutputUnion) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } @@ -14217,68 +12502,6 @@ func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b [ return err } -// AsUpdateOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey0 -func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey0() (UpdateOutputRemoteElasticsearchSecretsSslKey0, error) { - var body UpdateOutputRemoteElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey1 -func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey1() (UpdateOutputRemoteElasticsearchSecretsSslKey1, error) { - var body UpdateOutputRemoteElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 @@ -17187,10 +15410,9 @@ type GetFleetAgentPoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17217,10 +15439,9 @@ type PostFleetAgentPoliciesResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17248,10 +15469,9 @@ type PostFleetAgentPoliciesDeleteResponse struct { Name string `json:"name"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17278,10 +15498,9 @@ type GetFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17308,10 +15527,9 @@ type PutFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17360,10 +15578,9 @@ type GetFleetEnrollmentApiKeysResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17390,10 +15607,9 @@ type GetFleetEpmPackagesResponse struct { Items []PackageListItem `json:"items"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17441,22 +15657,17 @@ type DeleteFleetEpmPackagesPkgnamePkgversionResponse struct { Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type DeleteFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` -} -type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type0 string -type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string -type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { - union json.RawMessage + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` } +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type string type DeleteFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -17494,10 +15705,9 @@ type GetFleetEpmPackagesPkgnamePkgversionResponse struct { } `json:"metadata,omitempty"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17527,22 +15737,17 @@ type PostFleetEpmPackagesPkgnamePkgversionResponse struct { Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type PostFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` -} -type PostFleetEpmPackagesPkgnamePkgversion200Items0Type0 string -type PostFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string -type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { - union json.RawMessage + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PostFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` } +type PostFleetEpmPackagesPkgnamePkgversion200Items0Type string type PostFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -17580,10 +15785,9 @@ type GetFleetFleetServerHostsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17610,10 +15814,9 @@ type PostFleetFleetServerHostsResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17640,10 +15843,9 @@ type DeleteFleetFleetServerHostsItemidResponse struct { Id string `json:"id"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17670,10 +15872,9 @@ type GetFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17700,10 +15901,9 @@ type PutFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17733,10 +15933,9 @@ type GetFleetOutputsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17763,10 +15962,9 @@ type PostFleetOutputsResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17793,16 +15991,14 @@ type DeleteFleetOutputsOutputidResponse struct { Id string `json:"id"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON404 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17829,10 +16025,9 @@ type GetFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17859,10 +16054,9 @@ type PutFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17892,10 +16086,9 @@ type GetFleetPackagePoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17922,16 +16115,14 @@ type PostFleetPackagePoliciesResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON409 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17958,10 +16149,9 @@ type DeleteFleetPackagePoliciesPackagepolicyidResponse struct { Id string `json:"id"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17988,10 +16178,9 @@ type GetFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON404 *struct { Message string `json:"message"` @@ -18021,16 +16210,14 @@ type PutFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON403 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -18569,10 +16756,9 @@ func ParseGetFleetAgentPoliciesResponse(rsp *http.Response) (*GetFleetAgentPolic case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18609,10 +16795,9 @@ func ParsePostFleetAgentPoliciesResponse(rsp *http.Response) (*PostFleetAgentPol case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18650,10 +16835,9 @@ func ParsePostFleetAgentPoliciesDeleteResponse(rsp *http.Response) (*PostFleetAg case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18690,10 +16874,9 @@ func ParseGetFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*GetFl case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18730,10 +16913,9 @@ func ParsePutFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*PutFl case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18792,10 +16974,9 @@ func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnroll case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18832,10 +17013,9 @@ func ParseGetFleetEpmPackagesResponse(rsp *http.Response) (*GetFleetEpmPackagesR case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18888,10 +17068,9 @@ func ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (* case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18931,10 +17110,9 @@ func ParseGetFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Get case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18974,10 +17152,9 @@ func ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Po case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19017,10 +17194,9 @@ func ParseGetFleetFleetServerHostsResponse(rsp *http.Response) (*GetFleetFleetSe case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19057,10 +17233,9 @@ func ParsePostFleetFleetServerHostsResponse(rsp *http.Response) (*PostFleetFleet case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19097,10 +17272,9 @@ func ParseDeleteFleetFleetServerHostsItemidResponse(rsp *http.Response) (*Delete case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19137,10 +17311,9 @@ func ParseGetFleetFleetServerHostsItemidResponse(rsp *http.Response) (*GetFleetF case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19177,10 +17350,9 @@ func ParsePutFleetFleetServerHostsItemidResponse(rsp *http.Response) (*PutFleetF case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19220,10 +17392,9 @@ func ParseGetFleetOutputsResponse(rsp *http.Response) (*GetFleetOutputsResponse, case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19260,10 +17431,9 @@ func ParsePostFleetOutputsResponse(rsp *http.Response) (*PostFleetOutputsRespons case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19300,10 +17470,9 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19312,10 +17481,9 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19352,10 +17520,9 @@ func ParseGetFleetOutputsOutputidResponse(rsp *http.Response) (*GetFleetOutputsO case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19392,10 +17559,9 @@ func ParsePutFleetOutputsOutputidResponse(rsp *http.Response) (*PutFleetOutputsO case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19435,10 +17601,9 @@ func ParseGetFleetPackagePoliciesResponse(rsp *http.Response) (*GetFleetPackageP case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19475,10 +17640,9 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19487,10 +17651,9 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19527,10 +17690,9 @@ func ParseDeleteFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19567,10 +17729,9 @@ func ParseGetFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*G case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19616,10 +17777,9 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19628,10 +17788,9 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 diff --git a/generated/kbapi/transform_schema.go b/generated/kbapi/transform_schema.go index 54b5cc395..f1f0c4883 100644 --- a/generated/kbapi/transform_schema.go +++ b/generated/kbapi/transform_schema.go @@ -837,21 +837,8 @@ func transformFleetPaths(schema *Schema) { 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) } - schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") - schema.Components.Set("schemas.agent_policy_global_data_tags_item", Map{ - "type": "object", - "properties": Map{ - "name": Map{"type": "string"}, - "value": Map{ - "oneOf": []Map{ - {"type": "string"}, - {"type": "number"}, - }, - }, - }, - "required": []string{"name", "value"}, - }) + schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") // Define the value types for the GlobalDataTags agentPoliciesPath.Post.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") From d55a1b6f8846e138e76e64d33ebea59c7e2c70f2 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Wed, 5 Mar 2025 13:20:03 -0500 Subject: [PATCH 27/89] gen kbapi from github_ref=3757e641278a5186919e35a0f980ac3cda7e8ccd --- generated/kbapi/kibana.gen.go | 1463 ++++----------------------------- 1 file changed, 149 insertions(+), 1314 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index b8608bc75..400a66d4a 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -39,11 +39,11 @@ const ( AgentPolicyMonitoringEnabledTraces AgentPolicyMonitoringEnabled = "traces" ) -// Defines values for AgentPolicyPackagePolicies1Inputs0StreamsRelease. +// Defines values for AgentPolicyPackagePolicies1InputsStreamsRelease. const ( - AgentPolicyPackagePolicies1Inputs0StreamsReleaseBeta AgentPolicyPackagePolicies1Inputs0StreamsRelease = "beta" - AgentPolicyPackagePolicies1Inputs0StreamsReleaseExperimental AgentPolicyPackagePolicies1Inputs0StreamsRelease = "experimental" - AgentPolicyPackagePolicies1Inputs0StreamsReleaseGa AgentPolicyPackagePolicies1Inputs0StreamsRelease = "ga" + AgentPolicyPackagePolicies1InputsStreamsReleaseBeta AgentPolicyPackagePolicies1InputsStreamsRelease = "beta" + AgentPolicyPackagePolicies1InputsStreamsReleaseExperimental AgentPolicyPackagePolicies1InputsStreamsRelease = "experimental" + AgentPolicyPackagePolicies1InputsStreamsReleaseGa AgentPolicyPackagePolicies1InputsStreamsRelease = "ga" ) // Defines values for AgentPolicyStatus. @@ -795,28 +795,16 @@ type DataViewsUpdateDataViewRequestObjectInner struct { // 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"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + 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"` - Agentless *struct { - Resources *struct { - Requests *struct { - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - } `json:"requests,omitempty"` - } `json:"resources,omitempty"` - } `json:"agentless,omitempty"` Agents *float32 `json:"agents,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` @@ -854,7 +842,7 @@ type AgentPolicy struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Enabled bool `json:"enabled"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -864,19 +852,12 @@ type AgentPolicy struct { 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"` - RequiredVersions *[]struct { - // Percentage Target percentage of agents to auto upgrade - Percentage float32 `json:"percentage"` - - // Version Target version for automatic agent upgrade - Version string `json:"version"` - } `json:"required_versions"` - Revision float32 `json:"revision"` - SchemaVersion *string `json:"schema_version,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` - Status AgentPolicyStatus `json:"status"` + 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"` @@ -895,17 +876,69 @@ 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 { - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + 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 AgentPolicy_PackagePolicies_1_Inputs `json:"inputs"` - IsManaged *bool `json:"is_managed,omitempty"` + 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"` @@ -946,14 +979,16 @@ type AgentPolicyPackagePolicies1 = []struct { SecretReferences *[]struct { Id string `json:"id"` } `json:"secret_references,omitempty"` - SpaceIds *[]string `json:"spaceIds,omitempty"` + UpdatedAt string `json:"updated_at"` + UpdatedBy string `json:"updated_by"` - // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` - Vars *AgentPolicy_PackagePolicies_1_Vars `json:"vars,omitempty"` - Version *string `json:"version,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"` + Version *string `json:"version,omitempty"` } // AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges defines model for AgentPolicy.PackagePolicies.1.Elasticsearch.Privileges. @@ -968,180 +1003,8 @@ type AgentPolicy_PackagePolicies_1_Elasticsearch struct { AdditionalProperties map[string]interface{} `json:"-"` } -// AgentPolicyPackagePolicies1Inputs0 defines model for . -type AgentPolicyPackagePolicies1Inputs0 = []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 *AgentPolicyPackagePolicies1Inputs0StreamsRelease `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"` -} - -// AgentPolicyPackagePolicies1Inputs0StreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.0.Streams.Release. -type AgentPolicyPackagePolicies1Inputs0StreamsRelease string - -// AgentPolicyPackagePolicies1Inputs1 Package policy inputs (see integration documentation to know what inputs are available) -type AgentPolicyPackagePolicies1Inputs1 map[string]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]struct { - // Enabled enable or disable that stream, (default to true) - Enabled *bool `json:"enabled,omitempty"` - - // Vars Input/stream level variable (see integration documentation for more information) - Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties `json:"vars,omitempty"` - } `json:"streams,omitempty"` - - // Vars Input/stream level variable (see integration documentation for more information) - Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties `json:"vars,omitempty"` -} - -// AgentPolicyPackagePolicies1Inputs1StreamsVars0 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars0 = bool - -// AgentPolicyPackagePolicies1Inputs1StreamsVars1 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars1 = string - -// AgentPolicyPackagePolicies1Inputs1StreamsVars2 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars2 = float32 - -// AgentPolicyPackagePolicies1Inputs1StreamsVars3 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars3 = []string - -// AgentPolicyPackagePolicies1Inputs1StreamsVars4 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars4 = []float32 - -// AgentPolicyPackagePolicies1Inputs1StreamsVars5 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars5 struct { - Id string `json:"id"` - IsSecretRef bool `json:"isSecretRef"` -} - -// AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Streams.Vars.AdditionalProperties. -type AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties struct { - union json.RawMessage -} - -// AgentPolicyPackagePolicies1Inputs1Vars0 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars0 = bool - -// AgentPolicyPackagePolicies1Inputs1Vars1 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars1 = string - -// AgentPolicyPackagePolicies1Inputs1Vars2 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars2 = float32 - -// AgentPolicyPackagePolicies1Inputs1Vars3 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars3 = []string - -// AgentPolicyPackagePolicies1Inputs1Vars4 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars4 = []float32 - -// AgentPolicyPackagePolicies1Inputs1Vars5 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars5 struct { - Id string `json:"id"` - IsSecretRef bool `json:"isSecretRef"` -} - -// AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Vars.AdditionalProperties. -type AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties struct { - union json.RawMessage -} - -// AgentPolicy_PackagePolicies_1_Inputs defines model for AgentPolicy.PackagePolicies.1.Inputs. -type AgentPolicy_PackagePolicies_1_Inputs struct { - union json.RawMessage -} - -// AgentPolicyPackagePolicies1Vars0 Package variable (see integration documentation for more information) -type AgentPolicyPackagePolicies1Vars0 map[string]struct { - Frozen *bool `json:"frozen,omitempty"` - Type *string `json:"type,omitempty"` - Value interface{} `json:"value"` -} - -// AgentPolicyPackagePolicies1Vars1 Input/stream level variable (see integration documentation for more information) -type AgentPolicyPackagePolicies1Vars1 map[string]*AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties - -// AgentPolicyPackagePolicies1Vars10 defines model for . -type AgentPolicyPackagePolicies1Vars10 = bool - -// AgentPolicyPackagePolicies1Vars11 defines model for . -type AgentPolicyPackagePolicies1Vars11 = string - -// AgentPolicyPackagePolicies1Vars12 defines model for . -type AgentPolicyPackagePolicies1Vars12 = float32 - -// AgentPolicyPackagePolicies1Vars13 defines model for . -type AgentPolicyPackagePolicies1Vars13 = []string - -// AgentPolicyPackagePolicies1Vars14 defines model for . -type AgentPolicyPackagePolicies1Vars14 = []float32 - -// AgentPolicyPackagePolicies1Vars15 defines model for . -type AgentPolicyPackagePolicies1Vars15 struct { - Id string `json:"id"` - IsSecretRef bool `json:"isSecretRef"` -} - -// AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Vars.1.AdditionalProperties. -type AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties struct { - union json.RawMessage -} - -// AgentPolicy_PackagePolicies_1_Vars defines model for AgentPolicy.PackagePolicies.1.Vars. -type AgentPolicy_PackagePolicies_1_Vars struct { - union json.RawMessage -} +// AgentPolicyPackagePolicies1InputsStreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.Streams.Release. +type AgentPolicyPackagePolicies1InputsStreamsRelease string // AgentPolicy_PackagePolicies defines model for AgentPolicy.PackagePolicies. type AgentPolicy_PackagePolicies struct { @@ -1375,38 +1238,21 @@ type NewOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *NewOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { - KibanaApiKey *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` 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"` - SyncIntegrations *bool `json:"sync_integrations,omitempty"` - Type NewOutputRemoteElasticsearchType `json:"type"` + 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 -// NewOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . -type NewOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { - Id string `json:"id"` -} - -// NewOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . -type NewOutputRemoteElasticsearchSecretsKibanaApiKey1 = string - -// NewOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for NewOutputRemoteElasticsearch.Secrets.KibanaApiKey. -type NewOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { - union json.RawMessage -} - // NewOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type NewOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1673,8 +1519,6 @@ type OutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *OutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id"` @@ -1682,7 +1526,6 @@ type OutputRemoteElasticsearch struct { ServiceToken *string `json:"service_token"` Shipper *OutputShipper `json:"shipper"` Ssl *OutputSsl `json:"ssl"` - SyncIntegrations *bool `json:"sync_integrations,omitempty"` Type OutputRemoteElasticsearchType `json:"type"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1690,20 +1533,6 @@ type OutputRemoteElasticsearch struct { // OutputRemoteElasticsearchPreset defines model for OutputRemoteElasticsearch.Preset. type OutputRemoteElasticsearchPreset string -// OutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . -type OutputRemoteElasticsearchSecretsKibanaApiKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . -type OutputRemoteElasticsearchSecretsKibanaApiKey1 = string - -// OutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for OutputRemoteElasticsearch.Secrets.KibanaApiKey. -type OutputRemoteElasticsearch_Secrets_KibanaApiKey struct { - union json.RawMessage -} - // OutputRemoteElasticsearchSecretsServiceToken0 defines model for . type OutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1720,7 +1549,6 @@ type OutputRemoteElasticsearch_Secrets_ServiceToken struct { // OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. type OutputRemoteElasticsearch_Secrets struct { - KibanaApiKey *OutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2240,13 +2068,10 @@ type PackagePolicy struct { Revision float32 `json:"revision"` SecretReferences *[]PackagePolicySecretRef `json:"secret_references,omitempty"` SpaceIds *[]string `json:"spaceIds,omitempty"` - - // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` - Vars *map[string]interface{} `json:"vars,omitempty"` - Version *string `json:"version,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. @@ -2292,10 +2117,7 @@ type PackagePolicyRequest struct { Package PackagePolicyRequestPackage `json:"package"` PolicyId *string `json:"policy_id"` PolicyIds *[]string `json:"policy_ids,omitempty"` - - // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` - Vars *map[string]interface{} `json:"vars,omitempty"` + Vars *map[string]interface{} `json:"vars,omitempty"` } // PackagePolicyRequestInput defines model for package_policy_request_input. @@ -2526,38 +2348,21 @@ type UpdateOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` Name *string `json:"name,omitempty"` Preset *UpdateOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { - KibanaApiKey *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` 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"` - SyncIntegrations *bool `json:"sync_integrations,omitempty"` - Type *UpdateOutputRemoteElasticsearchType `json:"type,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 -// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . -type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . -type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 = string - -// UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for UpdateOutputRemoteElasticsearch.Secrets.KibanaApiKey. -type UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { - union json.RawMessage -} - // UpdateOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type UpdateOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -2639,28 +2444,16 @@ type GetFleetAgentPoliciesParamsFormat string // PostFleetAgentPoliciesJSONBody defines parameters for PostFleetAgentPolicies. type PostFleetAgentPoliciesJSONBody struct { AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + 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"` - Agentless *struct { - Resources *struct { - Requests *struct { - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - } `json:"requests,omitempty"` - } `json:"resources,omitempty"` - } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2695,7 +2488,7 @@ type PostFleetAgentPoliciesJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Enabled bool `json:"enabled"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2706,14 +2499,8 @@ type PostFleetAgentPoliciesJSONBody struct { // 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"` - RequiredVersions *[]struct { - // Percentage Target percentage of agents to auto upgrade - Percentage float32 `json:"percentage"` - - // Version Target version for automatic agent upgrade - Version string `json:"version"` - } `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *interface{} `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -2747,28 +2534,16 @@ type GetFleetAgentPoliciesAgentpolicyidParamsFormat string // PutFleetAgentPoliciesAgentpolicyidJSONBody defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + 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"` - Agentless *struct { - Resources *struct { - Requests *struct { - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - } `json:"requests,omitempty"` - } `json:"resources,omitempty"` - } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2803,7 +2578,7 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Enabled bool `json:"enabled"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2814,14 +2589,8 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { // 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"` - RequiredVersions *[]struct { - // Percentage Target percentage of agents to auto upgrade - Percentage float32 `json:"percentage"` - - // Version Target version for automatic agent upgrade - Version string `json:"version"` - } `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *interface{} `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -5214,22 +4983,6 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "is_preconfigured") } - if raw, found := object["kibana_api_key"]; found { - err = json.Unmarshal(raw, &a.KibanaApiKey) - if err != nil { - return fmt.Errorf("error reading 'kibana_api_key': %w", err) - } - delete(object, "kibana_api_key") - } - - if raw, found := object["kibana_url"]; found { - err = json.Unmarshal(raw, &a.KibanaUrl) - if err != nil { - return fmt.Errorf("error reading 'kibana_url': %w", err) - } - delete(object, "kibana_url") - } - if raw, found := object["name"]; found { err = json.Unmarshal(raw, &a.Name) if err != nil { @@ -5286,14 +5039,6 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "ssl") } - if raw, found := object["sync_integrations"]; found { - err = json.Unmarshal(raw, &a.SyncIntegrations) - if err != nil { - return fmt.Errorf("error reading 'sync_integrations': %w", err) - } - delete(object, "sync_integrations") - } - if raw, found := object["type"]; found { err = json.Unmarshal(raw, &a.Type) if err != nil { @@ -5389,20 +5134,6 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } - if a.KibanaApiKey != nil { - object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_api_key': %w", err) - } - } - - if a.KibanaUrl != nil { - object["kibana_url"], err = json.Marshal(a.KibanaUrl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_url': %w", err) - } - } - object["name"], err = json.Marshal(a.Name) if err != nil { return nil, fmt.Errorf("error marshaling 'name': %w", err) @@ -5450,13 +5181,6 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } - if a.SyncIntegrations != nil { - object["sync_integrations"], err = json.Marshal(a.SyncIntegrations) - if err != nil { - return nil, fmt.Errorf("error marshaling 'sync_integrations': %w", err) - } - } - object["type"], err = json.Marshal(a.Type) if err != nil { return nil, fmt.Errorf("error marshaling 'type': %w", err) @@ -5471,72 +5195,6 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0. Returns the specified -// element and whether it was found -func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties -func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) 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 OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties -func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) 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 OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified // element and whether it was found func (a OutputRemoteElasticsearchSecretsServiceToken0) Get(fieldName string) (value interface{}, found bool) { @@ -5628,14 +5286,6 @@ func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { return err } - if raw, found := object["kibana_api_key"]; found { - err = json.Unmarshal(raw, &a.KibanaApiKey) - if err != nil { - return fmt.Errorf("error reading 'kibana_api_key': %w", err) - } - delete(object, "kibana_api_key") - } - if raw, found := object["service_token"]; found { err = json.Unmarshal(raw, &a.ServiceToken) if err != nil { @@ -5663,13 +5313,6 @@ func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) - if a.KibanaApiKey != nil { - object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_api_key': %w", err) - } - } - if a.ServiceToken != nil { object["service_token"], err = json.Marshal(a.ServiceToken) if err != nil { @@ -10563,22 +10206,22 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 +// 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 } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// 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 } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// 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 @@ -10589,22 +10232,22 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 +// 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 } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// 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 } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// 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 @@ -10615,22 +10258,32 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 +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 +} + +// AsAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue0 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue0() (AgentPolicyGlobalDataTagsItemValue0, error) { + var body AgentPolicyGlobalDataTagsItemValue0 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { +// FromAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { +// MergeAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) if err != nil { return err @@ -10641,647 +10294,15 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars3 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars3() (AgentPolicyPackagePolicies1Inputs1StreamsVars3, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars3 +// AsAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue1 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue1() (AgentPolicyGlobalDataTagsItemValue1, error) { + var body AgentPolicyGlobalDataTagsItemValue1 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars4 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars4() (AgentPolicyPackagePolicies1Inputs1StreamsVars4, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars4 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars5 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars5() (AgentPolicyPackagePolicies1Inputs1StreamsVars5, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars5 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) 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_1_Inputs_1_Streams_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars0 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars0() (AgentPolicyPackagePolicies1Inputs1Vars0, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars1 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars1() (AgentPolicyPackagePolicies1Inputs1Vars1, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars2 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars2() (AgentPolicyPackagePolicies1Inputs1Vars2, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars2 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars3 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars3() (AgentPolicyPackagePolicies1Inputs1Vars3, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars3 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars4 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars4() (AgentPolicyPackagePolicies1Inputs1Vars4, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars4 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars5 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars5() (AgentPolicyPackagePolicies1Inputs1Vars5, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars5 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) 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_1_Inputs_1_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Inputs0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs0 -func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs0() (AgentPolicyPackagePolicies1Inputs0, error) { - var body AgentPolicyPackagePolicies1Inputs0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs0 -func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs0 -func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs1 -func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs1() (AgentPolicyPackagePolicies1Inputs1, error) { - var body AgentPolicyPackagePolicies1Inputs1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs1 -func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs1 -func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) 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_1_Inputs) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Inputs) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Vars10 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars10 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars10() (AgentPolicyPackagePolicies1Vars10, error) { - var body AgentPolicyPackagePolicies1Vars10 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars10 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars10 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars10 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars10 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars11 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars11 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars11() (AgentPolicyPackagePolicies1Vars11, error) { - var body AgentPolicyPackagePolicies1Vars11 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars11 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars11 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars11 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars11 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars12 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars12 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars12() (AgentPolicyPackagePolicies1Vars12, error) { - var body AgentPolicyPackagePolicies1Vars12 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars12 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars12 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars12 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars12 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars13 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars13 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars13() (AgentPolicyPackagePolicies1Vars13, error) { - var body AgentPolicyPackagePolicies1Vars13 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars13 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars13 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars13 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars13 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars14 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars14 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars14() (AgentPolicyPackagePolicies1Vars14, error) { - var body AgentPolicyPackagePolicies1Vars14 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars14 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars14 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars14 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars14 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars15 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars15 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars15() (AgentPolicyPackagePolicies1Vars15, error) { - var body AgentPolicyPackagePolicies1Vars15 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars15 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars15 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars15 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars15 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) 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_1_Vars_1_AdditionalProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars0 -func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars0() (AgentPolicyPackagePolicies1Vars0, error) { - var body AgentPolicyPackagePolicies1Vars0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars1 -func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars1() (AgentPolicyPackagePolicies1Vars1, error) { - var body AgentPolicyPackagePolicies1Vars1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) 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_1_Vars) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Vars) 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 -} - -// AsAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue0 -func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue0() (AgentPolicyGlobalDataTagsItemValue0, error) { - var body AgentPolicyGlobalDataTagsItemValue0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue0 -func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue0 -func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue1 -func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue1() (AgentPolicyGlobalDataTagsItemValue1, error) { - var body AgentPolicyGlobalDataTagsItemValue1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue1 -func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) error { +// FromAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue1 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) error { b, err := json.Marshal(v) t.union = b return err @@ -11495,68 +10516,6 @@ func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } -// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0() (NewOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body NewOutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1() (NewOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body NewOutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -11919,68 +10878,6 @@ func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } -// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -12378,68 +11275,6 @@ func (t *UpdateOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } -// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 From fb2a43604b973bbfe5956b18fa037c17f9737539 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:40:28 -0500 Subject: [PATCH 28/89] fmt --- internal/fleet/agent_policy/create.go | 4 +- internal/fleet/agent_policy/models.go | 105 ++++++++++++++++++++------ internal/fleet/agent_policy/read.go | 2 +- internal/fleet/agent_policy/schema.go | 34 ++++++++- internal/fleet/agent_policy/update.go | 4 +- 5 files changed, 120 insertions(+), 29 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 3ed965cf2..ea4420777 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body, diags := planModel.toAPICreateModel(sVersion) + body, diags := planModel.toAPICreateModel(ctx, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -40,7 +40,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - diags = planModel.populateFromAPI(policy, sVersion) + diags = planModel.populateFromAPI(ctx, policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index f41cefc84..3081d161d 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -1,7 +1,7 @@ package agent_policy import ( - "encoding/json" + "context" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -26,10 +27,10 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` - GlobalDataTags types.String `tfsdk:"global_data_tags"` + GlobalDataTags types.Map `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { if data == nil { return nil } @@ -59,21 +60,36 @@ func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy, serverVe model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { + if utils.Deref(data.GlobalDataTags) != nil { diags := diag.Diagnostics{} - d, err := json.Marshal(utils.Deref(data.GlobalDataTags)) - if err != nil { - diags.AddError("Failed to marshal global data tags", err.Error()) + var map0 = make(map[string]any) + for _, v := range utils.Deref(data.GlobalDataTags) { + maybeFloat, error := v.Value.AsAgentPolicyGlobalDataTagsItemValue1() + if error != nil { + maybeString, error := v.Value.AsAgentPolicyGlobalDataTagsItemValue0() + if error != nil { + diags.AddError("Failed to unmarshal global data tags", error.Error()) + } + map0[v.Name] = map[string]string{ + "string_value": string(maybeString), + } + } else { + map0[v.Name] = map[string]float32{ + "number_value": float32(maybeFloat), + } + } + } + gdt := utils.MapValueFrom(ctx, map0, getGlobalDataTagsAttrType(), path.Root("global_data_tags"), &diags) + if diags.HasError() { return diags } - strD := string(d) - model.GlobalDataTags = types.StringPointerValue(&strD) + model.GlobalDataTags = gdt } return nil } -func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { @@ -95,21 +111,42 @@ func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.ValueString()) > 0 { + if len(model.GlobalDataTags.Elements()) > 0 { var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueStringPointer() var items []kbapi.AgentPolicyGlobalDataTagsItem - - err := json.Unmarshal([]byte(*str), &items) - if err != nil { - diags.AddError(err.Error(), "") + itemsMap := utils.MapTypeAs[struct { + string_value *string + number_value *float32 + }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + if diags.HasError() { return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } + for k, v := range itemsMap { + if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { + diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags + } + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if v.string_value != nil { + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) + } + if err != nil { + diags.AddError("global_data_tags ES version error", "could not convert global data tags value") + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags + } + items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ + Name: k, + Value: value, + }) + } body.GlobalDataTags = &items } @@ -117,7 +154,7 @@ func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) return body, nil } -func (model *agentPolicyModel) toAPIUpdateModel(serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -137,21 +174,43 @@ func (model *agentPolicyModel) toAPIUpdateModel(serverVersion *version.Version) Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.ValueString()) > 0 { + if len(model.GlobalDataTags.Elements()) > 0 { var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueStringPointer() var items []kbapi.AgentPolicyGlobalDataTagsItem - - err := json.Unmarshal([]byte(*str), &items) - if err != nil { - diags.AddError(err.Error(), "") + itemsMap := utils.MapTypeAs[struct { + string_value *string + number_value *float32 + }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + if diags.HasError() { return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } + for k, v := range itemsMap { + if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { + diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags + } + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if v.string_value != nil { + // s := *v.string_value + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) + } + if err != nil { + diags.AddError("global_data_tags ES version error", "could not convert global data tags value") + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags + } + items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ + Name: k, + Value: value, + }) + } body.GlobalDataTags = &items } diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index 5a8fd1f09..34916f0bd 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -39,7 +39,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - diags = stateModel.populateFromAPI(policy, sVersion) + diags = stateModel.populateFromAPI(ctx, policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 123b3c740..a16746f49 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,12 +3,17 @@ package agent_policy import ( "context" + "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -86,7 +91,30 @@ func getSchema() schema.Schema { boolplanmodifier.RequiresReplace(), }, }, - "global_data_tags": schema.StringAttribute{ + "global_data_tags": schema.MapNestedAttribute{ + Description: "user-defined data tags to apply to all inputs. values can be strings (string_value) or numbers (number_value).", + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "string_value": schema.StringAttribute{ + Description: "Custom label for the field.", + Optional: true, + }, + "number_value": schema.Float32Attribute{ + Description: "Popularity count for the field.", + Optional: true, + }, + }, + Validators: []validator.Object{ + objectvalidator.ExactlyOneOf(path.MatchRoot("string_value"), path.MatchRoot("number_value")), + }, + }, + Optional: true, + PlanModifiers: []planmodifier.Map{ + mapplanmodifier.RequiresReplace(), + }, + }, + + "global_data_tags_old": schema.StringAttribute{ Description: "JSON encoded user-defined data tags to apply to all inputs.", Optional: true, PlanModifiers: []planmodifier.String{ @@ -95,3 +123,7 @@ func getSchema() schema.Schema { }, }} } + +func getGlobalDataTagsAttrType() attr.Type { + return getSchema().Attributes["global_data_tags"].GetType() +} diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 822ad68bd..8099e842b 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body, diags := planModel.toAPIUpdateModel(sVersion) + body, diags := planModel.toAPIUpdateModel(ctx, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { @@ -41,7 +41,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(policy, sVersion) + planModel.populateFromAPI(ctx, policy, sVersion) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From 4d8ec6233074ec1f962514fd7e894166a11f3124 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:43:15 -0500 Subject: [PATCH 29/89] schema --- internal/fleet/agent_policy/schema.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index a16746f49..923e3ba6a 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -92,15 +92,15 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.MapNestedAttribute{ - Description: "user-defined data tags to apply to all inputs. values can be strings (string_value) or numbers (number_value).", + Description: "User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both.", NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "string_value": schema.StringAttribute{ - Description: "Custom label for the field.", + Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, }, "number_value": schema.Float32Attribute{ - Description: "Popularity count for the field.", + Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, }, }, @@ -113,14 +113,6 @@ func getSchema() schema.Schema { mapplanmodifier.RequiresReplace(), }, }, - - "global_data_tags_old": schema.StringAttribute{ - Description: "JSON encoded user-defined data tags to apply to all inputs.", - Optional: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, }} } From a9c8dce269f055535b48160b52562cb91c540104 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:45:05 -0500 Subject: [PATCH 30/89] new docs --- docs/resources/fleet_agent_policy.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index 860d9fc10..a4ff14426 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,7 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (String) JSON encoded user-defined data tags to apply to all inputs. +- `global_data_tags` (Attributes Map) User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. (see [below for nested schema](#nestedatt--global_data_tags)) - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. @@ -53,6 +53,14 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `id` (String) The ID of this resource. + +### Nested Schema for `global_data_tags` + +Optional: + +- `number_value` (Number) Number value for the field. If this is set, string_value must not be defined. +- `string_value` (String) String value for the field. If this is set, number_value must not be defined. + ## Import Import is supported using the following syntax: From fcf226b0928c6fb7e8a0fca38dd9449335882bce Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:49:21 -0500 Subject: [PATCH 31/89] test mod --- internal/fleet/agent_policy/resource_test.go | 31 ++++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 368247587..c49ecc257 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -131,7 +131,8 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1"},{"name":"tag2","value":1.1}]`), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1.string_value", "value1"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2.number_value", "1.1"), ), }, { @@ -144,7 +145,8 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1a"}]`)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1.string_value", "value1a"), + ), }, { SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), @@ -223,16 +225,14 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = true monitor_metrics = false skip_destroy = %t - global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1" - }, - { - name = "tag2" - value = 1.1 + global_data_tags = { + tag1 = { + string_value = "value1" + } + tag2 = { + number_value = 1.1 } - ]) + } } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -256,12 +256,11 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = false monitor_metrics = true skip_destroy = %t - global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1a" + global_data_tags = { + tag1 = { + string_value = "value1a" } - ]) + } } data "elasticstack_fleet_enrollment_tokens" "test_policy" { From 8422d227cb77372557ddf1bf3557c61ca9429e7a Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 16:25:00 -0500 Subject: [PATCH 32/89] novalidate --- internal/fleet/agent_policy/schema.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 923e3ba6a..76d8cde1c 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,9 +3,7 @@ package agent_policy import ( "context" - "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" - "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" @@ -13,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -98,15 +95,21 @@ func getSchema() schema.Schema { "string_value": schema.StringAttribute{ Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, + // Validators: []validator.String{ + // stringvalidator.ExactlyOneOf(path.MatchRelative()), + // }, }, "number_value": schema.Float32Attribute{ Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, + // Validators: []validator.Float32{ + // float32validator.ExactlyOneOf(path.MatchRelative()), + // }, }, }, - Validators: []validator.Object{ - objectvalidator.ExactlyOneOf(path.MatchRoot("string_value"), path.MatchRoot("number_value")), - }, + // Validators: []validator.Object{ + // objectvalidator.ExactlyOneOf(path.MatchRelative().AtAnyMapKey()) + // }, }, Optional: true, PlanModifiers: []planmodifier.Map{ From f9e995eb6cce4728bb822c275b474aa432b96987 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 7 Mar 2025 01:19:21 -0500 Subject: [PATCH 33/89] its alive --- .../resource.tf | 9 ++ internal/fleet/agent_policy/models.go | 131 ++++++++++-------- internal/fleet/agent_policy/resource_test.go | 2 +- internal/fleet/agent_policy/schema.go | 2 +- 4 files changed, 81 insertions(+), 63 deletions(-) diff --git a/examples/resources/elasticstack_fleet_agent_policy/resource.tf b/examples/resources/elasticstack_fleet_agent_policy/resource.tf index 81625d7fc..a6b7befe9 100644 --- a/examples/resources/elasticstack_fleet_agent_policy/resource.tf +++ b/examples/resources/elasticstack_fleet_agent_policy/resource.tf @@ -9,4 +9,13 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { sys_monitoring = true monitor_logs = true monitor_metrics = true + + global_data_tags = { + first_tag = { + string_value = "tag_value" + }, + second_tag = { + number_value = 1.2 + } + } } diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 3081d161d..ab97ff738 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -13,6 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) +type globalDataTagsItemModel struct { + StringValue types.String `tfsdk:"string_value"` + NumberValue types.Float32 `tfsdk:"number_value"` +} + type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -27,7 +32,7 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` - GlobalDataTags types.Map `tfsdk:"global_data_tags"` + GlobalDataTags types.Map `tfsdk:"global_data_tags"` //> globalDataTagsModel } func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { @@ -62,7 +67,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Namespace = types.StringValue(data.Namespace) if utils.Deref(data.GlobalDataTags) != nil { diags := diag.Diagnostics{} - var map0 = make(map[string]any) + var map0 = make(map[string]globalDataTagsItemModel) for _, v := range utils.Deref(data.GlobalDataTags) { maybeFloat, error := v.Value.AsAgentPolicyGlobalDataTagsItemValue1() if error != nil { @@ -70,12 +75,12 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. if error != nil { diags.AddError("Failed to unmarshal global data tags", error.Error()) } - map0[v.Name] = map[string]string{ - "string_value": string(maybeString), + map0[v.Name] = globalDataTagsItemModel{ + StringValue: types.StringValue(maybeString), } } else { - map0[v.Name] = map[string]float32{ - "number_value": float32(maybeFloat), + map0[v.Name] = globalDataTagsItemModel{ + NumberValue: types.Float32Value(float32(maybeFloat)), } } } @@ -118,37 +123,40 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - var items []kbapi.AgentPolicyGlobalDataTagsItem - itemsMap := utils.MapTypeAs[struct { - string_value *string - number_value *float32 - }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, + func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { + // do some checks + if item.StringValue.ValueStringPointer() == nil && item.NumberValue.ValueFloat32Pointer() == nil || item.StringValue.ValueStringPointer() != nil && item.NumberValue.ValueFloat32Pointer() != nil { + diags.AddError("global_data_tags validation_error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if item.StringValue.ValueStringPointer() != nil { + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*item.StringValue.ValueStringPointer()) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*item.NumberValue.ValueFloat32Pointer()) + } + if err != nil { + diags.AddError("global_data_tags validation_error_converting_values", err.Error()) + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + return kbapi.AgentPolicyGlobalDataTagsItem{ + Name: meta.Key, + Value: value, + } + }) + if diags.HasError() { return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - for k, v := range itemsMap { - if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { - diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags - } - var value kbapi.AgentPolicyGlobalDataTagsItem_Value - var err error - if v.string_value != nil { - err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) - } else { - err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) - } - if err != nil { - diags.AddError("global_data_tags ES version error", "could not convert global data tags value") - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags - } - items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ - Name: k, - Value: value, - }) - } - body.GlobalDataTags = &items + itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0, len(items)) + for _, v := range items { + itemsList = append(itemsList, v) + } + body.GlobalDataTags = &itemsList } return body, nil @@ -181,38 +189,39 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - var items []kbapi.AgentPolicyGlobalDataTagsItem - itemsMap := utils.MapTypeAs[struct { - string_value *string - number_value *float32 - }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, + func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { + // do some checks + if item.StringValue.ValueStringPointer() == nil && item.NumberValue.ValueFloat32Pointer() == nil || item.StringValue.ValueStringPointer() != nil && item.NumberValue.ValueFloat32Pointer() != nil { + diags.AddError("global_data_tags validation_error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if item.StringValue.ValueStringPointer() != nil { + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*item.StringValue.ValueStringPointer()) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*item.NumberValue.ValueFloat32Pointer()) + } + if err != nil { + diags.AddError("global_data_tags validation_error_converting_values", err.Error()) + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + return kbapi.AgentPolicyGlobalDataTagsItem{ + Name: meta.Key, + Value: value, + } + }) if diags.HasError() { return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - for k, v := range itemsMap { - if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { - diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags - } - var value kbapi.AgentPolicyGlobalDataTagsItem_Value - var err error - if v.string_value != nil { - // s := *v.string_value - err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) - } else { - err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) - } - if err != nil { - diags.AddError("global_data_tags ES version error", "could not convert global data tags value") - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags - } - items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ - Name: k, - Value: value, - }) - } - body.GlobalDataTags = &items + itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0, len(items)) + for _, v := range items { + itemsList = append(itemsList, v) + } + body.GlobalDataTags = &itemsList } return body, nil diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index c49ecc257..ce334279d 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -228,7 +228,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { global_data_tags = { tag1 = { string_value = "value1" - } + }, tag2 = { number_value = 1.1 } diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 76d8cde1c..fa53d80e5 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -89,7 +89,7 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.MapNestedAttribute{ - Description: "User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both.", + Description: "User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. Example -- key1 = {string_value = value1}, key2 = {number_value = 42}", NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "string_value": schema.StringAttribute{ From e07ece8eb749c687dbf258d7fa287a468ec4663b Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 7 Mar 2025 16:35:10 -0500 Subject: [PATCH 34/89] passing tests --- internal/fleet/agent_policy/models.go | 6 ++++-- internal/fleet/agent_policy/schema.go | 12 +----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index ab97ff738..8d7507e76 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -8,6 +8,7 @@ import ( "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/go-version" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" @@ -84,11 +85,12 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. } } } - gdt := utils.MapValueFrom(ctx, map0, getGlobalDataTagsAttrType(), path.Root("global_data_tags"), &diags) + + model.GlobalDataTags = utils.MapValueFrom(ctx, map0, getGlobalDataTagsAttrTypes().(attr.TypeWithElementType).ElementType(), path.Root("global_data_tags"), &diags) if diags.HasError() { return diags } - model.GlobalDataTags = gdt + } return nil diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index fa53d80e5..20dda0337 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -95,21 +95,12 @@ func getSchema() schema.Schema { "string_value": schema.StringAttribute{ Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, - // Validators: []validator.String{ - // stringvalidator.ExactlyOneOf(path.MatchRelative()), - // }, }, "number_value": schema.Float32Attribute{ Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, - // Validators: []validator.Float32{ - // float32validator.ExactlyOneOf(path.MatchRelative()), - // }, }, }, - // Validators: []validator.Object{ - // objectvalidator.ExactlyOneOf(path.MatchRelative().AtAnyMapKey()) - // }, }, Optional: true, PlanModifiers: []planmodifier.Map{ @@ -118,7 +109,6 @@ func getSchema() schema.Schema { }, }} } - -func getGlobalDataTagsAttrType() attr.Type { +func getGlobalDataTagsAttrTypes() attr.Type { return getSchema().Attributes["global_data_tags"].GetType() } From f2bec332725c861350830be9316998be3b5ae0ce Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 7 Mar 2025 16:35:46 -0500 Subject: [PATCH 35/89] docs --- docs/resources/fleet_agent_policy.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index a4ff14426..0420a8c33 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -24,6 +24,15 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { sys_monitoring = true monitor_logs = true monitor_metrics = true + + global_data_tags = { + first_tag = { + string_value = "tag_value" + }, + second_tag = { + number_value = 1.2 + } + } } ``` @@ -41,7 +50,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (Attributes Map) User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. (see [below for nested schema](#nestedatt--global_data_tags)) +- `global_data_tags` (Attributes Map) User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. Example -- key1 = {string_value = value1}, key2 = {number_value = 42} (see [below for nested schema](#nestedatt--global_data_tags)) - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. From dfaa4168855c08864d487ccf61ad1a95fc908a24 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 13 Feb 2025 22:22:09 +0000 Subject: [PATCH 36/89] devcontainer --- .devcontainer/devcontainer.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..2616ae1d9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + "ghcr.io/devcontainers/features/terraform:1": {} + } +} \ No newline at end of file From 8fd542c8316ebf082a2af0ab528fd9f086bd3662 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 18:22:07 +0000 Subject: [PATCH 37/89] schema and model to support global data tags --- internal/fleet/agent_policy/create.go | 4 +- internal/fleet/agent_policy/models.go | 55 ++++++++- internal/fleet/agent_policy/read.go | 2 +- internal/fleet/agent_policy/schema.go | 161 +++++++++++++++----------- internal/fleet/agent_policy/update.go | 4 +- 5 files changed, 151 insertions(+), 75 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 86e4a9d25..3cc917dc0 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -22,7 +22,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body := planModel.toAPICreateModel() + body := planModel.toAPICreateModel(ctx) sysMonitoring := planModel.SysMonitoring.ValueBool() policy, diags := fleet.CreateAgentPolicy(ctx, client, body, sysMonitoring) @@ -31,7 +31,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - planModel.populateFromAPI(policy) + planModel.populateFromAPI(ctx, policy) resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 0f06dce37..6a604382e 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -1,13 +1,39 @@ package agent_policy import ( + "context" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" ) +type globalDataTagModel struct { + Name types.String `tfsdk:"name"` + Value types.String `tfsdk:"value"` +} + +func newGlobalDataTagModel(data struct { + Name string "json:\"name\"" + Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" +}, meta utils.ListMeta) globalDataTagModel { + val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() + if err != nil { + panic(err) + } + return globalDataTagModel{ + Name: types.StringValue(data.Name), + Value: types.StringValue(val), + } +} + +var minVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) + type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -22,9 +48,10 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` + GlobalDataTags types.List `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy) { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy) (diags diag.Diagnostics) { if data == nil { return } @@ -54,10 +81,19 @@ func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy) { model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) + if *data.GlobalDataTags != nil { + model.GlobalDataTags = utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diags, newGlobalDataTagModel) + } + return } -func (model agentPolicyModel) toAPICreateModel() kbapi.PostFleetAgentPoliciesJSONRequestBody { +func (model agentPolicyModel) toAPICreateModel(ctx context.Context) kbapi.PostFleetAgentPoliciesJSONRequestBody { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) + tags := make([]struct { + Name string `json:"name"` + Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` + }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) + if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabledLogs) } @@ -77,10 +113,14 @@ func (model agentPolicyModel) toAPICreateModel() kbapi.PostFleetAgentPoliciesJSO Namespace: model.Namespace.ValueString(), } + if len(tags) > 0 { + body.GlobalDataTags = &tags + } + return body } -func (model agentPolicyModel) toAPIUpdateModel() kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody { +func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -89,6 +129,11 @@ func (model agentPolicyModel) toAPIUpdateModel() kbapi.PutFleetAgentPoliciesAgen monitoring = append(monitoring, kbapi.Metrics) } + tags := make([]struct { + Name string `json:"name"` + Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` + }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) + body := kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), @@ -100,5 +145,9 @@ func (model agentPolicyModel) toAPIUpdateModel() kbapi.PutFleetAgentPoliciesAgen Namespace: model.Namespace.ValueString(), } + if len(tags) > 0 { + body.GlobalDataTags = &tags + } + return body } diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index 7d6714c13..c28725654 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -34,7 +34,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - stateModel.populateFromAPI(policy) + stateModel.populateFromAPI(ctx, policy) resp.State.Set(ctx, stateModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 7b0e4507d..92b402e17 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,6 +3,7 @@ package agent_policy import ( "context" + "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" @@ -12,74 +13,100 @@ import ( ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema.Description = "Creates a new Fleet Agent Policy. See https://www.elastic.co/guide/en/fleet/current/agent-policy.html" - resp.Schema.Attributes = map[string]schema.Attribute{ - "id": schema.StringAttribute{ - Description: "The ID of this resource.", - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), + resp.Schema = getSchema() +} + +func getSchema() schema.Schema { + return schema.Schema{ + Description: "Creates a new Fleet Agent Policy. See https://www.elastic.co/guide/en/fleet/current/agent-policy.html", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "The ID of this resource.", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "policy_id": schema.StringAttribute{ + Description: "Unique identifier of the agent policy.", + Computed: true, + Optional: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + stringplanmodifier.RequiresReplace(), + }, + }, + "name": schema.StringAttribute{ + Description: "The name of the agent policy.", + Required: true, + }, + "namespace": schema.StringAttribute{ + Description: "The namespace of the agent policy.", + Required: true, + }, + "description": schema.StringAttribute{ + Description: "The description of the agent policy.", + Optional: true, + }, + "data_output_id": schema.StringAttribute{ + Description: "The identifier for the data output.", + Optional: true, + }, + "monitoring_output_id": schema.StringAttribute{ + Description: "The identifier for monitoring output.", + Optional: true, }, - }, - "policy_id": schema.StringAttribute{ - Description: "Unique identifier of the agent policy.", - Computed: true, - Optional: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - stringplanmodifier.RequiresReplace(), + "fleet_server_host_id": schema.StringAttribute{ + Description: "The identifier for the Fleet server host.", + Optional: true, }, - }, - "name": schema.StringAttribute{ - Description: "The name of the agent policy.", - Required: true, - }, - "namespace": schema.StringAttribute{ - Description: "The namespace of the agent policy.", - Required: true, - }, - "description": schema.StringAttribute{ - Description: "The description of the agent policy.", - Optional: true, - }, - "data_output_id": schema.StringAttribute{ - Description: "The identifier for the data output.", - Optional: true, - }, - "monitoring_output_id": schema.StringAttribute{ - Description: "The identifier for monitoring output.", - Optional: true, - }, - "fleet_server_host_id": schema.StringAttribute{ - Description: "The identifier for the Fleet server host.", - Optional: true, - }, - "download_source_id": schema.StringAttribute{ - Description: "The identifier for the Elastic Agent binary download server.", - Optional: true, - }, - "monitor_logs": schema.BoolAttribute{ - Description: "Enable collection of agent logs.", - Computed: true, - Optional: true, - Default: booldefault.StaticBool(false), - }, - "monitor_metrics": schema.BoolAttribute{ - Description: "Enable collection of agent metrics.", - Computed: true, - Optional: true, - Default: booldefault.StaticBool(false), - }, - "skip_destroy": schema.BoolAttribute{ - Description: "Set to true if you do not wish the agent policy to be deleted at destroy time, and instead just remove the agent policy from the Terraform state.", - Optional: true, - }, - "sys_monitoring": schema.BoolAttribute{ - Description: "Enable collection of system logs and metrics.", - Optional: true, - PlanModifiers: []planmodifier.Bool{ - boolplanmodifier.RequiresReplace(), + "download_source_id": schema.StringAttribute{ + Description: "The identifier for the Elastic Agent binary download server.", + Optional: true, }, - }, - } + "monitor_logs": schema.BoolAttribute{ + Description: "Enable collection of agent logs.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(false), + }, + "monitor_metrics": schema.BoolAttribute{ + Description: "Enable collection of agent metrics.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(false), + }, + "skip_destroy": schema.BoolAttribute{ + Description: "Set to true if you do not wish the agent policy to be deleted at destroy time, and instead just remove the agent policy from the Terraform state.", + Optional: true, + }, + "sys_monitoring": schema.BoolAttribute{ + Description: "Enable collection of system logs and metrics.", + Optional: true, + PlanModifiers: []planmodifier.Bool{ + boolplanmodifier.RequiresReplace(), + }, + }, + "global_data_tags": schema.ListNestedAttribute{ + Description: "User defined data tags to apply to all inputs. Values can be strings, or numbers", + Optional: true, + + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "The name of the data tag.", + Required: true, + }, + "value": schema.StringAttribute{ + Description: "The value of the data tag.", + Required: true, + }, + }, + }, + }, + }} +} + +func getGlobalDataTagsType() attr.Type { + return getSchema().Attributes["global_data_tags"].GetType().(attr.TypeWithElementType).ElementType() } diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 68313eeee..e7785c74b 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -22,7 +22,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body := planModel.toAPIUpdateModel() + body := planModel.toAPIUpdateModel(ctx) policyID := planModel.PolicyID.ValueString() policy, diags := fleet.UpdateAgentPolicy(ctx, client, policyID, body) @@ -31,7 +31,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(policy) + planModel.populateFromAPI(ctx, policy) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From 7f8790f2b26f3532fc759411885622110526db71 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 20:47:07 +0000 Subject: [PATCH 38/89] minimum version --- internal/fleet/agent_policy/create.go | 11 ++++++- internal/fleet/agent_policy/models.go | 43 +++++++++++++++---------- internal/fleet/agent_policy/resource.go | 3 ++ internal/fleet/agent_policy/update.go | 12 ++++++- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 3cc917dc0..1aeb7eb78 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -22,7 +22,16 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body := planModel.toAPICreateModel(ctx) + sVersion, e := r.client.ServerVersion(ctx) + if e != nil { + return + } + + body, diags := planModel.toAPICreateModel(ctx, sVersion) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } sysMonitoring := planModel.SysMonitoring.ValueBool() policy, diags := fleet.CreateAgentPolicy(ctx, client, body, sysMonitoring) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 6a604382e..11a138e87 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -87,12 +87,8 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. return } -func (model agentPolicyModel) toAPICreateModel(ctx context.Context) kbapi.PostFleetAgentPoliciesJSONRequestBody { +func (model agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) - tags := make([]struct { - Name string `json:"name"` - Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` - }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabledLogs) @@ -113,14 +109,23 @@ func (model agentPolicyModel) toAPICreateModel(ctx context.Context) kbapi.PostFl Namespace: model.Namespace.ValueString(), } - if len(tags) > 0 { - body.GlobalDataTags = &tags + if len(model.GlobalDataTags.Elements()) > 0 { + if serverVersion.LessThan(MinVersionGlobalDataTags) { + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diag.Diagnostics{ + diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), + } + + } + diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) + if diags.HasError() { + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags + } } - return body + return body, nil } -func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody { +func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -129,11 +134,6 @@ func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFle monitoring = append(monitoring, kbapi.Metrics) } - tags := make([]struct { - Name string `json:"name"` - Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` - }, 0, len(model.GlobalDataTags.ElementsAs(ctx, getGlobalDataTagsType, false))) - body := kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), @@ -145,9 +145,18 @@ func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context) kbapi.PutFle Namespace: model.Namespace.ValueString(), } - if len(tags) > 0 { - body.GlobalDataTags = &tags + if len(model.GlobalDataTags.Elements()) > 0 { + if serverVersion.LessThan(MinVersionGlobalDataTags) { + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diag.Diagnostics{ + diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), + } + + } + diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) + if diags.HasError() { + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags + } } - return body + return body, nil } diff --git a/internal/fleet/agent_policy/resource.go b/internal/fleet/agent_policy/resource.go index 5d0628d33..917bec042 100644 --- a/internal/fleet/agent_policy/resource.go +++ b/internal/fleet/agent_policy/resource.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/elastic/terraform-provider-elasticstack/internal/clients" + "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -15,6 +16,8 @@ var ( _ resource.ResourceWithImportState = &agentPolicyResource{} ) +var MinVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) + // NewResource is a helper function to simplify the provider implementation. func NewResource() resource.Resource { return &agentPolicyResource{} diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index e7785c74b..504d3a4aa 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -22,7 +22,17 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body := planModel.toAPIUpdateModel(ctx) + sVersion, e := r.client.ServerVersion(ctx) + if e != nil { + return + } + + body, diags := planModel.toAPIUpdateModel(ctx, sVersion) + + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } policyID := planModel.PolicyID.ValueString() policy, diags := fleet.UpdateAgentPolicy(ctx, client, policyID, body) From d75bfd8b9f0a17a7dbc14eff4eeb3309a541fdc6 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 21:10:39 +0000 Subject: [PATCH 39/89] tests --- internal/fleet/agent_policy/resource_test.go | 123 +++++++++++++++++++ internal/fleet/agent_policy/update.go | 2 +- 2 files changed, 124 insertions(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index cd0d41d1f..0ba6cdedc 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -18,6 +18,7 @@ import ( ) var minVersionAgentPolicy = version.Must(version.NewVersion("8.6.0")) +var minVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) func TestAccResourceAgentPolicyFromSDK(t *testing.T) { policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) @@ -63,6 +64,8 @@ func TestAccResourceAgentPolicyFromSDK(t *testing.T) { func TestAccResourceAgentPolicy(t *testing.T) { policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) + policyNameGlobalDataTags := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) + var originalPolicyId string resource.Test(t, resource.TestCase{ @@ -118,6 +121,51 @@ func TestAccResourceAgentPolicy(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"skip_destroy"}, }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyCreateWithGlobalDataTags(policyNameGlobalDataTags, false), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "name", fmt.Sprintf("Policy %s", policyNameGlobalDataTags)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "namespace", "default"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "description", "Test Agent Policy"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "true"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3", "value3"), + ), + }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyUpdateWithGlobalDataTags(policyNameGlobalDataTags, false), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "name", fmt.Sprintf("Updated Policy %s", policyNameGlobalDataTags)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "namespace", "default"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "description", "This policy was updated"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1a"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2b"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), + ), + }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyUpdateWithNoGlobalDataTags(policyNameGlobalDataTags, false), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "name", fmt.Sprintf("Updated Policy %s", policyNameGlobalDataTags)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "namespace", "default"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "description", "This policy was updated without global data tags"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), + ), + }, }, }) } @@ -168,6 +216,81 @@ data "elasticstack_fleet_enrollment_tokens" "test_policy" { `, fmt.Sprintf("Policy %s", id), skipDestroy) } +func testAccResourceAgentPolicyCreateWithGlobalDataTags(id string, skipDestroy bool) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_fleet_agent_policy" "test_policy" { + name = "%s" + namespace = "default" + description = "Test Agent Policy" + monitor_logs = true + monitor_metrics = false + skip_destroy = %t + global_data_tags = { + tag1 = "value1" + tag2 = "value2" + tag3 = "value3" + } +} + +data "elasticstack_fleet_enrollment_tokens" "test_policy" { + policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id +} + +`, fmt.Sprintf("Policy %s", id), skipDestroy) +} + +func testAccResourceAgentPolicyUpdateWithGlobalDataTags(id string, skipDestroy bool) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_fleet_agent_policy" "test_policy" { + name = "%s" + namespace = "default" + description = "This policy was updated" + monitor_logs = false + monitor_metrics = true + skip_destroy = %t + global_data_tags = { + tag1 = "value1a" + tag2 = "value2b" + } +} + +data "elasticstack_fleet_enrollment_tokens" "test_policy" { + policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id +} +`, fmt.Sprintf("Updated Policy %s", id), skipDestroy) +} + +func testAccResourceAgentPolicyUpdateWithNoGlobalDataTags(id string, skipDestroy bool) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_fleet_agent_policy" "test_policy" { + name = "%s" + namespace = "default" + description = "This policy was updated without global data tags" + monitor_logs = false + monitor_metrics = true + skip_destroy = %t +} + +data "elasticstack_fleet_enrollment_tokens" "test_policy" { + policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id +} +`, fmt.Sprintf("Updated Policy %s", id), skipDestroy) +} func testAccResourceAgentPolicyUpdate(id string, skipDestroy bool) string { return fmt.Sprintf(` diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 504d3a4aa..2bdac21e8 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -28,7 +28,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq } body, diags := planModel.toAPIUpdateModel(ctx, sVersion) - + resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return From 506c2841e3dac6f940e9b5763961f8da56a1f338 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Tue, 18 Feb 2025 22:05:06 +0000 Subject: [PATCH 40/89] test cleanup --- internal/fleet/agent_policy/create.go | 2 +- internal/fleet/agent_policy/models.go | 17 ++++++++++------- internal/fleet/agent_policy/read.go | 7 ++++++- internal/fleet/agent_policy/update.go | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 1aeb7eb78..e797b9688 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -40,7 +40,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - planModel.populateFromAPI(ctx, policy) + planModel.populateFromAPI(ctx, policy, sVersion) resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 11a138e87..254d5ce89 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -32,8 +32,6 @@ func newGlobalDataTagModel(data struct { } } -var minVersionGlobalDataTags = version.Must(version.NewVersion("8.15.0")) - type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -51,7 +49,7 @@ type agentPolicyModel struct { GlobalDataTags types.List `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy) (diags diag.Diagnostics) { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) { if data == nil { return } @@ -81,13 +79,18 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if *data.GlobalDataTags != nil { - model.GlobalDataTags = utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diags, newGlobalDataTagModel) + if *data.GlobalDataTags != nil && serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) { + var diag diag.Diagnostics + gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) + if diag.HasError() { + return + } + model.GlobalDataTags = gdt } return } -func (model agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { @@ -125,7 +128,7 @@ func (model agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersio return body, nil } -func (model agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index c28725654..c52c903bc 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -22,6 +22,11 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } + sVersion, e := r.client.ServerVersion(ctx) + if e != nil { + return + } + policyID := stateModel.PolicyID.ValueString() policy, diags := fleet.GetAgentPolicy(ctx, client, policyID) resp.Diagnostics.Append(diags...) @@ -34,7 +39,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - stateModel.populateFromAPI(ctx, policy) + stateModel.populateFromAPI(ctx, policy, sVersion) resp.State.Set(ctx, stateModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 2bdac21e8..8099e842b 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -41,7 +41,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(ctx, policy) + planModel.populateFromAPI(ctx, policy, sVersion) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From c0b8f7ba566cb4c7fb29f5de5a4b86efc85ff8b0 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 04:47:25 +0000 Subject: [PATCH 41/89] lint --- internal/fleet/agent_policy/models.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 254d5ce89..55bc8ad52 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -87,7 +87,6 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. } model.GlobalDataTags = gdt } - return } func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { From 7b5a8c8b52cc7bf6cb7d7c39cc6999f36194ca94 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 05:10:50 +0000 Subject: [PATCH 42/89] schema description --- internal/fleet/agent_policy/schema.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 92b402e17..8c7c62cee 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -88,7 +88,7 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.ListNestedAttribute{ - Description: "User defined data tags to apply to all inputs. Values can be strings, or numbers", + Description: "User defined data tags to apply to all inputs.", Optional: true, NestedObject: schema.NestedAttributeObject{ @@ -98,7 +98,7 @@ func getSchema() schema.Schema { Required: true, }, "value": schema.StringAttribute{ - Description: "The value of the data tag.", + Description: "The string value of the data tag.", Required: true, }, }, From 6116783706a68155dd760a7cb0d0c6ed93afa5df Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 05:11:16 +0000 Subject: [PATCH 43/89] docs --- docs/resources/fleet_agent_policy.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index 431593ceb..92025f637 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,6 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. +- `global_data_tags` (Attributes List) User defined data tags to apply to all inputs. (see [below for nested schema](#nestedatt--global_data_tags)) - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. @@ -52,6 +53,14 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `id` (String) The ID of this resource. + +### Nested Schema for `global_data_tags` + +Required: + +- `name` (String) The name of the data tag. +- `value` (String) The string value of the data tag. + ## Import Import is supported using the following syntax: From 4822826f393ce1ff088d5d0845a7f1c74d3277e8 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:08:28 +0000 Subject: [PATCH 44/89] if datatags is nil --- internal/fleet/agent_policy/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 55bc8ad52..0c85a0ee2 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -79,7 +79,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if *data.GlobalDataTags != nil && serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) { + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && data.GlobalDataTags != nil { var diag diag.Diagnostics gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) if diag.HasError() { From aea89cef8de5d35550f54258dcbdc1d15388136f Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:13:07 +0000 Subject: [PATCH 45/89] len not nil --- internal/fleet/agent_policy/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 0c85a0ee2..6511beabb 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -79,7 +79,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && data.GlobalDataTags != nil { + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && len(*data.GlobalDataTags) > 0 { var diag diag.Diagnostics gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) if diag.HasError() { From 008ce7054880da1eba91056dbdc8ffe75af893fe Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:26:43 +0000 Subject: [PATCH 46/89] reflect instead --- internal/fleet/agent_policy/models.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 6511beabb..59dbce08c 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -2,6 +2,7 @@ package agent_policy import ( "context" + "reflect" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -32,6 +33,18 @@ func newGlobalDataTagModel(data struct { } } +func hasKey(s interface{}, key string) bool { + val := reflect.ValueOf(s) + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + if val.Kind() != reflect.Struct { + return false + } + field := val.FieldByName(key) + return field.IsValid() +} + type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -79,7 +92,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && len(*data.GlobalDataTags) > 0 { + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && hasKey(data, "GlobalDataTags") { var diag diag.Diagnostics gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) if diag.HasError() { From a2a36745e528d7741a7c99653956bb6b134fb775 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 16:52:52 +0000 Subject: [PATCH 47/89] ehh --- internal/fleet/agent_policy/models.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 59dbce08c..e37fa09b9 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -22,7 +21,7 @@ type globalDataTagModel struct { func newGlobalDataTagModel(data struct { Name string "json:\"name\"" Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" -}, meta utils.ListMeta) globalDataTagModel { +}) globalDataTagModel { val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() if err != nil { panic(err) @@ -94,11 +93,18 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Namespace = types.StringValue(data.Namespace) if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && hasKey(data, "GlobalDataTags") { var diag diag.Diagnostics - gdt := utils.SliceToListType(ctx, *data.GlobalDataTags, getGlobalDataTagsType(), path.Root("global_data_tags"), &diag, newGlobalDataTagModel) + gdt := []globalDataTagModel{} + for _, val := range *data.GlobalDataTags { + gdt = append(gdt, newGlobalDataTagModel(val)) + } + gdtList, diags := types.ListValueFrom(ctx, getGlobalDataTagsType(), gdt) + if diags.HasError() { + return + } + model.GlobalDataTags = gdtList if diag.HasError() { return } - model.GlobalDataTags = gdt } } From fa76d5b79ec3ce83368568dd8e6c05a297c33844 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 17:16:28 +0000 Subject: [PATCH 48/89] deref --- internal/fleet/agent_policy/models.go | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index e37fa09b9..b553735eb 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -2,7 +2,6 @@ package agent_policy import ( "context" - "reflect" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -32,18 +31,6 @@ func newGlobalDataTagModel(data struct { } } -func hasKey(s interface{}, key string) bool { - val := reflect.ValueOf(s) - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - if val.Kind() != reflect.Struct { - return false - } - field := val.FieldByName(key) - return field.IsValid() -} - type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -91,10 +78,10 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && hasKey(data, "GlobalDataTags") { - var diag diag.Diagnostics + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { + gdt := []globalDataTagModel{} - for _, val := range *data.GlobalDataTags { + for _, val := range utils.Deref(data.GlobalDataTags) { gdt = append(gdt, newGlobalDataTagModel(val)) } gdtList, diags := types.ListValueFrom(ctx, getGlobalDataTagsType(), gdt) @@ -102,9 +89,6 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. return } model.GlobalDataTags = gdtList - if diag.HasError() { - return - } } } From 3e79fa04dd5dc1115e69e20d1dd3c96351f96ee0 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 17:35:47 +0000 Subject: [PATCH 49/89] test mod --- internal/fleet/agent_policy/resource_test.go | 32 ++++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 0ba6cdedc..450725b2b 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -147,7 +147,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1a"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2b"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2a"), resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), ), }, @@ -230,11 +230,18 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = true monitor_metrics = false skip_destroy = %t - global_data_tags = { - tag1 = "value1" - tag2 = "value2" - tag3 = "value3" - } + global_data_tags = [ + { + name = "tag1" + value = "value1" + },{ + name = "tag2" + value = "value2" + },{ + name = "tag3" + value = "value3" + } + ] } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -258,10 +265,15 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = false monitor_metrics = true skip_destroy = %t - global_data_tags = { - tag1 = "value1a" - tag2 = "value2b" - } + global_data_tags = [ + { + name = "tag1" + value = "value1a" + },{ + name = "tag2" + value = "value2a" + } + ] } data "elasticstack_fleet_enrollment_tokens" "test_policy" { From 178416aa607c756274ddd1ea5b913e0c55d10e68 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 13:12:22 -0500 Subject: [PATCH 50/89] temp dev --- .devcontainer/devcontainer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2616ae1d9..950a94b8d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { - "image": "mcr.microsoft.com/devcontainers/universal:2", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/terraform:1": {} } -} \ No newline at end of file +} From c487f130dd39f9d2e70e1d9cf3356c2a56fd3ec1 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 13:14:33 -0500 Subject: [PATCH 51/89] temp dev2 --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 950a94b8d..cb3325196 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "image": "mcr.microsoft.com/devcontainers/go", "features": { "ghcr.io/devcontainers/features/terraform:1": {} } From 35b3f6145793396ca280470e846905d9f938fe50 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 19 Feb 2025 13:48:33 -0500 Subject: [PATCH 52/89] temp dev 3 --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cb3325196..12198c044 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,7 @@ { "image": "mcr.microsoft.com/devcontainers/go", "features": { - "ghcr.io/devcontainers/features/terraform:1": {} + "ghcr.io/devcontainers/features/terraform:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": {} } } From 42894521d59382abdbae34c840f4a59990fed865 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 16:38:16 -0500 Subject: [PATCH 53/89] to jsonencode --- .devcontainer/devcontainer.json | 7 -- internal/fleet/agent_policy/create.go | 6 +- internal/fleet/agent_policy/models.go | 94 ++++++++++---------- internal/fleet/agent_policy/read.go | 6 +- internal/fleet/agent_policy/resource_test.go | 8 +- internal/fleet/agent_policy/schema.go | 22 +---- 6 files changed, 65 insertions(+), 78 deletions(-) delete mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 12198c044..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "image": "mcr.microsoft.com/devcontainers/go", - "features": { - "ghcr.io/devcontainers/features/terraform:1": {}, - "ghcr.io/devcontainers/features/docker-in-docker:2": {} - } -} diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index e797b9688..ea4420777 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -40,7 +40,11 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - planModel.populateFromAPI(ctx, policy, sVersion) + diags = planModel.populateFromAPI(ctx, policy, sVersion) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index b553735eb..10014417e 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -2,6 +2,7 @@ package agent_policy import ( "context" + "encoding/json" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -12,24 +13,24 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -type globalDataTagModel struct { - Name types.String `tfsdk:"name"` - Value types.String `tfsdk:"value"` -} - -func newGlobalDataTagModel(data struct { - Name string "json:\"name\"" - Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" -}) globalDataTagModel { - val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() - if err != nil { - panic(err) - } - return globalDataTagModel{ - Name: types.StringValue(data.Name), - Value: types.StringValue(val), - } -} +// type globalDataTagModel struct { +// Name types.String `tfsdk:"name"` +// Value types.String `tfsdk:"value"` +// } + +// func newGlobalDataTagModel(data struct { +// Name string "json:\"name\"" +// Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" +// }) globalDataTagModel { +// val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() +// if err != nil { +// panic(err) +// } +// return globalDataTagModel{ +// Name: types.StringValue(data.Name), +// Value: types.StringValue(val), +// } +// } type agentPolicyModel struct { ID types.String `tfsdk:"id"` @@ -45,12 +46,12 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` - GlobalDataTags types.List `tfsdk:"global_data_tags"` + GlobalDataTags types.String `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { if data == nil { - return + return nil } model.ID = types.StringValue(data.Id) @@ -79,17 +80,16 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { - - gdt := []globalDataTagModel{} - for _, val := range utils.Deref(data.GlobalDataTags) { - gdt = append(gdt, newGlobalDataTagModel(val)) + diags := diag.Diagnostics{} + d, err := json.Marshal(data.GlobalDataTags) + if err != nil { + diags.AddError("Failed to marshal global data tags", err.Error()) + return diags } - gdtList, diags := types.ListValueFrom(ctx, getGlobalDataTagsType(), gdt) - if diags.HasError() { - return - } - model.GlobalDataTags = gdtList + model.GlobalDataTags = types.StringValue(string(d)) } + + return nil } func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { @@ -114,19 +114,20 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.Elements()) > 0 { + if len(model.GlobalDataTags.ValueString()) > 0 { + var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diag.Diagnostics{ - diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), - } - + diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) - if diags.HasError() { + + str := model.GlobalDataTags.ValueString() + err := json.Unmarshal([]byte(str), body.GlobalDataTags) + if err != nil { + diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } } - return body, nil } @@ -150,17 +151,20 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.Elements()) > 0 { + if len(model.GlobalDataTags.ValueString()) > 0 { + var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diag.Diagnostics{ - diag.NewErrorDiagnostic("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above"), - } - + diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - diags := model.GlobalDataTags.ElementsAs(ctx, body.GlobalDataTags, false) - if diags.HasError() { + + str := model.GlobalDataTags.ValueString() + err := json.Unmarshal([]byte(str), body.GlobalDataTags) + if err != nil { + diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } + } return body, nil diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index c52c903bc..34916f0bd 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -39,7 +39,11 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - stateModel.populateFromAPI(ctx, policy, sVersion) + diags = stateModel.populateFromAPI(ctx, policy, sVersion) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } resp.State.Set(ctx, stateModel) resp.Diagnostics.Append(diags...) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 450725b2b..51b5c7258 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -230,7 +230,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = true monitor_metrics = false skip_destroy = %t - global_data_tags = [ + global_data_tags = jsonencode([ { name = "tag1" value = "value1" @@ -241,7 +241,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { name = "tag3" value = "value3" } - ] + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -265,7 +265,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = false monitor_metrics = true skip_destroy = %t - global_data_tags = [ + global_data_tags = jsonencode([ { name = "tag1" value = "value1a" @@ -273,7 +273,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { name = "tag2" value = "value2a" } - ] + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 8c7c62cee..bebd16a9c 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,7 +3,6 @@ package agent_policy import ( "context" - "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" @@ -87,26 +86,9 @@ func getSchema() schema.Schema { boolplanmodifier.RequiresReplace(), }, }, - "global_data_tags": schema.ListNestedAttribute{ - Description: "User defined data tags to apply to all inputs.", + "global_data_tags": schema.StringAttribute{ + Description: "JSON encoded defined data tags to apply to all inputs.", Optional: true, - - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "name": schema.StringAttribute{ - Description: "The name of the data tag.", - Required: true, - }, - "value": schema.StringAttribute{ - Description: "The string value of the data tag.", - Required: true, - }, - }, - }, }, }} } - -func getGlobalDataTagsType() attr.Type { - return getSchema().Attributes["global_data_tags"].GetType().(attr.TypeWithElementType).ElementType() -} From fe4320aec3addb082a92465e69387b184f205d2d Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 16:41:25 -0500 Subject: [PATCH 54/89] docs --- docs/resources/fleet_agent_policy.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index 92025f637..ec223b928 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,7 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (Attributes List) User defined data tags to apply to all inputs. (see [below for nested schema](#nestedatt--global_data_tags)) +- `global_data_tags` (String) JSON encoded defined data tags to apply to all inputs. - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. @@ -53,14 +53,6 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `id` (String) The ID of this resource. - -### Nested Schema for `global_data_tags` - -Required: - -- `name` (String) The name of the data tag. -- `value` (String) The string value of the data tag. - ## Import Import is supported using the following syntax: From 3348ea6e60f7619d4d7d808ff61d9742a26bc2c0 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 16:53:47 -0500 Subject: [PATCH 55/89] pointers --- internal/fleet/agent_policy/models.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 10014417e..58796faef 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -121,8 +121,8 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueString() - err := json.Unmarshal([]byte(str), body.GlobalDataTags) + str := model.GlobalDataTags.ValueStringPointer() + err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) if err != nil { diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags @@ -158,8 +158,8 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueString() - err := json.Unmarshal([]byte(str), body.GlobalDataTags) + str := model.GlobalDataTags.ValueStringPointer() + err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) if err != nil { diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags From 3a8c668978ce01736c48de2fe715281271e28fbf Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Mon, 3 Mar 2025 19:26:17 -0500 Subject: [PATCH 56/89] maybe json --- internal/fleet/agent_policy/models.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 58796faef..4c1250ba8 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -122,11 +122,17 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi } str := model.GlobalDataTags.ValueStringPointer() - err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) + var items []struct { + Name string `json:"name"` + Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` + } + + err := json.Unmarshal([]byte(utils.Deref(str)), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } + *body.GlobalDataTags = items } return body, nil } @@ -157,14 +163,17 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueStringPointer() - err := json.Unmarshal([]byte(*str), &body.GlobalDataTags) + var items []struct { + Name string `json:"name"` + Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` + } + err := json.Unmarshal([]byte(utils.Deref(str)), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - + *body.GlobalDataTags = items } return body, nil From b6697b35734c01df3e803c97e330cd5b5f8c6ca9 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 18:09:00 -0500 Subject: [PATCH 57/89] 8.17.3 generate with new transform to combine global_data_tags schemas --- generated/kbapi/kibana.gen.go | 1186 ++++++++++++++++++++++----- generated/kbapi/transform_schema.go | 20 + 2 files changed, 1001 insertions(+), 205 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index 93472041d..a2ea9c046 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -39,11 +39,11 @@ const ( AgentPolicyMonitoringEnabledTraces AgentPolicyMonitoringEnabled = "traces" ) -// Defines values for AgentPolicyPackagePolicies1InputsStreamsRelease. +// Defines values for AgentPolicyPackagePolicies1Inputs0StreamsRelease. const ( - AgentPolicyPackagePolicies1InputsStreamsReleaseBeta AgentPolicyPackagePolicies1InputsStreamsRelease = "beta" - AgentPolicyPackagePolicies1InputsStreamsReleaseExperimental AgentPolicyPackagePolicies1InputsStreamsRelease = "experimental" - AgentPolicyPackagePolicies1InputsStreamsReleaseGa AgentPolicyPackagePolicies1InputsStreamsRelease = "ga" + AgentPolicyPackagePolicies1Inputs0StreamsReleaseBeta AgentPolicyPackagePolicies1Inputs0StreamsRelease = "beta" + AgentPolicyPackagePolicies1Inputs0StreamsReleaseExperimental AgentPolicyPackagePolicies1Inputs0StreamsRelease = "experimental" + AgentPolicyPackagePolicies1Inputs0StreamsReleaseGa AgentPolicyPackagePolicies1Inputs0StreamsRelease = "ga" ) // Defines values for AgentPolicyStatus. @@ -795,16 +795,28 @@ type DataViewsUpdateDataViewRequestObjectInner struct { // 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"` + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` + AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` + AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` Name string `json:"name"` } `json:"agent_features,omitempty"` + Agentless *struct { + Resources *struct { + Requests *struct { + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` + } `json:"requests,omitempty"` + } `json:"resources,omitempty"` + } `json:"agentless,omitempty"` Agents *float32 `json:"agents,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` @@ -812,17 +824,14 @@ type AgentPolicy struct { 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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -845,7 +854,7 @@ type AgentPolicy struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -855,12 +864,19 @@ type AgentPolicy struct { 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"` + Overrides *map[string]interface{} `json:"overrides"` + PackagePolicies *AgentPolicy_PackagePolicies `json:"package_policies,omitempty"` + RequiredVersions *[]struct { + // Percentage Target percentage of agents to auto upgrade + Percentage float32 `json:"percentage"` + + // Version Target version for automatic agent upgrade + Version string `json:"version"` + } `json:"required_versions"` + 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"` @@ -871,17 +887,6 @@ type AgentPolicy struct { 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 @@ -890,69 +895,17 @@ 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"` + 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 *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"` + Inputs AgentPolicy_PackagePolicies_1_Inputs `json:"inputs"` + IsManaged *bool `json:"is_managed,omitempty"` // Name Package policy name (should be unique) Name string `json:"name"` @@ -993,16 +946,14 @@ type AgentPolicyPackagePolicies1 = []struct { SecretReferences *[]struct { Id string `json:"id"` } `json:"secret_references,omitempty"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` + SpaceIds *[]string `json:"spaceIds,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"` - Version *string `json:"version,omitempty"` + // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. + SupportsAgentless *bool `json:"supports_agentless"` + UpdatedAt string `json:"updated_at"` + UpdatedBy string `json:"updated_by"` + Vars *AgentPolicy_PackagePolicies_1_Vars `json:"vars,omitempty"` + Version *string `json:"version,omitempty"` } // AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges defines model for AgentPolicy.PackagePolicies.1.Elasticsearch.Privileges. @@ -1017,8 +968,180 @@ type AgentPolicy_PackagePolicies_1_Elasticsearch struct { AdditionalProperties map[string]interface{} `json:"-"` } -// AgentPolicyPackagePolicies1InputsStreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.Streams.Release. -type AgentPolicyPackagePolicies1InputsStreamsRelease string +// AgentPolicyPackagePolicies1Inputs0 defines model for . +type AgentPolicyPackagePolicies1Inputs0 = []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 *AgentPolicyPackagePolicies1Inputs0StreamsRelease `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"` +} + +// AgentPolicyPackagePolicies1Inputs0StreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.0.Streams.Release. +type AgentPolicyPackagePolicies1Inputs0StreamsRelease string + +// AgentPolicyPackagePolicies1Inputs1 Package policy inputs (see integration documentation to know what inputs are available) +type AgentPolicyPackagePolicies1Inputs1 map[string]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]struct { + // Enabled enable or disable that stream, (default to true) + Enabled *bool `json:"enabled,omitempty"` + + // Vars Input/stream level variable (see integration documentation for more information) + Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties `json:"vars,omitempty"` + } `json:"streams,omitempty"` + + // Vars Input/stream level variable (see integration documentation for more information) + Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties `json:"vars,omitempty"` +} + +// AgentPolicyPackagePolicies1Inputs1StreamsVars0 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars0 = bool + +// AgentPolicyPackagePolicies1Inputs1StreamsVars1 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars1 = string + +// AgentPolicyPackagePolicies1Inputs1StreamsVars2 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars2 = float32 + +// AgentPolicyPackagePolicies1Inputs1StreamsVars3 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars3 = []string + +// AgentPolicyPackagePolicies1Inputs1StreamsVars4 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars4 = []float32 + +// AgentPolicyPackagePolicies1Inputs1StreamsVars5 defines model for . +type AgentPolicyPackagePolicies1Inputs1StreamsVars5 struct { + Id string `json:"id"` + IsSecretRef bool `json:"isSecretRef"` +} + +// AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Streams.Vars.AdditionalProperties. +type AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties struct { + union json.RawMessage +} + +// AgentPolicyPackagePolicies1Inputs1Vars0 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars0 = bool + +// AgentPolicyPackagePolicies1Inputs1Vars1 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars1 = string + +// AgentPolicyPackagePolicies1Inputs1Vars2 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars2 = float32 + +// AgentPolicyPackagePolicies1Inputs1Vars3 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars3 = []string + +// AgentPolicyPackagePolicies1Inputs1Vars4 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars4 = []float32 + +// AgentPolicyPackagePolicies1Inputs1Vars5 defines model for . +type AgentPolicyPackagePolicies1Inputs1Vars5 struct { + Id string `json:"id"` + IsSecretRef bool `json:"isSecretRef"` +} + +// AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Vars.AdditionalProperties. +type AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties struct { + union json.RawMessage +} + +// AgentPolicy_PackagePolicies_1_Inputs defines model for AgentPolicy.PackagePolicies.1.Inputs. +type AgentPolicy_PackagePolicies_1_Inputs struct { + union json.RawMessage +} + +// AgentPolicyPackagePolicies1Vars0 Package variable (see integration documentation for more information) +type AgentPolicyPackagePolicies1Vars0 map[string]struct { + Frozen *bool `json:"frozen,omitempty"` + Type *string `json:"type,omitempty"` + Value interface{} `json:"value"` +} + +// AgentPolicyPackagePolicies1Vars1 Input/stream level variable (see integration documentation for more information) +type AgentPolicyPackagePolicies1Vars1 map[string]*AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties + +// AgentPolicyPackagePolicies1Vars10 defines model for . +type AgentPolicyPackagePolicies1Vars10 = bool + +// AgentPolicyPackagePolicies1Vars11 defines model for . +type AgentPolicyPackagePolicies1Vars11 = string + +// AgentPolicyPackagePolicies1Vars12 defines model for . +type AgentPolicyPackagePolicies1Vars12 = float32 + +// AgentPolicyPackagePolicies1Vars13 defines model for . +type AgentPolicyPackagePolicies1Vars13 = []string + +// AgentPolicyPackagePolicies1Vars14 defines model for . +type AgentPolicyPackagePolicies1Vars14 = []float32 + +// AgentPolicyPackagePolicies1Vars15 defines model for . +type AgentPolicyPackagePolicies1Vars15 struct { + Id string `json:"id"` + IsSecretRef bool `json:"isSecretRef"` +} + +// AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Vars.1.AdditionalProperties. +type AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties struct { + union json.RawMessage +} + +// AgentPolicy_PackagePolicies_1_Vars defines model for AgentPolicy.PackagePolicies.1.Vars. +type AgentPolicy_PackagePolicies_1_Vars struct { + union json.RawMessage +} // AgentPolicy_PackagePolicies defines model for AgentPolicy.PackagePolicies. type AgentPolicy_PackagePolicies struct { @@ -1028,6 +1151,23 @@ type AgentPolicy_PackagePolicies struct { // AgentPolicyStatus defines model for AgentPolicy.Status. type AgentPolicyStatus string +// AgentPolicyGlobalDataTagsItem defines model for agent_policy_global_data_tags_item. +type AgentPolicyGlobalDataTagsItem struct { + Name string `json:"name"` + Value AgentPolicyGlobalDataTagsItem_Value `json:"value"` +} + +// AgentPolicyGlobalDataTagsItemValue0 defines model for . +type AgentPolicyGlobalDataTagsItemValue0 = string + +// AgentPolicyGlobalDataTagsItemValue1 defines model for . +type AgentPolicyGlobalDataTagsItemValue1 = float32 + +// AgentPolicyGlobalDataTagsItem_Value defines model for AgentPolicyGlobalDataTagsItem.Value. +type AgentPolicyGlobalDataTagsItem_Value struct { + union json.RawMessage +} + // 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. @@ -2065,10 +2205,13 @@ type PackagePolicy struct { 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"` + + // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. + SupportsAgentless *bool `json:"supports_agentless"` + 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. @@ -2114,7 +2257,10 @@ type PackagePolicyRequest struct { Package PackagePolicyRequestPackage `json:"package"` PolicyId *string `json:"policy_id"` PolicyIds *[]string `json:"policy_ids,omitempty"` - Vars *map[string]interface{} `json:"vars,omitempty"` + + // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. + SupportsAgentless *bool `json:"supports_agentless"` + Vars *map[string]interface{} `json:"vars,omitempty"` } // PackagePolicyRequestInput defines model for package_policy_request_input. @@ -2441,16 +2587,28 @@ type GetFleetAgentPoliciesParamsFormat string // PostFleetAgentPoliciesJSONBody defines parameters for PostFleetAgentPolicies. type PostFleetAgentPoliciesJSONBody 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"` + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` + AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` + AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` Name string `json:"name"` } `json:"agent_features,omitempty"` + Agentless *struct { + Resources *struct { + Requests *struct { + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` + } `json:"requests,omitempty"` + } `json:"resources,omitempty"` + } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2458,17 +2616,14 @@ type PostFleetAgentPoliciesJSONBody struct { 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 PostFleetAgentPoliciesJSONBody_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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -2488,7 +2643,7 @@ type PostFleetAgentPoliciesJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2499,8 +2654,14 @@ type PostFleetAgentPoliciesJSONBody struct { // 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"` - RequiredVersions *interface{} `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *[]struct { + // Percentage Target percentage of agents to auto upgrade + Percentage float32 `json:"percentage"` + + // Version Target version for automatic agent upgrade + Version string `json:"version"` + } `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -2512,17 +2673,6 @@ type PostFleetAgentPoliciesParams struct { SysMonitoring *bool `form:"sys_monitoring,omitempty" json:"sys_monitoring,omitempty"` } -// PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue0 defines parameters for PostFleetAgentPolicies. -type PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue0 = string - -// PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue1 defines parameters for PostFleetAgentPolicies. -type PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue1 = float32 - -// PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value defines parameters for PostFleetAgentPolicies. -type PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value struct { - union json.RawMessage -} - // PostFleetAgentPoliciesJSONBodyMonitoringEnabled defines parameters for PostFleetAgentPolicies. type PostFleetAgentPoliciesJSONBodyMonitoringEnabled string @@ -2545,16 +2695,28 @@ type GetFleetAgentPoliciesAgentpolicyidParamsFormat string // PutFleetAgentPoliciesAgentpolicyidJSONBody defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidJSONBody 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"` + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` + AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` + AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` } `json:"advanced_settings,omitempty"` AgentFeatures *[]struct { Enabled bool `json:"enabled"` Name string `json:"name"` } `json:"agent_features,omitempty"` + Agentless *struct { + Resources *struct { + Requests *struct { + Cpu *string `json:"cpu,omitempty"` + Memory *string `json:"memory,omitempty"` + } `json:"requests,omitempty"` + } `json:"resources,omitempty"` + } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2562,17 +2724,14 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { 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 PutFleetAgentPoliciesAgentpolicyidJSONBody_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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -2592,7 +2751,7 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2603,8 +2762,14 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { // 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"` - RequiredVersions *interface{} `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *[]struct { + // Percentage Target percentage of agents to auto upgrade + Percentage float32 `json:"percentage"` + + // Version Target version for automatic agent upgrade + Version string `json:"version"` + } `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -2619,17 +2784,6 @@ type PutFleetAgentPoliciesAgentpolicyidParams struct { // PutFleetAgentPoliciesAgentpolicyidParamsFormat defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidParamsFormat string -// PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue0 defines parameters for PutFleetAgentPoliciesAgentpolicyid. -type PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue0 = string - -// PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue1 defines parameters for PutFleetAgentPoliciesAgentpolicyid. -type PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue1 = float32 - -// PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value defines parameters for PutFleetAgentPoliciesAgentpolicyid. -type PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value struct { - union json.RawMessage -} - // PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled string @@ -10231,22 +10385,126 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { 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 +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars3 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars3() (AgentPolicyPackagePolicies1Inputs1StreamsVars3, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars4 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars4() (AgentPolicyPackagePolicies1Inputs1StreamsVars4, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars4 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 { +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) error { b, err := json.Marshal(v) if err != nil { return err @@ -10257,22 +10515,22 @@ func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue0( 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 +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars5 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars5() (AgentPolicyPackagePolicies1Inputs1StreamsVars5, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars5 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 { +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) error { b, err := json.Marshal(v) if err != nil { return err @@ -10283,32 +10541,32 @@ func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue1( return err } -func (t AgentPolicy_GlobalDataTags_Value) MarshalJSON() ([]byte, error) { +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *AgentPolicy_GlobalDataTags_Value) UnmarshalJSON(b []byte) error { +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) 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 +// AsAgentPolicyPackagePolicies1Inputs1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars0 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars0() (AgentPolicyPackagePolicies1Inputs1Vars0, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars0 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 { +// FromAgentPolicyPackagePolicies1Inputs1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) error { b, err := json.Marshal(v) if err != nil { return err @@ -10319,22 +10577,22 @@ func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies0(v AgentPo return err } -// AsAgentPolicyPackagePolicies1 returns the union data inside the AgentPolicy_PackagePolicies as a AgentPolicyPackagePolicies1 -func (t AgentPolicy_PackagePolicies) AsAgentPolicyPackagePolicies1() (AgentPolicyPackagePolicies1, error) { - var body AgentPolicyPackagePolicies1 +// AsAgentPolicyPackagePolicies1Inputs1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars1 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars1() (AgentPolicyPackagePolicies1Inputs1Vars1, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars1 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 { +// FromAgentPolicyPackagePolicies1Inputs1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) 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 { +// MergeAgentPolicyPackagePolicies1Inputs1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) error { b, err := json.Marshal(v) if err != nil { return err @@ -10345,12 +10603,530 @@ func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies1(v AgentPo return err } -func (t AgentPolicy_PackagePolicies) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err +// AsAgentPolicyPackagePolicies1Inputs1Vars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars2 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars2() (AgentPolicyPackagePolicies1Inputs1Vars2, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars2 + err := json.Unmarshal(t.union, &body) + return body, err } -func (t *AgentPolicy_PackagePolicies) UnmarshalJSON(b []byte) error { +// FromAgentPolicyPackagePolicies1Inputs1Vars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars2 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1Vars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars3 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars3() (AgentPolicyPackagePolicies1Inputs1Vars3, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1Vars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars3 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1Vars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars4 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars4() (AgentPolicyPackagePolicies1Inputs1Vars4, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars4 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1Vars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars4 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1Vars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars5 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars5() (AgentPolicyPackagePolicies1Inputs1Vars5, error) { + var body AgentPolicyPackagePolicies1Inputs1Vars5 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1Vars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1Vars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars5 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) 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_1_Inputs_1_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Inputs0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs0 +func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs0() (AgentPolicyPackagePolicies1Inputs0, error) { + var body AgentPolicyPackagePolicies1Inputs0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs0 +func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs0 +func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs1 +func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs1() (AgentPolicyPackagePolicies1Inputs1, error) { + var body AgentPolicyPackagePolicies1Inputs1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs1 +func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs1 +func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) 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_1_Inputs) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Inputs) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Vars10 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars10 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars10() (AgentPolicyPackagePolicies1Vars10, error) { + var body AgentPolicyPackagePolicies1Vars10 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars10 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars10 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars10 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars10 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars11 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars11 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars11() (AgentPolicyPackagePolicies1Vars11, error) { + var body AgentPolicyPackagePolicies1Vars11 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars11 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars11 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars11 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars11 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars12 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars12 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars12() (AgentPolicyPackagePolicies1Vars12, error) { + var body AgentPolicyPackagePolicies1Vars12 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars12 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars12 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars12 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars12 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars13 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars13 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars13() (AgentPolicyPackagePolicies1Vars13, error) { + var body AgentPolicyPackagePolicies1Vars13 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars13 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars13 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars13 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars13 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars14 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars14 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars14() (AgentPolicyPackagePolicies1Vars14, error) { + var body AgentPolicyPackagePolicies1Vars14 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars14 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars14 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars14 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars14 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars15 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars15 +func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars15() (AgentPolicyPackagePolicies1Vars15, error) { + var body AgentPolicyPackagePolicies1Vars15 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars15 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars15 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars15 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars15 +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) 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_1_Vars_1_AdditionalProperties) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars0 +func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars0() (AgentPolicyPackagePolicies1Vars0, error) { + var body AgentPolicyPackagePolicies1Vars0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars0 +func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars1 +func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars1() (AgentPolicyPackagePolicies1Vars1, error) { + var body AgentPolicyPackagePolicies1Vars1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars1 +func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) 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_1_Vars) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies_1_Vars) 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 +} + +// AsAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue0 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue0() (AgentPolicyGlobalDataTagsItemValue0, error) { + var body AgentPolicyGlobalDataTagsItemValue0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue1 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue1() (AgentPolicyGlobalDataTagsItemValue1, error) { + var body AgentPolicyGlobalDataTagsItemValue1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue1 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyGlobalDataTagsItemValue1 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue1 +func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) 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 AgentPolicyGlobalDataTagsItem_Value) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } diff --git a/generated/kbapi/transform_schema.go b/generated/kbapi/transform_schema.go index 62a5cfd53..240f99a06 100644 --- a/generated/kbapi/transform_schema.go +++ b/generated/kbapi/transform_schema.go @@ -838,6 +838,26 @@ func transformFleetPaths(schema *Schema) { agentPolicyPath.Put.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) } + // do global_data_tags refs + schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") + // Define the value types for the GlobalDataTags + schema.Components.Set("schemas.agent_policy_global_data_tags_item", Map{ + "type": "object", + "properties": Map{ + "name": Map{"type": "string"}, + "value": Map{ + "oneOf": []Map{ + {"type": "string"}, + {"type": "number"}, + }, + }, + }, + "required": []string{"name", "value"}, + }) + + agentPoliciesPath.Post.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") + agentPolicyPath.Put.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") + // 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 From 26585578cbac5548df98f92127ef9b08d3b3d719 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 18:54:07 -0500 Subject: [PATCH 58/89] amazing, types arent screaming and tests pass --- docs/resources/fleet_agent_policy.md | 2 +- internal/fleet/agent_policy/create.go | 4 +- internal/fleet/agent_policy/models.go | 54 ++++++------------- internal/fleet/agent_policy/read.go | 2 +- internal/fleet/agent_policy/resource_test.go | 56 ++++++++------------ internal/fleet/agent_policy/schema.go | 5 +- internal/fleet/agent_policy/update.go | 4 +- 7 files changed, 49 insertions(+), 78 deletions(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index ec223b928..860d9fc10 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,7 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (String) JSON encoded defined data tags to apply to all inputs. +- `global_data_tags` (String) JSON encoded user-defined data tags to apply to all inputs. - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index ea4420777..3ed965cf2 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body, diags := planModel.toAPICreateModel(ctx, sVersion) + body, diags := planModel.toAPICreateModel(sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -40,7 +40,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - diags = planModel.populateFromAPI(ctx, policy, sVersion) + diags = planModel.populateFromAPI(policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 4c1250ba8..f41cefc84 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -1,7 +1,6 @@ package agent_policy import ( - "context" "encoding/json" "slices" @@ -13,25 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -// type globalDataTagModel struct { -// Name types.String `tfsdk:"name"` -// Value types.String `tfsdk:"value"` -// } - -// func newGlobalDataTagModel(data struct { -// Name string "json:\"name\"" -// Value kbapi.AgentPolicy_GlobalDataTags_Value "json:\"value\"" -// }) globalDataTagModel { -// val, err := data.Value.AsAgentPolicyGlobalDataTagsValue0() -// if err != nil { -// panic(err) -// } -// return globalDataTagModel{ -// Name: types.StringValue(data.Name), -// Value: types.StringValue(val), -// } -// } - type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -49,7 +29,7 @@ type agentPolicyModel struct { GlobalDataTags types.String `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { +func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { if data == nil { return nil } @@ -81,18 +61,19 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Namespace = types.StringValue(data.Namespace) if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { diags := diag.Diagnostics{} - d, err := json.Marshal(data.GlobalDataTags) + d, err := json.Marshal(utils.Deref(data.GlobalDataTags)) if err != nil { diags.AddError("Failed to marshal global data tags", err.Error()) return diags } - model.GlobalDataTags = types.StringValue(string(d)) + strD := string(d) + model.GlobalDataTags = types.StringPointerValue(&strD) } return nil } -func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { @@ -122,22 +103,21 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi } str := model.GlobalDataTags.ValueStringPointer() - var items []struct { - Name string `json:"name"` - Value kbapi.PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` - } + var items []kbapi.AgentPolicyGlobalDataTagsItem - err := json.Unmarshal([]byte(utils.Deref(str)), &items) + err := json.Unmarshal([]byte(*str), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - *body.GlobalDataTags = items + + body.GlobalDataTags = &items } + return body, nil } -func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPIUpdateModel(serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -163,17 +143,17 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } + str := model.GlobalDataTags.ValueStringPointer() - var items []struct { - Name string `json:"name"` - Value kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` - } - err := json.Unmarshal([]byte(utils.Deref(str)), &items) + var items []kbapi.AgentPolicyGlobalDataTagsItem + + err := json.Unmarshal([]byte(*str), &items) if err != nil { diags.AddError(err.Error(), "") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - *body.GlobalDataTags = items + + body.GlobalDataTags = &items } return body, nil diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index 34916f0bd..5a8fd1f09 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -39,7 +39,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - diags = stateModel.populateFromAPI(ctx, policy, sVersion) + diags = stateModel.populateFromAPI(policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 51b5c7258..368247587 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -131,9 +131,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3", "value3"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1"},{"name":"tag2","value":1.1}]`), ), }, { @@ -146,10 +144,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1", "value1a"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2", "value2a"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), - ), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1a"}]`)), }, { SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), @@ -161,9 +156,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag3"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags"), ), }, }, @@ -231,17 +224,15 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_metrics = false skip_destroy = %t global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1" - },{ - name = "tag2" - value = "value2" - },{ - name = "tag3" - value = "value3" - } - ]) + { + name = "tag1" + value = "value1" + }, + { + name = "tag2" + value = 1.1 + } + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -259,21 +250,18 @@ provider "elasticstack" { } resource "elasticstack_fleet_agent_policy" "test_policy" { - name = "%s" - namespace = "default" - description = "This policy was updated" - monitor_logs = false + name = "%s" + namespace = "default" + description = "This policy was updated" + monitor_logs = false monitor_metrics = true - skip_destroy = %t + skip_destroy = %t global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1a" - },{ - name = "tag2" - value = "value2a" - } - ]) + { + name = "tag1" + value = "value1a" + } + ]) } data "elasticstack_fleet_enrollment_tokens" "test_policy" { diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index bebd16a9c..123b3c740 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -87,8 +87,11 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.StringAttribute{ - Description: "JSON encoded defined data tags to apply to all inputs.", + Description: "JSON encoded user-defined data tags to apply to all inputs.", Optional: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, }} } diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 8099e842b..822ad68bd 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body, diags := planModel.toAPIUpdateModel(ctx, sVersion) + body, diags := planModel.toAPIUpdateModel(sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { @@ -41,7 +41,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(ctx, policy, sVersion) + planModel.populateFromAPI(policy, sVersion) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From 16f79517e7b86a9b801bc1905a2393fe0f5a4810 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 19:10:42 -0500 Subject: [PATCH 59/89] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9a841ba7..0c575c87d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Add missing entries to `data_view.field_formats.params` ([#1001](https://github.com/elastic/terraform-provider-elasticstack/pull/1001)) - Fix namespaces inconsistency when creating elasticstack_kibana_data_view resources ([#1011](https://github.com/elastic/terraform-provider-elasticstack/pull/1011)) - Update rule ID documentation. ([#1047](https://github.com/elastic/terraform-provider-elasticstack/pull/1047)) +- Add `global_data_tags` to fleet agent policies. ([#1044](https://github.com/elastic/terraform-provider-elasticstack/pull/1044)) ## [0.11.13] - 2025-01-09 From 4503604916771ba32efaf05efc01a168a92e12cd Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 20:29:19 -0500 Subject: [PATCH 60/89] seems like this breaks other things --- generated/kbapi/kibana.gen.go | 3325 ++++++++++++++++++++++----- generated/kbapi/transform_schema.go | 5 +- 2 files changed, 2767 insertions(+), 563 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index a2ea9c046..c212b610d 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -218,20 +218,20 @@ const ( OutputSslVerificationModeStrict OutputSslVerificationMode = "strict" ) -// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType. +// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0. 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" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" ) // Defines values for PackageInfoInstallationInfoInstallSource. @@ -261,20 +261,20 @@ const ( PackageInfoInstallationInfoInstalledEsTypeTransform PackageInfoInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageInfoInstallationInfoInstalledKibanaType. +// Defines values for PackageInfoInstallationInfoInstalledKibanaType0. 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" + PackageInfoInstallationInfoInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoInstalledKibanaType0 = "csp-rule-template" + PackageInfoInstallationInfoInstalledKibanaType0Dashboard PackageInfoInstallationInfoInstalledKibanaType0 = "dashboard" + PackageInfoInstallationInfoInstalledKibanaType0IndexPattern PackageInfoInstallationInfoInstalledKibanaType0 = "index-pattern" + PackageInfoInstallationInfoInstalledKibanaType0Lens PackageInfoInstallationInfoInstalledKibanaType0 = "lens" + PackageInfoInstallationInfoInstalledKibanaType0Map PackageInfoInstallationInfoInstalledKibanaType0 = "map" + PackageInfoInstallationInfoInstalledKibanaType0MlModule PackageInfoInstallationInfoInstalledKibanaType0 = "ml-module" + PackageInfoInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" + PackageInfoInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-saved-query" + PackageInfoInstallationInfoInstalledKibanaType0Search PackageInfoInstallationInfoInstalledKibanaType0 = "search" + PackageInfoInstallationInfoInstalledKibanaType0SecurityRule PackageInfoInstallationInfoInstalledKibanaType0 = "security-rule" + PackageInfoInstallationInfoInstalledKibanaType0Tag PackageInfoInstallationInfoInstalledKibanaType0 = "tag" + PackageInfoInstallationInfoInstalledKibanaType0Visualization PackageInfoInstallationInfoInstalledKibanaType0 = "visualization" ) // Defines values for PackageInfoInstallationInfoVerificationStatus. @@ -298,27 +298,35 @@ const ( PackageInfoReleaseGa PackageInfoRelease = "ga" ) -// Defines values for PackageInfoType. +// Defines values for PackageInfoType0. const ( - PackageInfoTypeContent PackageInfoType = "content" - PackageInfoTypeInput PackageInfoType = "input" - PackageInfoTypeIntegration PackageInfoType = "integration" + PackageInfoType0Integration PackageInfoType0 = "integration" ) -// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType. +// Defines values for PackageInfoType1. 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" + PackageInfoType1Input PackageInfoType1 = "input" +) + +// Defines values for PackageInfoType2. +const ( + PackageInfoType2Content PackageInfoType2 = "content" +) + +// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0. +const ( + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" ) // Defines values for PackageListItemInstallationInfoInstallSource. @@ -348,20 +356,20 @@ const ( PackageListItemInstallationInfoInstalledEsTypeTransform PackageListItemInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageListItemInstallationInfoInstalledKibanaType. +// Defines values for PackageListItemInstallationInfoInstalledKibanaType0. 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" + PackageListItemInstallationInfoInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoInstalledKibanaType0 = "csp-rule-template" + PackageListItemInstallationInfoInstalledKibanaType0Dashboard PackageListItemInstallationInfoInstalledKibanaType0 = "dashboard" + PackageListItemInstallationInfoInstalledKibanaType0IndexPattern PackageListItemInstallationInfoInstalledKibanaType0 = "index-pattern" + PackageListItemInstallationInfoInstalledKibanaType0Lens PackageListItemInstallationInfoInstalledKibanaType0 = "lens" + PackageListItemInstallationInfoInstalledKibanaType0Map PackageListItemInstallationInfoInstalledKibanaType0 = "map" + PackageListItemInstallationInfoInstalledKibanaType0MlModule PackageListItemInstallationInfoInstalledKibanaType0 = "ml-module" + PackageListItemInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" + PackageListItemInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-saved-query" + PackageListItemInstallationInfoInstalledKibanaType0Search PackageListItemInstallationInfoInstalledKibanaType0 = "search" + PackageListItemInstallationInfoInstalledKibanaType0SecurityRule PackageListItemInstallationInfoInstalledKibanaType0 = "security-rule" + PackageListItemInstallationInfoInstalledKibanaType0Tag PackageListItemInstallationInfoInstalledKibanaType0 = "tag" + PackageListItemInstallationInfoInstalledKibanaType0Visualization PackageListItemInstallationInfoInstalledKibanaType0 = "visualization" ) // Defines values for PackageListItemInstallationInfoVerificationStatus. @@ -385,11 +393,26 @@ const ( Ga PackageListItemRelease = "ga" ) -// Defines values for PackageListItemType. +// Defines values for PackageListItemType0. +const ( + PackageListItemType0Integration PackageListItemType0 = "integration" +) + +// Defines values for PackageListItemType1. +const ( + PackageListItemType1Input PackageListItemType1 = "input" +) + +// Defines values for PackageListItemType2. const ( - PackageListItemTypeContent PackageListItemType = "content" - PackageListItemTypeInput PackageListItemType = "input" - PackageListItemTypeIntegration PackageListItemType = "integration" + PackageListItemType2Content PackageListItemType2 = "content" +) + +// Defines values for ServerHostSslClientAuth. +const ( + ServerHostSslClientAuthNone ServerHostSslClientAuth = "none" + ServerHostSslClientAuthOptional ServerHostSslClientAuth = "optional" + ServerHostSslClientAuthRequired ServerHostSslClientAuth = "required" ) // Defines values for UpdateOutputElasticsearchPreset. @@ -469,10 +492,10 @@ const ( // Defines values for UpdateOutputSslVerificationMode. const ( - Certificate UpdateOutputSslVerificationMode = "certificate" - Full UpdateOutputSslVerificationMode = "full" - None UpdateOutputSslVerificationMode = "none" - Strict UpdateOutputSslVerificationMode = "strict" + UpdateOutputSslVerificationModeCertificate UpdateOutputSslVerificationMode = "certificate" + UpdateOutputSslVerificationModeFull UpdateOutputSslVerificationMode = "full" + UpdateOutputSslVerificationModeNone UpdateOutputSslVerificationMode = "none" + UpdateOutputSslVerificationModeStrict UpdateOutputSslVerificationMode = "strict" ) // Defines values for GetFleetAgentPoliciesParamsSortOrder. @@ -513,6 +536,20 @@ const ( Traces PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled = "traces" ) +// Defines values for PostFleetFleetServerHostsJSONBodySslClientAuth. +const ( + PostFleetFleetServerHostsJSONBodySslClientAuthNone PostFleetFleetServerHostsJSONBodySslClientAuth = "none" + PostFleetFleetServerHostsJSONBodySslClientAuthOptional PostFleetFleetServerHostsJSONBodySslClientAuth = "optional" + PostFleetFleetServerHostsJSONBodySslClientAuthRequired PostFleetFleetServerHostsJSONBodySslClientAuth = "required" +) + +// Defines values for PutFleetFleetServerHostsItemidJSONBodySslClientAuth. +const ( + PutFleetFleetServerHostsItemidJSONBodySslClientAuthNone PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "none" + PutFleetFleetServerHostsItemidJSONBodySslClientAuthOptional PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "optional" + PutFleetFleetServerHostsItemidJSONBodySslClientAuthRequired PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "required" +) + // Defines values for GetFleetPackagePoliciesParamsSortOrder. const ( GetFleetPackagePoliciesParamsSortOrderAsc GetFleetPackagePoliciesParamsSortOrder = "asc" @@ -792,6 +829,23 @@ type DataViewsUpdateDataViewRequestObjectInner struct { TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` } +// FleetAgentPolicyGlobalDataTagsItem defines model for Fleet_agent_policy_global_data_tags_item. +type FleetAgentPolicyGlobalDataTagsItem struct { + Name string `json:"name"` + Value FleetAgentPolicyGlobalDataTagsItem_Value `json:"value"` +} + +// FleetAgentPolicyGlobalDataTagsItemValue0 defines model for . +type FleetAgentPolicyGlobalDataTagsItemValue0 = string + +// FleetAgentPolicyGlobalDataTagsItemValue1 defines model for . +type FleetAgentPolicyGlobalDataTagsItemValue1 = float32 + +// FleetAgentPolicyGlobalDataTagsItem_Value defines model for FleetAgentPolicyGlobalDataTagsItem.Value. +type FleetAgentPolicyGlobalDataTagsItem_Value struct { + union json.RawMessage +} + // AgentPolicy defines model for agent_policy. type AgentPolicy struct { AdvancedSettings *struct { @@ -824,14 +878,14 @@ type AgentPolicy struct { 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 *[]AgentPolicyGlobalDataTagsItem `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"` + GlobalDataTags *[]FleetAgentPolicyGlobalDataTagsItem `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"` @@ -895,9 +949,11 @@ 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 { - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -1212,14 +1268,32 @@ type NewOutputElasticsearch struct { 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"` + Secrets *struct { + Ssl *struct { + Key *NewOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Type NewOutputElasticsearchType `json:"type"` } // NewOutputElasticsearchPreset defines model for NewOutputElasticsearch.Preset. type NewOutputElasticsearchPreset string +// NewOutputElasticsearchSecretsSslKey0 defines model for . +type NewOutputElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// NewOutputElasticsearchSecretsSslKey1 defines model for . +type NewOutputElasticsearchSecretsSslKey1 = string + +// NewOutputElasticsearch_Secrets_Ssl_Key defines model for NewOutputElasticsearch.Secrets.Ssl.Key. +type NewOutputElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // NewOutputElasticsearchType defines model for NewOutputElasticsearch.Type. type NewOutputElasticsearchType string @@ -1375,21 +1449,41 @@ type NewOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + KibanaApiKey *string `json:"kibana_api_key"` + KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *NewOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { + KibanaApiKey *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *NewOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + Ssl *struct { + Key *NewOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Type NewOutputRemoteElasticsearchType `json:"type"` + ServiceToken *string `json:"service_token"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + SyncIntegrations *bool `json:"sync_integrations,omitempty"` + Type NewOutputRemoteElasticsearchType `json:"type"` } // NewOutputRemoteElasticsearchPreset defines model for NewOutputRemoteElasticsearch.Preset. type NewOutputRemoteElasticsearchPreset string +// NewOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . +type NewOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { + Id string `json:"id"` +} + +// NewOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . +type NewOutputRemoteElasticsearchSecretsKibanaApiKey1 = string + +// NewOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for NewOutputRemoteElasticsearch.Secrets.KibanaApiKey. +type NewOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { + union json.RawMessage +} + // NewOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type NewOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1403,6 +1497,19 @@ type NewOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } +// NewOutputRemoteElasticsearchSecretsSslKey0 defines model for . +type NewOutputRemoteElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// NewOutputRemoteElasticsearchSecretsSslKey1 defines model for . +type NewOutputRemoteElasticsearchSecretsSslKey1 = string + +// NewOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for NewOutputRemoteElasticsearch.Secrets.Ssl.Key. +type NewOutputRemoteElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // NewOutputRemoteElasticsearchType defines model for NewOutputRemoteElasticsearch.Type. type NewOutputRemoteElasticsearchType string @@ -1438,28 +1545,55 @@ type NewOutputUnion struct { // 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:"-"` + 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"` + Secrets *OutputElasticsearch_Secrets `json:"secrets,omitempty"` + 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 +// OutputElasticsearchSecretsSslKey0 defines model for . +type OutputElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputElasticsearchSecretsSslKey1 defines model for . +type OutputElasticsearchSecretsSslKey1 = string + +// OutputElasticsearch_Secrets_Ssl_Key defines model for OutputElasticsearch.Secrets.Ssl.Key. +type OutputElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// OutputElasticsearch_Secrets_Ssl defines model for OutputElasticsearch.Secrets.Ssl. +type OutputElasticsearch_Secrets_Ssl struct { + Key *OutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputElasticsearch_Secrets defines model for OutputElasticsearch.Secrets. +type OutputElasticsearch_Secrets struct { + Ssl *OutputElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + // OutputElasticsearchType defines model for OutputElasticsearch.Type. type OutputElasticsearchType string @@ -1656,6 +1790,8 @@ type OutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + KibanaApiKey *string `json:"kibana_api_key"` + KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *OutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id"` @@ -1663,6 +1799,7 @@ type OutputRemoteElasticsearch struct { ServiceToken *string `json:"service_token"` Shipper *OutputShipper `json:"shipper"` Ssl *OutputSsl `json:"ssl"` + SyncIntegrations *bool `json:"sync_integrations,omitempty"` Type OutputRemoteElasticsearchType `json:"type"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1670,6 +1807,20 @@ type OutputRemoteElasticsearch struct { // OutputRemoteElasticsearchPreset defines model for OutputRemoteElasticsearch.Preset. type OutputRemoteElasticsearchPreset string +// OutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . +type OutputRemoteElasticsearchSecretsKibanaApiKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . +type OutputRemoteElasticsearchSecretsKibanaApiKey1 = string + +// OutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for OutputRemoteElasticsearch.Secrets.KibanaApiKey. +type OutputRemoteElasticsearch_Secrets_KibanaApiKey struct { + union json.RawMessage +} + // OutputRemoteElasticsearchSecretsServiceToken0 defines model for . type OutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1684,9 +1835,31 @@ type OutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } +// OutputRemoteElasticsearchSecretsSslKey0 defines model for . +type OutputRemoteElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputRemoteElasticsearchSecretsSslKey1 defines model for . +type OutputRemoteElasticsearchSecretsSslKey1 = string + +// OutputRemoteElasticsearch_Secrets_Ssl_Key defines model for OutputRemoteElasticsearch.Secrets.Ssl.Key. +type OutputRemoteElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// OutputRemoteElasticsearch_Secrets_Ssl defines model for OutputRemoteElasticsearch.Secrets.Ssl. +type OutputRemoteElasticsearch_Secrets_Ssl struct { + Key *OutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + // OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. type OutputRemoteElasticsearch_Secrets struct { + KibanaApiKey *OutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + Ssl *OutputRemoteElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1772,7 +1945,7 @@ type PackageInfo struct { Source *PackageInfo_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageInfoType `json:"type,omitempty"` + Type *PackageInfo_Type `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -1821,15 +1994,23 @@ type PackageInfo_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType string +// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. +type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 string + +// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . +type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 = string + +// PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. +type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` } // PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageInfo.InstallationInfo.ExperimentalDataStreamFeatures.Features. @@ -1866,22 +2047,30 @@ type PackageInfo_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoInstalledKibanaType defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. -type PackageInfoInstallationInfoInstalledKibanaType string +// PackageInfoInstallationInfoInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.InstalledKibana.Type.0. +type PackageInfoInstallationInfoInstalledKibanaType0 string + +// PackageInfoInstallationInfoInstalledKibanaType1 defines model for . +type PackageInfoInstallationInfoInstalledKibanaType1 = string + +// PackageInfo_InstallationInfo_InstalledKibana_Type defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. +type PackageInfo_InstallationInfo_InstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageInfo_InstallationInfo_InstalledKibana_Type `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"` + Name *string `json:"name,omitempty"` + StartedAt *string `json:"started_at,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1946,8 +2135,22 @@ type PackageInfo_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoType defines model for PackageInfo.Type. -type PackageInfoType string +// PackageInfoType0 defines model for PackageInfo.Type.0. +type PackageInfoType0 string + +// PackageInfoType1 defines model for PackageInfo.Type.1. +type PackageInfoType1 string + +// PackageInfoType2 defines model for PackageInfo.Type.2. +type PackageInfoType2 string + +// PackageInfoType3 defines model for . +type PackageInfoType3 = string + +// PackageInfo_Type defines model for PackageInfo.Type. +type PackageInfo_Type struct { + union json.RawMessage +} // PackageListItem defines model for package_list_item. type PackageListItem struct { @@ -1974,7 +2177,7 @@ type PackageListItem struct { Source *PackageListItem_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageListItemType `json:"type,omitempty"` + Type *PackageListItem_Type `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -2023,15 +2226,23 @@ type PackageListItem_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType string +// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. +type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 string + +// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . +type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 = string + +// PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. +type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` } // PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageListItem.InstallationInfo.ExperimentalDataStreamFeatures.Features. @@ -2068,22 +2279,30 @@ type PackageListItem_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoInstalledKibanaType defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. -type PackageListItemInstallationInfoInstalledKibanaType string +// PackageListItemInstallationInfoInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.InstalledKibana.Type.0. +type PackageListItemInstallationInfoInstalledKibanaType0 string + +// PackageListItemInstallationInfoInstalledKibanaType1 defines model for . +type PackageListItemInstallationInfoInstalledKibanaType1 = string + +// PackageListItem_InstallationInfo_InstalledKibana_Type defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. +type PackageListItem_InstallationInfo_InstalledKibana_Type struct { + union json.RawMessage +} // 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:"-"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageListItem_InstallationInfo_InstalledKibana_Type `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"` + Name *string `json:"name,omitempty"` + StartedAt *string `json:"started_at,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2148,14 +2367,30 @@ type PackageListItem_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemType defines model for PackageListItem.Type. -type PackageListItemType string +// PackageListItemType0 defines model for PackageListItem.Type.0. +type PackageListItemType0 string + +// PackageListItemType1 defines model for PackageListItem.Type.1. +type PackageListItemType1 string + +// PackageListItemType2 defines model for PackageListItem.Type.2. +type PackageListItemType2 string + +// PackageListItemType3 defines model for . +type PackageListItemType3 = string + +// PackageListItem_Type defines model for PackageListItem.Type. +type PackageListItem_Type struct { + union json.RawMessage +} // PackagePolicy defines model for package_policy. type PackagePolicy struct { - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -2245,9 +2480,11 @@ type PackagePolicyInputStream struct { // 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"` + // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. + AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` + 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"` @@ -2315,8 +2552,52 @@ type ServerHost struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id"` + Secrets *struct { + Ssl *struct { + EsKey *ServerHost_Secrets_Ssl_EsKey `json:"es_key,omitempty"` + Key *ServerHost_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Ssl *struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + ClientAuth *ServerHostSslClientAuth `json:"client_auth,omitempty"` + EsCertificate *string `json:"es_certificate,omitempty"` + EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` + EsKey *string `json:"es_key,omitempty"` + Key *string `json:"key,omitempty"` + } `json:"ssl"` +} + +// ServerHostSecretsSslEsKey0 defines model for . +type ServerHostSecretsSslEsKey0 struct { + Id string `json:"id"` +} + +// ServerHostSecretsSslEsKey1 defines model for . +type ServerHostSecretsSslEsKey1 = string + +// ServerHost_Secrets_Ssl_EsKey defines model for ServerHost.Secrets.Ssl.EsKey. +type ServerHost_Secrets_Ssl_EsKey struct { + union json.RawMessage } +// ServerHostSecretsSslKey0 defines model for . +type ServerHostSecretsSslKey0 struct { + Id string `json:"id"` +} + +// ServerHostSecretsSslKey1 defines model for . +type ServerHostSecretsSslKey1 = string + +// ServerHost_Secrets_Ssl_Key defines model for ServerHost.Secrets.Ssl.Key. +type ServerHost_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// ServerHostSslClientAuth defines model for ServerHost.Ssl.ClientAuth. +type ServerHostSslClientAuth string + // UpdateOutputElasticsearch defines model for update_output_elasticsearch. type UpdateOutputElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` @@ -2331,14 +2612,32 @@ type UpdateOutputElasticsearch struct { 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"` + Secrets *struct { + Ssl *struct { + Key *UpdateOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,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 +// UpdateOutputElasticsearchSecretsSslKey0 defines model for . +type UpdateOutputElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputElasticsearchSecretsSslKey1 defines model for . +type UpdateOutputElasticsearchSecretsSslKey1 = string + +// UpdateOutputElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputElasticsearch.Secrets.Ssl.Key. +type UpdateOutputElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. type UpdateOutputElasticsearchType string @@ -2491,21 +2790,41 @@ type UpdateOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + KibanaApiKey *string `json:"kibana_api_key"` + KibanaUrl *string `json:"kibana_url"` Name *string `json:"name,omitempty"` Preset *UpdateOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { + KibanaApiKey *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + Ssl *struct { + Key *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputRemoteElasticsearchType `json:"type,omitempty"` + ServiceToken *string `json:"service_token"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + SyncIntegrations *bool `json:"sync_integrations,omitempty"` + Type *UpdateOutputRemoteElasticsearchType `json:"type,omitempty"` } // UpdateOutputRemoteElasticsearchPreset defines model for UpdateOutputRemoteElasticsearch.Preset. type UpdateOutputRemoteElasticsearchPreset string +// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . +type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . +type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 = string + +// UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for UpdateOutputRemoteElasticsearch.Secrets.KibanaApiKey. +type UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { + union json.RawMessage +} + // UpdateOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type UpdateOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -2519,6 +2838,19 @@ type UpdateOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } +// UpdateOutputRemoteElasticsearchSecretsSslKey0 defines model for . +type UpdateOutputRemoteElasticsearchSecretsSslKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputRemoteElasticsearchSecretsSslKey1 defines model for . +type UpdateOutputRemoteElasticsearchSecretsSslKey1 = string + +// UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputRemoteElasticsearch.Secrets.Ssl.Key. +type UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key struct { + union json.RawMessage +} + // UpdateOutputRemoteElasticsearchType defines model for UpdateOutputRemoteElasticsearch.Type. type UpdateOutputRemoteElasticsearchType string @@ -2717,6 +3049,7 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { } `json:"requests,omitempty"` } `json:"resources,omitempty"` } `json:"agentless,omitempty"` + BumpRevision *bool `json:"bumpRevision,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2842,8 +3175,52 @@ type PostFleetFleetServerHostsJSONBody struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + Ssl *struct { + EsKey *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` + Key *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Ssl *struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + ClientAuth *PostFleetFleetServerHostsJSONBodySslClientAuth `json:"client_auth,omitempty"` + EsCertificate *string `json:"es_certificate,omitempty"` + EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` + EsKey *string `json:"es_key,omitempty"` + Key *string `json:"key,omitempty"` + } `json:"ssl"` +} + +// PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 struct { + Id string `json:"id"` +} + +// PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 = string + +// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey struct { + union json.RawMessage +} + +// PostFleetFleetServerHostsJSONBodySecretsSslKey0 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslKey0 struct { + Id string `json:"id"` +} + +// PostFleetFleetServerHostsJSONBodySecretsSslKey1 defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySecretsSslKey1 = string + +// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key struct { + union json.RawMessage } +// PostFleetFleetServerHostsJSONBodySslClientAuth defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBodySslClientAuth string + // PutFleetFleetServerHostsItemidJSONBody defines parameters for PutFleetFleetServerHostsItemid. type PutFleetFleetServerHostsItemidJSONBody struct { HostUrls *[]string `json:"host_urls,omitempty"` @@ -2851,8 +3228,52 @@ type PutFleetFleetServerHostsItemidJSONBody struct { IsInternal *bool `json:"is_internal,omitempty"` Name *string `json:"name,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + Ssl *struct { + EsKey *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` + Key *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Ssl *struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + ClientAuth *PutFleetFleetServerHostsItemidJSONBodySslClientAuth `json:"client_auth,omitempty"` + EsCertificate *string `json:"es_certificate,omitempty"` + EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` + EsKey *string `json:"es_key,omitempty"` + Key *string `json:"key,omitempty"` + } `json:"ssl"` +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 struct { + Id string `json:"id"` +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 = string + +// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey struct { + union json.RawMessage +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 struct { + Id string `json:"id"` +} + +// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 = string + +// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key struct { + union json.RawMessage } +// PutFleetFleetServerHostsItemidJSONBodySslClientAuth defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBodySslClientAuth string + // GetFleetPackagePoliciesParams defines parameters for GetFleetPackagePolicies. type GetFleetPackagePoliciesParams struct { Page *float32 `form:"page,omitempty" json:"page,omitempty"` @@ -3201,6 +3622,14 @@ func (a *OutputElasticsearch) UnmarshalJSON(b []byte) error { 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 { @@ -3331,6 +3760,13 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { } } + 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 { @@ -3359,54 +3795,256 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputKafka. Returns the specified +// Getter for additional properties for OutputElasticsearchSecretsSslKey0. Returns the specified // element and whether it was found -func (a OutputKafka) Get(fieldName string) (value interface{}, found bool) { +func (a OutputElasticsearchSecretsSslKey0) 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{}) { +// Setter for additional properties for OutputElasticsearchSecretsSslKey0 +func (a *OutputElasticsearchSecretsSslKey0) 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 { +// Override default JSON handling for OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a *OutputElasticsearchSecretsSslKey0) 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 raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) if err != nil { - return fmt.Errorf("error reading 'allow_edit': %w", err) + return fmt.Errorf("error reading 'id': %w", err) } - delete(object, "allow_edit") + delete(object, "id") } - 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) + 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 } - delete(object, "auth_type") } + return nil +} - 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") - } +// Override default JSON handling for OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a OutputElasticsearchSecretsSslKey0) 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 OutputElasticsearch_Secrets_Ssl. Returns the specified +// element and whether it was found +func (a OutputElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputElasticsearch_Secrets_Ssl +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a OutputElasticsearch_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 OutputElasticsearch_Secrets. Returns the specified +// element and whether it was found +func (a OutputElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputElasticsearch_Secrets +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties +func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties +func (a OutputElasticsearch_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 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) @@ -5162,6 +5800,22 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "is_preconfigured") } + if raw, found := object["kibana_api_key"]; found { + err = json.Unmarshal(raw, &a.KibanaApiKey) + if err != nil { + return fmt.Errorf("error reading 'kibana_api_key': %w", err) + } + delete(object, "kibana_api_key") + } + + if raw, found := object["kibana_url"]; found { + err = json.Unmarshal(raw, &a.KibanaUrl) + if err != nil { + return fmt.Errorf("error reading 'kibana_url': %w", err) + } + delete(object, "kibana_url") + } + if raw, found := object["name"]; found { err = json.Unmarshal(raw, &a.Name) if err != nil { @@ -5218,6 +5872,14 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "ssl") } + if raw, found := object["sync_integrations"]; found { + err = json.Unmarshal(raw, &a.SyncIntegrations) + if err != nil { + return fmt.Errorf("error reading 'sync_integrations': %w", err) + } + delete(object, "sync_integrations") + } + if raw, found := object["type"]; found { err = json.Unmarshal(raw, &a.Type) if err != nil { @@ -5313,6 +5975,20 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } + if a.KibanaApiKey != nil { + object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_api_key': %w", err) + } + } + + if a.KibanaUrl != nil { + object["kibana_url"], err = json.Marshal(a.KibanaUrl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_url': %w", err) + } + } + object["name"], err = json.Marshal(a.Name) if err != nil { return nil, fmt.Errorf("error marshaling 'name': %w", err) @@ -5360,6 +6036,13 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } + if a.SyncIntegrations != nil { + object["sync_integrations"], err = json.Marshal(a.SyncIntegrations) + if err != nil { + return nil, fmt.Errorf("error marshaling 'sync_integrations': %w", err) + } + } + object["type"], err = json.Marshal(a.Type) if err != nil { return nil, fmt.Errorf("error marshaling 'type': %w", err) @@ -5374,25 +6057,25 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearchSecretsServiceToken0) Get(fieldName string) (value interface{}, found bool) { +func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) 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{}) { +// Setter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) 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 { +// Override default JSON handling for OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties +func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) UnmarshalJSON(b []byte) error { object := make(map[string]json.RawMessage) err := json.Unmarshal(b, &object) if err != nil { @@ -5421,8 +6104,8 @@ func (a *OutputRemoteElasticsearchSecretsServiceToken0) UnmarshalJSON(b []byte) return nil } -// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties -func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, error) { +// Override default JSON handling for OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties +func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) @@ -5440,37 +6123,37 @@ func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, er return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearch_Secrets. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { +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 OutputRemoteElasticsearch_Secrets -func (a *OutputRemoteElasticsearch_Secrets) Set(fieldName string, value interface{}) { +// 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 OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { +// 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["service_token"]; found { - err = json.Unmarshal(raw, &a.ServiceToken) + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) if err != nil { - return fmt.Errorf("error reading 'service_token': %w", err) + return fmt.Errorf("error reading 'id': %w", err) } - delete(object, "service_token") + delete(object, "id") } if len(object) != 0 { @@ -5487,16 +6170,14 @@ func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { return nil } -// Override default JSON handling for OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { +// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties +func (a OutputRemoteElasticsearchSecretsServiceToken0) 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) - } + 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 { @@ -5508,34 +6189,266 @@ func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputShipper. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearchSecretsSslKey0. Returns the specified // element and whether it was found -func (a OutputShipper) Get(fieldName string) (value interface{}, found bool) { +func (a OutputRemoteElasticsearchSecretsSslKey0) 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{}) { +// Setter for additional properties for OutputRemoteElasticsearchSecretsSslKey0 +func (a *OutputRemoteElasticsearchSecretsSslKey0) 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 { +// Override default JSON handling for OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a *OutputRemoteElasticsearchSecretsSslKey0) 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 { + 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 OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties +func (a OutputRemoteElasticsearchSecretsSslKey0) 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_Ssl. Returns the specified +// element and whether it was found +func (a OutputRemoteElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputRemoteElasticsearch_Secrets_Ssl +func (a *OutputRemoteElasticsearch_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 OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a *OutputRemoteElasticsearch_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 OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties +func (a OutputRemoteElasticsearch_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 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["kibana_api_key"]; found { + err = json.Unmarshal(raw, &a.KibanaApiKey) + if err != nil { + return fmt.Errorf("error reading 'kibana_api_key': %w", err) + } + delete(object, "kibana_api_key") + } + + 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["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 OutputRemoteElasticsearch_Secrets to handle AdditionalProperties +func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.KibanaApiKey != nil { + object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_api_key': %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.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 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") @@ -7419,14 +8332,18 @@ func (a PackageInfo_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, } } - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) + if a.Name != nil { + 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) + if a.StartedAt != nil { + 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 { @@ -9588,14 +10505,18 @@ func (a PackageListItem_InstallationInfo_LatestExecutedState) MarshalJSON() ([]b } } - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) + if a.Name != nil { + 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) + if a.StartedAt != nil { + 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 { @@ -10385,22 +11306,22 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 +// AsFleetAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue0 +func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue0() (FleetAgentPolicyGlobalDataTagsItemValue0, error) { + var body FleetAgentPolicyGlobalDataTagsItemValue0 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// FromFleetAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue0 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// MergeFleetAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue0 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) if err != nil { return err @@ -10411,22 +11332,22 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 +// AsFleetAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue1 +func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue1() (FleetAgentPolicyGlobalDataTagsItemValue1, error) { + var body FleetAgentPolicyGlobalDataTagsItemValue1 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// FromFleetAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue1 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// MergeFleetAgentPolicyGlobalDataTagsItemValue1 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue1 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) error { b, err := json.Marshal(v) if err != nil { return err @@ -10437,14 +11358,76 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 - err := json.Unmarshal(t.union, &body) - return body, err +func (t FleetAgentPolicyGlobalDataTagsItem_Value) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t *FleetAgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 +func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 +func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { + var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { b, err := json.Marshal(v) t.union = b @@ -11131,6 +12114,68 @@ func (t *AgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { return err } +// AsNewOutputElasticsearchSecretsSslKey0 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey0 +func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey0() (NewOutputElasticsearchSecretsSslKey0, error) { + var body NewOutputElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey0 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey0 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputElasticsearchSecretsSslKey1 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey1 +func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey1() (NewOutputElasticsearchSecretsSslKey1, error) { + var body NewOutputElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey1 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey1 +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) 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 NewOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputElasticsearch_Secrets_Ssl_Key) 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 @@ -11317,6 +12362,68 @@ func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } +// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0() (NewOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body NewOutputRemoteElasticsearchSecretsKibanaApiKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1() (NewOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body NewOutputRemoteElasticsearchSecretsKibanaApiKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -11379,6 +12486,68 @@ func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []by return err } +// AsNewOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey0 +func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey0() (NewOutputRemoteElasticsearchSecretsSslKey0, error) { + var body NewOutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey0 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey1 +func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey1() (NewOutputRemoteElasticsearchSecretsSslKey1, error) { + var body NewOutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey1 +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 @@ -11438,15 +12607,898 @@ func (t NewOutputUnion) AsNewOutputLogstash() (NewOutputLogstash, error) { return body, err } -// FromNewOutputLogstash overwrites any union data inside the NewOutputUnion as the provided NewOutputLogstash -func (t *NewOutputUnion) FromNewOutputLogstash(v NewOutputLogstash) error { +// 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 +} + +// AsOutputElasticsearchSecretsSslKey0 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey0 +func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey0() (OutputElasticsearchSecretsSslKey0, error) { + var body OutputElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearchSecretsSslKey0 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey0 +func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey0 +func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputElasticsearchSecretsSslKey1 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey1 +func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey1() (OutputElasticsearchSecretsSslKey1, error) { + var body OutputElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearchSecretsSslKey1 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey1 +func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey1 +func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) 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 OutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputElasticsearch_Secrets_Ssl_Key) 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 +} + +// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 +} + +// AsOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey0 +func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey0() (OutputRemoteElasticsearchSecretsSslKey0, error) { + var body OutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey0 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey0 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey1 +func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey1() (OutputRemoteElasticsearchSecretsSslKey1, error) { + var body OutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey1 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey1 +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) 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 +} + +// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { + var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { + var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) 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 PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageInfoInstallationInfoInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType0 +func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType0() (PackageInfoInstallationInfoInstalledKibanaType0, error) { + var body PackageInfoInstallationInfoInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType0 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoInstallationInfoInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType1 +func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType1() (PackageInfoInstallationInfoInstalledKibanaType1, error) { + var body PackageInfoInstallationInfoInstalledKibanaType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType1 +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) 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 PackageInfo_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageInfoType0 returns the union data inside the PackageInfo_Type as a PackageInfoType0 +func (t PackageInfo_Type) AsPackageInfoType0() (PackageInfoType0, error) { + var body PackageInfoType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType0 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType0 +func (t *PackageInfo_Type) FromPackageInfoType0(v PackageInfoType0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType0 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType0 +func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType1 returns the union data inside the PackageInfo_Type as a PackageInfoType1 +func (t PackageInfo_Type) AsPackageInfoType1() (PackageInfoType1, error) { + var body PackageInfoType1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType1 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType1 +func (t *PackageInfo_Type) FromPackageInfoType1(v PackageInfoType1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType1 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType1 +func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType2 returns the union data inside the PackageInfo_Type as a PackageInfoType2 +func (t PackageInfo_Type) AsPackageInfoType2() (PackageInfoType2, error) { + var body PackageInfoType2 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType2 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType2 +func (t *PackageInfo_Type) FromPackageInfoType2(v PackageInfoType2) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType2 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType2 +func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageInfoType3 returns the union data inside the PackageInfo_Type as a PackageInfoType3 +func (t PackageInfo_Type) AsPackageInfoType3() (PackageInfoType3, error) { + var body PackageInfoType3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageInfoType3 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType3 +func (t *PackageInfo_Type) FromPackageInfoType3(v PackageInfoType3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageInfoType3 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType3 +func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) 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 PackageInfo_Type) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageInfo_Type) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { + var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) 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 { +// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11457,22 +13509,22 @@ func (t *NewOutputUnion) MergeNewOutputLogstash(v NewOutputLogstash) error { return err } -// AsNewOutputKafka returns the union data inside the NewOutputUnion as a NewOutputKafka -func (t NewOutputUnion) AsNewOutputKafka() (NewOutputKafka, error) { - var body NewOutputKafka +// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { + var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 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 { +// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) 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 { +// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11483,32 +13535,32 @@ func (t *NewOutputUnion) MergeNewOutputKafka(v NewOutputKafka) error { return err } -func (t NewOutputUnion) MarshalJSON() ([]byte, error) { +func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { +func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) 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 +// AsPackageListItemInstallationInfoInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType0 +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType0() (PackageListItemInstallationInfoInstalledKibanaType0, error) { + var body PackageListItemInstallationInfoInstalledKibanaType0 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 { +// FromPackageListItemInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) 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 { +// MergePackageListItemInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType0 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11519,22 +13571,22 @@ func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword0(v Output 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 +// AsPackageListItemInstallationInfoInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType1 +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType1() (PackageListItemInstallationInfoInstalledKibanaType1, error) { + var body PackageListItemInstallationInfoInstalledKibanaType1 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 { +// FromPackageListItemInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) 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 { +// MergePackageListItemInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType1 +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11545,32 +13597,32 @@ func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword1(v Output return err } -func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { +func (t PackageListItem_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { +func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) 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 +// AsPackageListItemType0 returns the union data inside the PackageListItem_Type as a PackageListItemType0 +func (t PackageListItem_Type) AsPackageListItemType0() (PackageListItemType0, error) { + var body PackageListItemType0 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 { +// FromPackageListItemType0 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType0 +func (t *PackageListItem_Type) FromPackageListItemType0(v PackageListItemType0) 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 { +// MergePackageListItemType0 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType0 +func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11581,22 +13633,22 @@ func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey0(v OutputKaf 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 +// AsPackageListItemType1 returns the union data inside the PackageListItem_Type as a PackageListItemType1 +func (t PackageListItem_Type) AsPackageListItemType1() (PackageListItemType1, error) { + var body PackageListItemType1 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 { +// FromPackageListItemType1 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType1 +func (t *PackageListItem_Type) FromPackageListItemType1(v PackageListItemType1) 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 { +// MergePackageListItemType1 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType1 +func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11607,32 +13659,22 @@ func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey1(v OutputKaf 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 +// AsPackageListItemType2 returns the union data inside the PackageListItem_Type as a PackageListItemType2 +func (t PackageListItem_Type) AsPackageListItemType2() (PackageListItemType2, error) { + var body PackageListItemType2 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 { +// FromPackageListItemType2 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType2 +func (t *PackageListItem_Type) FromPackageListItemType2(v PackageListItemType2) 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 { +// MergePackageListItemType2 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType2 +func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) error { b, err := json.Marshal(v) if err != nil { return err @@ -11643,22 +13685,22 @@ func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey0(v Out 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 +// AsPackageListItemType3 returns the union data inside the PackageListItem_Type as a PackageListItemType3 +func (t PackageListItem_Type) AsPackageListItemType3() (PackageListItemType3, error) { + var body PackageListItemType3 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 { +// FromPackageListItemType3 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType3 +func (t *PackageListItem_Type) FromPackageListItemType3(v PackageListItemType3) 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 { +// MergePackageListItemType3 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType3 +func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) error { b, err := json.Marshal(v) if err != nil { return err @@ -11669,32 +13711,32 @@ func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey1(v Out return err } -func (t OutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { +func (t PackageListItem_Type) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { +func (t *PackageListItem_Type) 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 +// AsServerHostSecretsSslEsKey0 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey0 +func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey0() (ServerHostSecretsSslEsKey0, error) { + var body ServerHostSecretsSslEsKey0 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 { +// FromServerHostSecretsSslEsKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey0 +func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) 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 { +// MergeServerHostSecretsSslEsKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey0 +func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11705,22 +13747,22 @@ func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasti 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 +// AsServerHostSecretsSslEsKey1 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey1 +func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey1() (ServerHostSecretsSslEsKey1, error) { + var body ServerHostSecretsSslEsKey1 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 { +// FromServerHostSecretsSslEsKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey1 +func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) 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 { +// MergeServerHostSecretsSslEsKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey1 +func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11731,34 +13773,32 @@ func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasti return err } -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { +func (t ServerHost_Secrets_Ssl_EsKey) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { +func (t *ServerHost_Secrets_Ssl_EsKey) 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 +// AsServerHostSecretsSslKey0 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey0 +func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey0() (ServerHostSecretsSslKey0, error) { + var body ServerHostSecretsSslKey0 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" +// FromServerHostSecretsSslKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey0 +func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { 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" +// MergeServerHostSecretsSslKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey0 +func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11769,24 +13809,22 @@ func (t *OutputUnion) MergeOutputElasticsearch(v OutputElasticsearch) error { return err } -// AsOutputRemoteElasticsearch returns the union data inside the OutputUnion as a OutputRemoteElasticsearch -func (t OutputUnion) AsOutputRemoteElasticsearch() (OutputRemoteElasticsearch, error) { - var body OutputRemoteElasticsearch +// AsServerHostSecretsSslKey1 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey1 +func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey1() (ServerHostSecretsSslKey1, error) { + var body ServerHostSecretsSslKey1 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" +// FromServerHostSecretsSslKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey1 +func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { 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" +// MergeServerHostSecretsSslKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey1 +func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11797,24 +13835,32 @@ func (t *OutputUnion) MergeOutputRemoteElasticsearch(v OutputRemoteElasticsearch return err } -// AsOutputLogstash returns the union data inside the OutputUnion as a OutputLogstash -func (t OutputUnion) AsOutputLogstash() (OutputLogstash, error) { - var body OutputLogstash +func (t ServerHost_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ServerHost_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUpdateOutputElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey0 +func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey0() (UpdateOutputElasticsearchSecretsSslKey0, error) { + var body UpdateOutputElasticsearchSecretsSslKey0 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" +// FromUpdateOutputElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey0 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { 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" +// MergeUpdateOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey0 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -11825,24 +13871,22 @@ func (t *OutputUnion) MergeOutputLogstash(v OutputLogstash) error { return err } -// AsOutputKafka returns the union data inside the OutputUnion as a OutputKafka -func (t OutputUnion) AsOutputKafka() (OutputKafka, error) { - var body OutputKafka +// AsUpdateOutputElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey1 +func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey1() (UpdateOutputElasticsearchSecretsSslKey1, error) { + var body UpdateOutputElasticsearchSecretsSslKey1 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" +// FromUpdateOutputElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey1 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { 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" +// MergeUpdateOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey1 +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -11853,39 +13897,12 @@ func (t *OutputUnion) MergeOutputKafka(v OutputKafka) error { 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) { +func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *OutputUnion) UnmarshalJSON(b []byte) error { +func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } @@ -12076,6 +14093,68 @@ func (t *UpdateOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } +// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -12138,6 +14217,68 @@ func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b [ return err } +// AsUpdateOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey0 +func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey0() (UpdateOutputRemoteElasticsearchSecretsSslKey0, error) { + var body UpdateOutputRemoteElasticsearchSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey1 +func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey1() (UpdateOutputRemoteElasticsearchSecretsSslKey1, error) { + var body UpdateOutputRemoteElasticsearchSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 @@ -15046,9 +17187,10 @@ type GetFleetAgentPoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15075,9 +17217,10 @@ type PostFleetAgentPoliciesResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15105,9 +17248,10 @@ type PostFleetAgentPoliciesDeleteResponse struct { Name string `json:"name"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15134,9 +17278,10 @@ type GetFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15163,9 +17308,10 @@ type PutFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15214,9 +17360,10 @@ type GetFleetEnrollmentApiKeysResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15243,9 +17390,10 @@ type GetFleetEpmPackagesResponse struct { Items []PackageListItem `json:"items"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15293,17 +17441,22 @@ type DeleteFleetEpmPackagesPkgnamePkgversionResponse struct { Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type DeleteFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` +} +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type0 string +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string +type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { + union json.RawMessage } -type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type string type DeleteFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -15341,9 +17494,10 @@ type GetFleetEpmPackagesPkgnamePkgversionResponse struct { } `json:"metadata,omitempty"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15373,17 +17527,22 @@ type PostFleetEpmPackagesPkgnamePkgversionResponse struct { Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type PostFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PostFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` +} +type PostFleetEpmPackagesPkgnamePkgversion200Items0Type0 string +type PostFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string +type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { + union json.RawMessage } -type PostFleetEpmPackagesPkgnamePkgversion200Items0Type string type PostFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -15421,9 +17580,10 @@ type GetFleetFleetServerHostsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15450,9 +17610,10 @@ type PostFleetFleetServerHostsResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15479,9 +17640,10 @@ type DeleteFleetFleetServerHostsItemidResponse struct { Id string `json:"id"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15508,9 +17670,10 @@ type GetFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15537,9 +17700,10 @@ type PutFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15569,9 +17733,10 @@ type GetFleetOutputsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15598,9 +17763,10 @@ type PostFleetOutputsResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15627,14 +17793,16 @@ type DeleteFleetOutputsOutputidResponse struct { Id string `json:"id"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + 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"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15661,9 +17829,10 @@ type GetFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15690,9 +17859,10 @@ type PutFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15722,9 +17892,10 @@ type GetFleetPackagePoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15751,14 +17922,16 @@ type PostFleetPackagePoliciesResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + 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"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15785,9 +17958,10 @@ type DeleteFleetPackagePoliciesPackagepolicyidResponse struct { Id string `json:"id"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -15814,9 +17988,10 @@ type GetFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON404 *struct { Message string `json:"message"` @@ -15846,14 +18021,16 @@ type PutFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Attributes interface{} `json:"attributes"` + 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"` + Attributes interface{} `json:"attributes"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -16392,9 +18569,10 @@ func ParseGetFleetAgentPoliciesResponse(rsp *http.Response) (*GetFleetAgentPolic 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16431,9 +18609,10 @@ func ParsePostFleetAgentPoliciesResponse(rsp *http.Response) (*PostFleetAgentPol 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16471,9 +18650,10 @@ func ParsePostFleetAgentPoliciesDeleteResponse(rsp *http.Response) (*PostFleetAg 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16510,9 +18690,10 @@ func ParseGetFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*GetFl 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16549,9 +18730,10 @@ func ParsePutFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*PutFl 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16610,9 +18792,10 @@ func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnroll 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16649,9 +18832,10 @@ func ParseGetFleetEpmPackagesResponse(rsp *http.Response) (*GetFleetEpmPackagesR 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16704,9 +18888,10 @@ func ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (* 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16746,9 +18931,10 @@ func ParseGetFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Get 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16788,9 +18974,10 @@ func ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Po 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16830,9 +19017,10 @@ func ParseGetFleetFleetServerHostsResponse(rsp *http.Response) (*GetFleetFleetSe 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16869,9 +19057,10 @@ func ParsePostFleetFleetServerHostsResponse(rsp *http.Response) (*PostFleetFleet 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16908,9 +19097,10 @@ func ParseDeleteFleetFleetServerHostsItemidResponse(rsp *http.Response) (*Delete 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16947,9 +19137,10 @@ func ParseGetFleetFleetServerHostsItemidResponse(rsp *http.Response) (*GetFleetF 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -16986,9 +19177,10 @@ func ParsePutFleetFleetServerHostsItemidResponse(rsp *http.Response) (*PutFleetF 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17028,9 +19220,10 @@ func ParseGetFleetOutputsResponse(rsp *http.Response) (*GetFleetOutputsResponse, 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17067,9 +19260,10 @@ func ParsePostFleetOutputsResponse(rsp *http.Response) (*PostFleetOutputsRespons 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17106,9 +19300,10 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17117,9 +19312,10 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17156,9 +19352,10 @@ func ParseGetFleetOutputsOutputidResponse(rsp *http.Response) (*GetFleetOutputsO 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17195,9 +19392,10 @@ func ParsePutFleetOutputsOutputidResponse(rsp *http.Response) (*PutFleetOutputsO 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17237,9 +19435,10 @@ func ParseGetFleetPackagePoliciesResponse(rsp *http.Response) (*GetFleetPackageP 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17276,9 +19475,10 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17287,9 +19487,10 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17326,9 +19527,10 @@ func ParseDeleteFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17365,9 +19567,10 @@ func ParseGetFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*G 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17413,9 +19616,10 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P 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"` + Attributes interface{} `json:"attributes"` + 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 @@ -17424,9 +19628,10 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P 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"` + Attributes interface{} `json:"attributes"` + 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 diff --git a/generated/kbapi/transform_schema.go b/generated/kbapi/transform_schema.go index 240f99a06..54b5cc395 100644 --- a/generated/kbapi/transform_schema.go +++ b/generated/kbapi/transform_schema.go @@ -837,10 +837,8 @@ func transformFleetPaths(schema *Schema) { 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) } - - // do global_data_tags refs schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") - // Define the value types for the GlobalDataTags + schema.Components.Set("schemas.agent_policy_global_data_tags_item", Map{ "type": "object", "properties": Map{ @@ -855,6 +853,7 @@ func transformFleetPaths(schema *Schema) { "required": []string{"name", "value"}, }) + // Define the value types for the GlobalDataTags agentPoliciesPath.Post.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") agentPolicyPath.Put.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") From 704998a0977e0b422dea514178d26e7140db189b Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Tue, 4 Mar 2025 23:19:27 -0500 Subject: [PATCH 61/89] using elastic/kibana 4f38cf96d24a66c98ac6dbaede2a9b92fa460b75 to generate kibana.gen.go --- generated/kbapi/kibana.gen.go | 3039 ++++++--------------------- generated/kbapi/transform_schema.go | 15 +- 2 files changed, 600 insertions(+), 2454 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index c212b610d..b8608bc75 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -218,20 +218,20 @@ const ( OutputSslVerificationModeStrict OutputSslVerificationMode = "strict" ) -// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0. +// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType. const ( - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" + 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. @@ -261,20 +261,20 @@ const ( PackageInfoInstallationInfoInstalledEsTypeTransform PackageInfoInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageInfoInstallationInfoInstalledKibanaType0. +// Defines values for PackageInfoInstallationInfoInstalledKibanaType. const ( - PackageInfoInstallationInfoInstalledKibanaType0CspRuleTemplate PackageInfoInstallationInfoInstalledKibanaType0 = "csp-rule-template" - PackageInfoInstallationInfoInstalledKibanaType0Dashboard PackageInfoInstallationInfoInstalledKibanaType0 = "dashboard" - PackageInfoInstallationInfoInstalledKibanaType0IndexPattern PackageInfoInstallationInfoInstalledKibanaType0 = "index-pattern" - PackageInfoInstallationInfoInstalledKibanaType0Lens PackageInfoInstallationInfoInstalledKibanaType0 = "lens" - PackageInfoInstallationInfoInstalledKibanaType0Map PackageInfoInstallationInfoInstalledKibanaType0 = "map" - PackageInfoInstallationInfoInstalledKibanaType0MlModule PackageInfoInstallationInfoInstalledKibanaType0 = "ml-module" - PackageInfoInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" - PackageInfoInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageInfoInstallationInfoInstalledKibanaType0 = "osquery-saved-query" - PackageInfoInstallationInfoInstalledKibanaType0Search PackageInfoInstallationInfoInstalledKibanaType0 = "search" - PackageInfoInstallationInfoInstalledKibanaType0SecurityRule PackageInfoInstallationInfoInstalledKibanaType0 = "security-rule" - PackageInfoInstallationInfoInstalledKibanaType0Tag PackageInfoInstallationInfoInstalledKibanaType0 = "tag" - PackageInfoInstallationInfoInstalledKibanaType0Visualization PackageInfoInstallationInfoInstalledKibanaType0 = "visualization" + 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. @@ -298,35 +298,27 @@ const ( PackageInfoReleaseGa PackageInfoRelease = "ga" ) -// Defines values for PackageInfoType0. +// Defines values for PackageInfoType. const ( - PackageInfoType0Integration PackageInfoType0 = "integration" + PackageInfoTypeContent PackageInfoType = "content" + PackageInfoTypeInput PackageInfoType = "input" + PackageInfoTypeIntegration PackageInfoType = "integration" ) -// Defines values for PackageInfoType1. +// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType. const ( - PackageInfoType1Input PackageInfoType1 = "input" -) - -// Defines values for PackageInfoType2. -const ( - PackageInfoType2Content PackageInfoType2 = "content" -) - -// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0. -const ( - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "csp-rule-template" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Dashboard PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "dashboard" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0IndexPattern PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "index-pattern" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Lens PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "lens" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Map PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "map" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0MlModule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "ml-module" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-pack-asset" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "osquery-saved-query" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Search PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "search" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0SecurityRule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "security-rule" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Tag PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "tag" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0Visualization PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 = "visualization" + 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. @@ -356,20 +348,20 @@ const ( PackageListItemInstallationInfoInstalledEsTypeTransform PackageListItemInstallationInfoInstalledEsType = "transform" ) -// Defines values for PackageListItemInstallationInfoInstalledKibanaType0. +// Defines values for PackageListItemInstallationInfoInstalledKibanaType. const ( - PackageListItemInstallationInfoInstalledKibanaType0CspRuleTemplate PackageListItemInstallationInfoInstalledKibanaType0 = "csp-rule-template" - PackageListItemInstallationInfoInstalledKibanaType0Dashboard PackageListItemInstallationInfoInstalledKibanaType0 = "dashboard" - PackageListItemInstallationInfoInstalledKibanaType0IndexPattern PackageListItemInstallationInfoInstalledKibanaType0 = "index-pattern" - PackageListItemInstallationInfoInstalledKibanaType0Lens PackageListItemInstallationInfoInstalledKibanaType0 = "lens" - PackageListItemInstallationInfoInstalledKibanaType0Map PackageListItemInstallationInfoInstalledKibanaType0 = "map" - PackageListItemInstallationInfoInstalledKibanaType0MlModule PackageListItemInstallationInfoInstalledKibanaType0 = "ml-module" - PackageListItemInstallationInfoInstalledKibanaType0OsqueryPackAsset PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-pack-asset" - PackageListItemInstallationInfoInstalledKibanaType0OsquerySavedQuery PackageListItemInstallationInfoInstalledKibanaType0 = "osquery-saved-query" - PackageListItemInstallationInfoInstalledKibanaType0Search PackageListItemInstallationInfoInstalledKibanaType0 = "search" - PackageListItemInstallationInfoInstalledKibanaType0SecurityRule PackageListItemInstallationInfoInstalledKibanaType0 = "security-rule" - PackageListItemInstallationInfoInstalledKibanaType0Tag PackageListItemInstallationInfoInstalledKibanaType0 = "tag" - PackageListItemInstallationInfoInstalledKibanaType0Visualization PackageListItemInstallationInfoInstalledKibanaType0 = "visualization" + 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. @@ -393,26 +385,11 @@ const ( Ga PackageListItemRelease = "ga" ) -// Defines values for PackageListItemType0. -const ( - PackageListItemType0Integration PackageListItemType0 = "integration" -) - -// Defines values for PackageListItemType1. -const ( - PackageListItemType1Input PackageListItemType1 = "input" -) - -// Defines values for PackageListItemType2. +// Defines values for PackageListItemType. const ( - PackageListItemType2Content PackageListItemType2 = "content" -) - -// Defines values for ServerHostSslClientAuth. -const ( - ServerHostSslClientAuthNone ServerHostSslClientAuth = "none" - ServerHostSslClientAuthOptional ServerHostSslClientAuth = "optional" - ServerHostSslClientAuthRequired ServerHostSslClientAuth = "required" + PackageListItemTypeContent PackageListItemType = "content" + PackageListItemTypeInput PackageListItemType = "input" + PackageListItemTypeIntegration PackageListItemType = "integration" ) // Defines values for UpdateOutputElasticsearchPreset. @@ -492,10 +469,10 @@ const ( // Defines values for UpdateOutputSslVerificationMode. const ( - UpdateOutputSslVerificationModeCertificate UpdateOutputSslVerificationMode = "certificate" - UpdateOutputSslVerificationModeFull UpdateOutputSslVerificationMode = "full" - UpdateOutputSslVerificationModeNone UpdateOutputSslVerificationMode = "none" - UpdateOutputSslVerificationModeStrict UpdateOutputSslVerificationMode = "strict" + Certificate UpdateOutputSslVerificationMode = "certificate" + Full UpdateOutputSslVerificationMode = "full" + None UpdateOutputSslVerificationMode = "none" + Strict UpdateOutputSslVerificationMode = "strict" ) // Defines values for GetFleetAgentPoliciesParamsSortOrder. @@ -536,20 +513,6 @@ const ( Traces PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled = "traces" ) -// Defines values for PostFleetFleetServerHostsJSONBodySslClientAuth. -const ( - PostFleetFleetServerHostsJSONBodySslClientAuthNone PostFleetFleetServerHostsJSONBodySslClientAuth = "none" - PostFleetFleetServerHostsJSONBodySslClientAuthOptional PostFleetFleetServerHostsJSONBodySslClientAuth = "optional" - PostFleetFleetServerHostsJSONBodySslClientAuthRequired PostFleetFleetServerHostsJSONBodySslClientAuth = "required" -) - -// Defines values for PutFleetFleetServerHostsItemidJSONBodySslClientAuth. -const ( - PutFleetFleetServerHostsItemidJSONBodySslClientAuthNone PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "none" - PutFleetFleetServerHostsItemidJSONBodySslClientAuthOptional PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "optional" - PutFleetFleetServerHostsItemidJSONBodySslClientAuthRequired PutFleetFleetServerHostsItemidJSONBodySslClientAuth = "required" -) - // Defines values for GetFleetPackagePoliciesParamsSortOrder. const ( GetFleetPackagePoliciesParamsSortOrderAsc GetFleetPackagePoliciesParamsSortOrder = "asc" @@ -829,23 +792,6 @@ type DataViewsUpdateDataViewRequestObjectInner struct { TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` } -// FleetAgentPolicyGlobalDataTagsItem defines model for Fleet_agent_policy_global_data_tags_item. -type FleetAgentPolicyGlobalDataTagsItem struct { - Name string `json:"name"` - Value FleetAgentPolicyGlobalDataTagsItem_Value `json:"value"` -} - -// FleetAgentPolicyGlobalDataTagsItemValue0 defines model for . -type FleetAgentPolicyGlobalDataTagsItemValue0 = string - -// FleetAgentPolicyGlobalDataTagsItemValue1 defines model for . -type FleetAgentPolicyGlobalDataTagsItemValue1 = float32 - -// FleetAgentPolicyGlobalDataTagsItem_Value defines model for FleetAgentPolicyGlobalDataTagsItem.Value. -type FleetAgentPolicyGlobalDataTagsItem_Value struct { - union json.RawMessage -} - // AgentPolicy defines model for agent_policy. type AgentPolicy struct { AdvancedSettings *struct { @@ -878,14 +824,14 @@ type AgentPolicy struct { 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 *[]FleetAgentPolicyGlobalDataTagsItem `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"` + GlobalDataTags *[]AgentPolicyGlobalDataTagsItem `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"` @@ -949,11 +895,9 @@ 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 { - // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -1268,32 +1212,14 @@ type NewOutputElasticsearch struct { Name string `json:"name"` Preset *NewOutputElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - Key *NewOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Type NewOutputElasticsearchType `json:"type"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Type NewOutputElasticsearchType `json:"type"` } // NewOutputElasticsearchPreset defines model for NewOutputElasticsearch.Preset. type NewOutputElasticsearchPreset string -// NewOutputElasticsearchSecretsSslKey0 defines model for . -type NewOutputElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// NewOutputElasticsearchSecretsSslKey1 defines model for . -type NewOutputElasticsearchSecretsSslKey1 = string - -// NewOutputElasticsearch_Secrets_Ssl_Key defines model for NewOutputElasticsearch.Secrets.Ssl.Key. -type NewOutputElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // NewOutputElasticsearchType defines model for NewOutputElasticsearch.Type. type NewOutputElasticsearchType string @@ -1457,9 +1383,6 @@ type NewOutputRemoteElasticsearch struct { Secrets *struct { KibanaApiKey *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *NewOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - Ssl *struct { - Key *NewOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` ServiceToken *string `json:"service_token"` Shipper *NewOutputShipper `json:"shipper,omitempty"` @@ -1497,19 +1420,6 @@ type NewOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } -// NewOutputRemoteElasticsearchSecretsSslKey0 defines model for . -type NewOutputRemoteElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// NewOutputRemoteElasticsearchSecretsSslKey1 defines model for . -type NewOutputRemoteElasticsearchSecretsSslKey1 = string - -// NewOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for NewOutputRemoteElasticsearch.Secrets.Ssl.Key. -type NewOutputRemoteElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // NewOutputRemoteElasticsearchType defines model for NewOutputRemoteElasticsearch.Type. type NewOutputRemoteElasticsearchType string @@ -1545,55 +1455,28 @@ type NewOutputUnion struct { // 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"` - Secrets *OutputElasticsearch_Secrets `json:"secrets,omitempty"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` - Type OutputElasticsearchType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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 -// OutputElasticsearchSecretsSslKey0 defines model for . -type OutputElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputElasticsearchSecretsSslKey1 defines model for . -type OutputElasticsearchSecretsSslKey1 = string - -// OutputElasticsearch_Secrets_Ssl_Key defines model for OutputElasticsearch.Secrets.Ssl.Key. -type OutputElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// OutputElasticsearch_Secrets_Ssl defines model for OutputElasticsearch.Secrets.Ssl. -type OutputElasticsearch_Secrets_Ssl struct { - Key *OutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputElasticsearch_Secrets defines model for OutputElasticsearch.Secrets. -type OutputElasticsearch_Secrets struct { - Ssl *OutputElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - // OutputElasticsearchType defines model for OutputElasticsearch.Type. type OutputElasticsearchType string @@ -1835,31 +1718,10 @@ type OutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } -// OutputRemoteElasticsearchSecretsSslKey0 defines model for . -type OutputRemoteElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputRemoteElasticsearchSecretsSslKey1 defines model for . -type OutputRemoteElasticsearchSecretsSslKey1 = string - -// OutputRemoteElasticsearch_Secrets_Ssl_Key defines model for OutputRemoteElasticsearch.Secrets.Ssl.Key. -type OutputRemoteElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// OutputRemoteElasticsearch_Secrets_Ssl defines model for OutputRemoteElasticsearch.Secrets.Ssl. -type OutputRemoteElasticsearch_Secrets_Ssl struct { - Key *OutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - // OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. type OutputRemoteElasticsearch_Secrets struct { KibanaApiKey *OutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - Ssl *OutputRemoteElasticsearch_Secrets_Ssl `json:"ssl,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1945,7 +1807,7 @@ type PackageInfo struct { Source *PackageInfo_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageInfo_Type `json:"type,omitempty"` + Type *PackageInfoType `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -1994,23 +1856,15 @@ type PackageInfo_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. -type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 string - -// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . -type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 = string - -// PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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. @@ -2047,30 +1901,22 @@ type PackageInfo_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoInstallationInfoInstalledKibanaType0 defines model for PackageInfo.InstallationInfo.InstalledKibana.Type.0. -type PackageInfoInstallationInfoInstalledKibanaType0 string - -// PackageInfoInstallationInfoInstalledKibanaType1 defines model for . -type PackageInfoInstallationInfoInstalledKibanaType1 = string - -// PackageInfo_InstallationInfo_InstalledKibana_Type defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. -type PackageInfo_InstallationInfo_InstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageInfo_InstallationInfo_InstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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,omitempty"` - StartedAt *string `json:"started_at,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2135,22 +1981,8 @@ type PackageInfo_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageInfoType0 defines model for PackageInfo.Type.0. -type PackageInfoType0 string - -// PackageInfoType1 defines model for PackageInfo.Type.1. -type PackageInfoType1 string - -// PackageInfoType2 defines model for PackageInfo.Type.2. -type PackageInfoType2 string - -// PackageInfoType3 defines model for . -type PackageInfoType3 = string - -// PackageInfo_Type defines model for PackageInfo.Type. -type PackageInfo_Type struct { - union json.RawMessage -} +// PackageInfoType defines model for PackageInfo.Type. +type PackageInfoType string // PackageListItem defines model for package_list_item. type PackageListItem struct { @@ -2177,7 +2009,7 @@ type PackageListItem struct { Source *PackageListItem_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` Title string `json:"title"` - Type *PackageListItem_Type `json:"type,omitempty"` + Type *PackageListItemType `json:"type,omitempty"` Vars *[]map[string]interface{} `json:"vars,omitempty"` Version string `json:"version"` AdditionalProperties map[string]interface{} `json:"-"` @@ -2226,23 +2058,15 @@ type PackageListItem_Icons_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type.0. -type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 string - -// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 defines model for . -type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 = string - -// PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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. @@ -2279,30 +2103,22 @@ type PackageListItem_InstallationInfo_InstalledEs_Item struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemInstallationInfoInstalledKibanaType0 defines model for PackageListItem.InstallationInfo.InstalledKibana.Type.0. -type PackageListItemInstallationInfoInstalledKibanaType0 string - -// PackageListItemInstallationInfoInstalledKibanaType1 defines model for . -type PackageListItemInstallationInfoInstalledKibanaType1 = string - -// PackageListItem_InstallationInfo_InstalledKibana_Type defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. -type PackageListItem_InstallationInfo_InstalledKibana_Type struct { - union json.RawMessage -} +// 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 PackageListItem_InstallationInfo_InstalledKibana_Type `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` + 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,omitempty"` - StartedAt *string `json:"started_at,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2367,30 +2183,14 @@ type PackageListItem_Source struct { AdditionalProperties map[string]interface{} `json:"-"` } -// PackageListItemType0 defines model for PackageListItem.Type.0. -type PackageListItemType0 string - -// PackageListItemType1 defines model for PackageListItem.Type.1. -type PackageListItemType1 string - -// PackageListItemType2 defines model for PackageListItem.Type.2. -type PackageListItemType2 string - -// PackageListItemType3 defines model for . -type PackageListItemType3 = string - -// PackageListItem_Type defines model for PackageListItem.Type. -type PackageListItem_Type struct { - union json.RawMessage -} +// PackageListItemType defines model for PackageListItem.Type. +type PackageListItemType string // PackagePolicy defines model for package_policy. type PackagePolicy struct { - // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` // Description Package policy description Description *string `json:"description,omitempty"` @@ -2480,11 +2280,9 @@ type PackagePolicyInputStream struct { // PackagePolicyRequest defines model for package_policy_request. type PackagePolicyRequest struct { - // AdditionalDatastreamsPermissions Additional datastream permissions, that will be added to the agent policy. - AdditionalDatastreamsPermissions *[]string `json:"additional_datastreams_permissions"` - Description *string `json:"description,omitempty"` - Force *bool `json:"force,omitempty"` - Id *string `json:"id,omitempty"` + 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"` @@ -2552,52 +2350,8 @@ type ServerHost struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id"` - Secrets *struct { - Ssl *struct { - EsKey *ServerHost_Secrets_Ssl_EsKey `json:"es_key,omitempty"` - Key *ServerHost_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Ssl *struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - ClientAuth *ServerHostSslClientAuth `json:"client_auth,omitempty"` - EsCertificate *string `json:"es_certificate,omitempty"` - EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` - EsKey *string `json:"es_key,omitempty"` - Key *string `json:"key,omitempty"` - } `json:"ssl"` -} - -// ServerHostSecretsSslEsKey0 defines model for . -type ServerHostSecretsSslEsKey0 struct { - Id string `json:"id"` -} - -// ServerHostSecretsSslEsKey1 defines model for . -type ServerHostSecretsSslEsKey1 = string - -// ServerHost_Secrets_Ssl_EsKey defines model for ServerHost.Secrets.Ssl.EsKey. -type ServerHost_Secrets_Ssl_EsKey struct { - union json.RawMessage -} - -// ServerHostSecretsSslKey0 defines model for . -type ServerHostSecretsSslKey0 struct { - Id string `json:"id"` -} - -// ServerHostSecretsSslKey1 defines model for . -type ServerHostSecretsSslKey1 = string - -// ServerHost_Secrets_Ssl_Key defines model for ServerHost.Secrets.Ssl.Key. -type ServerHost_Secrets_Ssl_Key struct { - union json.RawMessage } -// ServerHostSslClientAuth defines model for ServerHost.Ssl.ClientAuth. -type ServerHostSslClientAuth string - // UpdateOutputElasticsearch defines model for update_output_elasticsearch. type UpdateOutputElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` @@ -2612,32 +2366,14 @@ type UpdateOutputElasticsearch struct { Name *string `json:"name,omitempty"` Preset *UpdateOutputElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - Key *UpdateOutputElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputElasticsearchType `json:"type,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 -// UpdateOutputElasticsearchSecretsSslKey0 defines model for . -type UpdateOutputElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputElasticsearchSecretsSslKey1 defines model for . -type UpdateOutputElasticsearchSecretsSslKey1 = string - -// UpdateOutputElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputElasticsearch.Secrets.Ssl.Key. -type UpdateOutputElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. type UpdateOutputElasticsearchType string @@ -2798,9 +2534,6 @@ type UpdateOutputRemoteElasticsearch struct { Secrets *struct { KibanaApiKey *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - Ssl *struct { - Key *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` ServiceToken *string `json:"service_token"` Shipper *UpdateOutputShipper `json:"shipper,omitempty"` @@ -2838,19 +2571,6 @@ type UpdateOutputRemoteElasticsearch_Secrets_ServiceToken struct { union json.RawMessage } -// UpdateOutputRemoteElasticsearchSecretsSslKey0 defines model for . -type UpdateOutputRemoteElasticsearchSecretsSslKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputRemoteElasticsearchSecretsSslKey1 defines model for . -type UpdateOutputRemoteElasticsearchSecretsSslKey1 = string - -// UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key defines model for UpdateOutputRemoteElasticsearch.Secrets.Ssl.Key. -type UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key struct { - union json.RawMessage -} - // UpdateOutputRemoteElasticsearchType defines model for UpdateOutputRemoteElasticsearch.Type. type UpdateOutputRemoteElasticsearchType string @@ -3049,7 +2769,6 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { } `json:"requests,omitempty"` } `json:"resources,omitempty"` } `json:"agentless,omitempty"` - BumpRevision *bool `json:"bumpRevision,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -3175,52 +2894,8 @@ type PostFleetFleetServerHostsJSONBody struct { IsPreconfigured *bool `json:"is_preconfigured,omitempty"` Name string `json:"name"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - EsKey *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` - Key *PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Ssl *struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - ClientAuth *PostFleetFleetServerHostsJSONBodySslClientAuth `json:"client_auth,omitempty"` - EsCertificate *string `json:"es_certificate,omitempty"` - EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` - EsKey *string `json:"es_key,omitempty"` - Key *string `json:"key,omitempty"` - } `json:"ssl"` -} - -// PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslEsKey0 struct { - Id string `json:"id"` -} - -// PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslEsKey1 = string - -// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_EsKey struct { - union json.RawMessage -} - -// PostFleetFleetServerHostsJSONBodySecretsSslKey0 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslKey0 struct { - Id string `json:"id"` -} - -// PostFleetFleetServerHostsJSONBodySecretsSslKey1 defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySecretsSslKey1 = string - -// PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBody_Secrets_Ssl_Key struct { - union json.RawMessage } -// PostFleetFleetServerHostsJSONBodySslClientAuth defines parameters for PostFleetFleetServerHosts. -type PostFleetFleetServerHostsJSONBodySslClientAuth string - // PutFleetFleetServerHostsItemidJSONBody defines parameters for PutFleetFleetServerHostsItemid. type PutFleetFleetServerHostsItemidJSONBody struct { HostUrls *[]string `json:"host_urls,omitempty"` @@ -3228,52 +2903,8 @@ type PutFleetFleetServerHostsItemidJSONBody struct { IsInternal *bool `json:"is_internal,omitempty"` Name *string `json:"name,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - EsKey *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey `json:"es_key,omitempty"` - Key *PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Ssl *struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - ClientAuth *PutFleetFleetServerHostsItemidJSONBodySslClientAuth `json:"client_auth,omitempty"` - EsCertificate *string `json:"es_certificate,omitempty"` - EsCertificateAuthorities *[]string `json:"es_certificate_authorities,omitempty"` - EsKey *string `json:"es_key,omitempty"` - Key *string `json:"key,omitempty"` - } `json:"ssl"` -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey0 struct { - Id string `json:"id"` -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslEsKey1 = string - -// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_EsKey struct { - union json.RawMessage -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey0 struct { - Id string `json:"id"` -} - -// PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySecretsSslKey1 = string - -// PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBody_Secrets_Ssl_Key struct { - union json.RawMessage } -// PutFleetFleetServerHostsItemidJSONBodySslClientAuth defines parameters for PutFleetFleetServerHostsItemid. -type PutFleetFleetServerHostsItemidJSONBodySslClientAuth string - // GetFleetPackagePoliciesParams defines parameters for GetFleetPackagePolicies. type GetFleetPackagePoliciesParams struct { Page *float32 `form:"page,omitempty" json:"page,omitempty"` @@ -3622,14 +3253,6 @@ func (a *OutputElasticsearch) UnmarshalJSON(b []byte) error { 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 { @@ -3760,13 +3383,6 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { } } - 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 { @@ -3795,271 +3411,69 @@ func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputElasticsearchSecretsSslKey0. Returns the specified +// Getter for additional properties for OutputKafka. Returns the specified // element and whether it was found -func (a OutputElasticsearchSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { +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 OutputElasticsearchSecretsSslKey0 -func (a *OutputElasticsearchSecretsSslKey0) Set(fieldName string, value interface{}) { +// 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 OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a *OutputElasticsearchSecretsSslKey0) UnmarshalJSON(b []byte) error { +// 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["id"]; found { - err = json.Unmarshal(raw, &a.Id) + if raw, found := object["allow_edit"]; found { + err = json.Unmarshal(raw, &a.AllowEdit) if err != nil { - return fmt.Errorf("error reading 'id': %w", err) + return fmt.Errorf("error reading 'allow_edit': %w", err) } - delete(object, "id") + delete(object, "allow_edit") } - 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 + 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") } - return nil -} - -// Override default JSON handling for OutputElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a OutputElasticsearchSecretsSslKey0) 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 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") } - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) + if raw, found := object["ca_sha256"]; found { + err = json.Unmarshal(raw, &a.CaSha256) if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + return fmt.Errorf("error reading 'ca_sha256': %w", err) } + delete(object, "ca_sha256") } - return json.Marshal(object) -} -// Getter for additional properties for OutputElasticsearch_Secrets_Ssl. Returns the specified -// element and whether it was found -func (a OutputElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputElasticsearch_Secrets_Ssl -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a OutputElasticsearch_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 OutputElasticsearch_Secrets. Returns the specified -// element and whether it was found -func (a OutputElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputElasticsearch_Secrets -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties -func (a *OutputElasticsearch_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 OutputElasticsearch_Secrets to handle AdditionalProperties -func (a OutputElasticsearch_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 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["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 { @@ -6189,37 +5603,45 @@ func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, er return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearchSecretsSslKey0. Returns the specified +// Getter for additional properties for OutputRemoteElasticsearch_Secrets. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearchSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { +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 OutputRemoteElasticsearchSecretsSslKey0 -func (a *OutputRemoteElasticsearchSecretsSslKey0) Set(fieldName string, value interface{}) { +// 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 OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a *OutputRemoteElasticsearchSecretsSslKey0) UnmarshalJSON(b []byte) error { +// 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["id"]; found { - err = json.Unmarshal(raw, &a.Id) + if raw, found := object["kibana_api_key"]; found { + err = json.Unmarshal(raw, &a.KibanaApiKey) if err != nil { - return fmt.Errorf("error reading 'id': %w", err) + return fmt.Errorf("error reading 'kibana_api_key': %w", err) } - delete(object, "id") + delete(object, "kibana_api_key") + } + + 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 { @@ -6236,14 +5658,23 @@ func (a *OutputRemoteElasticsearchSecretsSslKey0) UnmarshalJSON(b []byte) error return nil } -// Override default JSON handling for OutputRemoteElasticsearchSecretsSslKey0 to handle AdditionalProperties -func (a OutputRemoteElasticsearchSecretsSslKey0) MarshalJSON() ([]byte, error) { +// 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) - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) + if a.KibanaApiKey != nil { + object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana_api_key': %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) + } } for fieldName, field := range a.AdditionalProperties { @@ -6255,211 +5686,45 @@ func (a OutputRemoteElasticsearchSecretsSslKey0) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearch_Secrets_Ssl. Returns the specified +// Getter for additional properties for OutputShipper. Returns the specified // element and whether it was found -func (a OutputRemoteElasticsearch_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { +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 OutputRemoteElasticsearch_Secrets_Ssl -func (a *OutputRemoteElasticsearch_Secrets_Ssl) Set(fieldName string, value interface{}) { +// 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 OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a *OutputRemoteElasticsearch_Secrets_Ssl) UnmarshalJSON(b []byte) error { +// 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["key"]; found { - err = json.Unmarshal(raw, &a.Key) + if raw, found := object["compression_level"]; found { + err = json.Unmarshal(raw, &a.CompressionLevel) 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 fmt.Errorf("error reading 'compression_level': %w", err) } + delete(object, "compression_level") } - return nil -} - -// Override default JSON handling for OutputRemoteElasticsearch_Secrets_Ssl to handle AdditionalProperties -func (a OutputRemoteElasticsearch_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 raw, found := object["disk_queue_compression_enabled"]; found { + err = json.Unmarshal(raw, &a.DiskQueueCompressionEnabled) if err != nil { - return nil, fmt.Errorf("error marshaling 'key': %w", err) + return fmt.Errorf("error reading 'disk_queue_compression_enabled': %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["kibana_api_key"]; found { - err = json.Unmarshal(raw, &a.KibanaApiKey) - if err != nil { - return fmt.Errorf("error reading 'kibana_api_key': %w", err) - } - delete(object, "kibana_api_key") - } - - 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["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 OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.KibanaApiKey != nil { - object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_api_key': %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.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 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") + delete(object, "disk_queue_compression_enabled") } if raw, found := object["disk_queue_enabled"]; found { @@ -8332,18 +7597,14 @@ func (a PackageInfo_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, } } - if a.Name != nil { - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) } - if a.StartedAt != nil { - object["started_at"], err = json.Marshal(a.StartedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'started_at': %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 { @@ -10505,18 +9766,14 @@ func (a PackageListItem_InstallationInfo_LatestExecutedState) MarshalJSON() ([]b } } - if a.Name != nil { - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) } - if a.StartedAt != nil { - object["started_at"], err = json.Marshal(a.StartedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'started_at': %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 { @@ -11306,68 +10563,6 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// AsFleetAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue0 -func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue0() (FleetAgentPolicyGlobalDataTagsItemValue0, error) { - var body FleetAgentPolicyGlobalDataTagsItemValue0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromFleetAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue0 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeFleetAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue0 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue0(v FleetAgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsFleetAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as a FleetAgentPolicyGlobalDataTagsItemValue1 -func (t FleetAgentPolicyGlobalDataTagsItem_Value) AsFleetAgentPolicyGlobalDataTagsItemValue1() (FleetAgentPolicyGlobalDataTagsItemValue1, error) { - var body FleetAgentPolicyGlobalDataTagsItemValue1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromFleetAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value as the provided FleetAgentPolicyGlobalDataTagsItemValue1 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) FromFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeFleetAgentPolicyGlobalDataTagsItemValue1 performs a merge with any union data inside the FleetAgentPolicyGlobalDataTagsItem_Value, using the provided FleetAgentPolicyGlobalDataTagsItemValue1 -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) MergeFleetAgentPolicyGlobalDataTagsItemValue1(v FleetAgentPolicyGlobalDataTagsItemValue1) 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 FleetAgentPolicyGlobalDataTagsItem_Value) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *FleetAgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - // AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 @@ -12114,68 +11309,6 @@ func (t *AgentPolicyGlobalDataTagsItem_Value) UnmarshalJSON(b []byte) error { return err } -// AsNewOutputElasticsearchSecretsSslKey0 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey0 -func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey0() (NewOutputElasticsearchSecretsSslKey0, error) { - var body NewOutputElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey0 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey0 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey0(v NewOutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputElasticsearchSecretsSslKey1 returns the union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as a NewOutputElasticsearchSecretsSslKey1 -func (t NewOutputElasticsearch_Secrets_Ssl_Key) AsNewOutputElasticsearchSecretsSslKey1() (NewOutputElasticsearchSecretsSslKey1, error) { - var body NewOutputElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key as the provided NewOutputElasticsearchSecretsSslKey1 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) FromNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputElasticsearch_Secrets_Ssl_Key, using the provided NewOutputElasticsearchSecretsSslKey1 -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) MergeNewOutputElasticsearchSecretsSslKey1(v NewOutputElasticsearchSecretsSslKey1) 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 NewOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputElasticsearch_Secrets_Ssl_Key) 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 @@ -12431,898 +11564,15 @@ func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElas 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 -} - -// AsNewOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey0 -func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey0() (NewOutputRemoteElasticsearchSecretsSslKey0, error) { - var body NewOutputRemoteElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey0(v NewOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as a NewOutputRemoteElasticsearchSecretsSslKey1 -func (t NewOutputRemoteElasticsearch_Secrets_Ssl_Key) AsNewOutputRemoteElasticsearchSecretsSslKey1() (NewOutputRemoteElasticsearchSecretsSslKey1, error) { - var body NewOutputRemoteElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided NewOutputRemoteElasticsearchSecretsSslKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) FromNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided NewOutputRemoteElasticsearchSecretsSslKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeNewOutputRemoteElasticsearchSecretsSslKey1(v NewOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 -} - -// AsOutputElasticsearchSecretsSslKey0 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey0 -func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey0() (OutputElasticsearchSecretsSslKey0, error) { - var body OutputElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputElasticsearchSecretsSslKey0 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey0 -func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey0 -func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey0(v OutputElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputElasticsearchSecretsSslKey1 returns the union data inside the OutputElasticsearch_Secrets_Ssl_Key as a OutputElasticsearchSecretsSslKey1 -func (t OutputElasticsearch_Secrets_Ssl_Key) AsOutputElasticsearchSecretsSslKey1() (OutputElasticsearchSecretsSslKey1, error) { - var body OutputElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputElasticsearchSecretsSslKey1 overwrites any union data inside the OutputElasticsearch_Secrets_Ssl_Key as the provided OutputElasticsearchSecretsSslKey1 -func (t *OutputElasticsearch_Secrets_Ssl_Key) FromOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputElasticsearch_Secrets_Ssl_Key, using the provided OutputElasticsearchSecretsSslKey1 -func (t *OutputElasticsearch_Secrets_Ssl_Key) MergeOutputElasticsearchSecretsSslKey1(v OutputElasticsearchSecretsSslKey1) 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 OutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputElasticsearch_Secrets_Ssl_Key) 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 -} - -// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 -} - -// AsOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey0 -func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey0() (OutputRemoteElasticsearchSecretsSslKey0, error) { - var body OutputRemoteElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey0 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey0 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey0(v OutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as a OutputRemoteElasticsearchSecretsSslKey1 -func (t OutputRemoteElasticsearch_Secrets_Ssl_Key) AsOutputRemoteElasticsearchSecretsSslKey1() (OutputRemoteElasticsearchSecretsSslKey1, error) { - var body OutputRemoteElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key as the provided OutputRemoteElasticsearchSecretsSslKey1 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) FromOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided OutputRemoteElasticsearchSecretsSslKey1 -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) MergeOutputRemoteElasticsearchSecretsSslKey1(v OutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_Ssl_Key) 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 -} - -// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { - var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { - var body PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType1) 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 PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsPackageInfoInstallationInfoInstalledKibanaType0 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType0 -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType0() (PackageInfoInstallationInfoInstalledKibanaType0, error) { - var body PackageInfoInstallationInfoInstalledKibanaType0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromPackageInfoInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { +// 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 } -// MergePackageInfoInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType0 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType0(v PackageInfoInstallationInfoInstalledKibanaType0) error { +// 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 @@ -13333,22 +11583,22 @@ func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInst return err } -// AsPackageInfoInstallationInfoInstalledKibanaType1 returns the union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as a PackageInfoInstallationInfoInstalledKibanaType1 -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) AsPackageInfoInstallationInfoInstalledKibanaType1() (PackageInfoInstallationInfoInstalledKibanaType1, error) { - var body PackageInfoInstallationInfoInstalledKibanaType1 +// 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 } -// FromPackageInfoInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type as the provided PackageInfoInstallationInfoInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) FromPackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { +// 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 } -// MergePackageInfoInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageInfo_InstallationInfo_InstalledKibana_Type, using the provided PackageInfoInstallationInfoInstalledKibanaType1 -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInstallationInfoInstalledKibanaType1(v PackageInfoInstallationInfoInstalledKibanaType1) error { +// 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 @@ -13359,32 +11609,32 @@ func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) MergePackageInfoInst return err } -func (t PackageInfo_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageInfo_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageInfoType0 returns the union data inside the PackageInfo_Type as a PackageInfoType0 -func (t PackageInfo_Type) AsPackageInfoType0() (PackageInfoType0, error) { - var body PackageInfoType0 +// 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 } -// FromPackageInfoType0 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType0 -func (t *PackageInfo_Type) FromPackageInfoType0(v PackageInfoType0) error { +// 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 } -// MergePackageInfoType0 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType0 -func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { +// 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 @@ -13395,22 +11645,22 @@ func (t *PackageInfo_Type) MergePackageInfoType0(v PackageInfoType0) error { return err } -// AsPackageInfoType1 returns the union data inside the PackageInfo_Type as a PackageInfoType1 -func (t PackageInfo_Type) AsPackageInfoType1() (PackageInfoType1, error) { - var body PackageInfoType1 +// 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 } -// FromPackageInfoType1 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType1 -func (t *PackageInfo_Type) FromPackageInfoType1(v PackageInfoType1) error { +// 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 } -// MergePackageInfoType1 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType1 -func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { +// 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 @@ -13421,22 +11671,22 @@ func (t *PackageInfo_Type) MergePackageInfoType1(v PackageInfoType1) error { return err } -// AsPackageInfoType2 returns the union data inside the PackageInfo_Type as a PackageInfoType2 -func (t PackageInfo_Type) AsPackageInfoType2() (PackageInfoType2, error) { - var body PackageInfoType2 +// 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 } -// FromPackageInfoType2 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType2 -func (t *PackageInfo_Type) FromPackageInfoType2(v PackageInfoType2) error { +// 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 } -// MergePackageInfoType2 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType2 -func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { +// 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 @@ -13447,22 +11697,22 @@ func (t *PackageInfo_Type) MergePackageInfoType2(v PackageInfoType2) error { return err } -// AsPackageInfoType3 returns the union data inside the PackageInfo_Type as a PackageInfoType3 -func (t PackageInfo_Type) AsPackageInfoType3() (PackageInfoType3, error) { - var body PackageInfoType3 +// 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 } -// FromPackageInfoType3 overwrites any union data inside the PackageInfo_Type as the provided PackageInfoType3 -func (t *PackageInfo_Type) FromPackageInfoType3(v PackageInfoType3) error { +// 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 } -// MergePackageInfoType3 performs a merge with any union data inside the PackageInfo_Type, using the provided PackageInfoType3 -func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) error { +// 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 @@ -13473,32 +11723,32 @@ func (t *PackageInfo_Type) MergePackageInfoType3(v PackageInfoType3) error { return err } -func (t PackageInfo_Type) MarshalJSON() ([]byte, error) { +func (t NewOutputUnion) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageInfo_Type) UnmarshalJSON(b []byte) error { +func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0, error) { - var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 +// 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 } -// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// 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 } -// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType0) error { +// 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 @@ -13509,22 +11759,22 @@ func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) return err } -// AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as a PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) AsPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1() (PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1, error) { - var body PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 +// 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 } -// FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type as the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) FromPackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// 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 } -// MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type, using the provided PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MergePackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1(v PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType1) error { +// 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 @@ -13535,32 +11785,32 @@ func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) return err } -func (t PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) MarshalJSON() ([]byte, error) { +func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Type) UnmarshalJSON(b []byte) error { +func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageListItemInstallationInfoInstalledKibanaType0 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType0 -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType0() (PackageListItemInstallationInfoInstalledKibanaType0, error) { - var body PackageListItemInstallationInfoInstalledKibanaType0 +// 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 } -// FromPackageListItemInstallationInfoInstalledKibanaType0 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { +// 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 } -// MergePackageListItemInstallationInfoInstalledKibanaType0 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType0 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType0(v PackageListItemInstallationInfoInstalledKibanaType0) error { +// 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 @@ -13571,22 +11821,22 @@ func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageList return err } -// AsPackageListItemInstallationInfoInstalledKibanaType1 returns the union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as a PackageListItemInstallationInfoInstalledKibanaType1 -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) AsPackageListItemInstallationInfoInstalledKibanaType1() (PackageListItemInstallationInfoInstalledKibanaType1, error) { - var body PackageListItemInstallationInfoInstalledKibanaType1 +// 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 } -// FromPackageListItemInstallationInfoInstalledKibanaType1 overwrites any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type as the provided PackageListItemInstallationInfoInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) FromPackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { +// 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 } -// MergePackageListItemInstallationInfoInstalledKibanaType1 performs a merge with any union data inside the PackageListItem_InstallationInfo_InstalledKibana_Type, using the provided PackageListItemInstallationInfoInstalledKibanaType1 -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageListItemInstallationInfoInstalledKibanaType1(v PackageListItemInstallationInfoInstalledKibanaType1) error { +// 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 @@ -13597,32 +11847,32 @@ func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) MergePackageList return err } -func (t PackageListItem_InstallationInfo_InstalledKibana_Type) MarshalJSON() ([]byte, error) { +func (t OutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageListItem_InstallationInfo_InstalledKibana_Type) UnmarshalJSON(b []byte) error { +func (t *OutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsPackageListItemType0 returns the union data inside the PackageListItem_Type as a PackageListItemType0 -func (t PackageListItem_Type) AsPackageListItemType0() (PackageListItemType0, error) { - var body PackageListItemType0 +// 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 } -// FromPackageListItemType0 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType0 -func (t *PackageListItem_Type) FromPackageListItemType0(v PackageListItemType0) error { +// 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 } -// MergePackageListItemType0 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType0 -func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) error { +// 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 @@ -13633,22 +11883,22 @@ func (t *PackageListItem_Type) MergePackageListItemType0(v PackageListItemType0) return err } -// AsPackageListItemType1 returns the union data inside the PackageListItem_Type as a PackageListItemType1 -func (t PackageListItem_Type) AsPackageListItemType1() (PackageListItemType1, error) { - var body PackageListItemType1 +// 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 } -// FromPackageListItemType1 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType1 -func (t *PackageListItem_Type) FromPackageListItemType1(v PackageListItemType1) error { +// 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 } -// MergePackageListItemType1 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType1 -func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) error { +// 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 @@ -13659,22 +11909,32 @@ func (t *PackageListItem_Type) MergePackageListItemType1(v PackageListItemType1) return err } -// AsPackageListItemType2 returns the union data inside the PackageListItem_Type as a PackageListItemType2 -func (t PackageListItem_Type) AsPackageListItemType2() (PackageListItemType2, error) { - var body PackageListItemType2 +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 +} + +// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey0 err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType2 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType2 -func (t *PackageListItem_Type) FromPackageListItemType2(v PackageListItemType2) error { +// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType2 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType2 -func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) error { +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { b, err := json.Marshal(v) if err != nil { return err @@ -13685,22 +11945,22 @@ func (t *PackageListItem_Type) MergePackageListItemType2(v PackageListItemType2) return err } -// AsPackageListItemType3 returns the union data inside the PackageListItem_Type as a PackageListItemType3 -func (t PackageListItem_Type) AsPackageListItemType3() (PackageListItemType3, error) { - var body PackageListItemType3 +// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { + var body OutputRemoteElasticsearchSecretsKibanaApiKey1 err := json.Unmarshal(t.union, &body) return body, err } -// FromPackageListItemType3 overwrites any union data inside the PackageListItem_Type as the provided PackageListItemType3 -func (t *PackageListItem_Type) FromPackageListItemType3(v PackageListItemType3) error { +// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { b, err := json.Marshal(v) t.union = b return err } -// MergePackageListItemType3 performs a merge with any union data inside the PackageListItem_Type, using the provided PackageListItemType3 -func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) error { +// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { b, err := json.Marshal(v) if err != nil { return err @@ -13711,32 +11971,32 @@ func (t *PackageListItem_Type) MergePackageListItemType3(v PackageListItemType3) return err } -func (t PackageListItem_Type) MarshalJSON() ([]byte, error) { +func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *PackageListItem_Type) UnmarshalJSON(b []byte) error { +func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsServerHostSecretsSslEsKey0 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey0 -func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey0() (ServerHostSecretsSslEsKey0, error) { - var body ServerHostSecretsSslEsKey0 +// 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 } -// FromServerHostSecretsSslEsKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey0 -func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { +// 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 } -// MergeServerHostSecretsSslEsKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey0 -func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerHostSecretsSslEsKey0) error { +// 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 @@ -13747,22 +12007,22 @@ func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey0(v ServerH return err } -// AsServerHostSecretsSslEsKey1 returns the union data inside the ServerHost_Secrets_Ssl_EsKey as a ServerHostSecretsSslEsKey1 -func (t ServerHost_Secrets_Ssl_EsKey) AsServerHostSecretsSslEsKey1() (ServerHostSecretsSslEsKey1, error) { - var body ServerHostSecretsSslEsKey1 +// 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 } -// FromServerHostSecretsSslEsKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_EsKey as the provided ServerHostSecretsSslEsKey1 -func (t *ServerHost_Secrets_Ssl_EsKey) FromServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { +// 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 } -// MergeServerHostSecretsSslEsKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_EsKey, using the provided ServerHostSecretsSslEsKey1 -func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerHostSecretsSslEsKey1) error { +// 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 @@ -13773,32 +12033,34 @@ func (t *ServerHost_Secrets_Ssl_EsKey) MergeServerHostSecretsSslEsKey1(v ServerH return err } -func (t ServerHost_Secrets_Ssl_EsKey) MarshalJSON() ([]byte, error) { +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *ServerHost_Secrets_Ssl_EsKey) UnmarshalJSON(b []byte) error { +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } -// AsServerHostSecretsSslKey0 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey0 -func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey0() (ServerHostSecretsSslKey0, error) { - var body ServerHostSecretsSslKey0 +// 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 } -// FromServerHostSecretsSslKey0 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey0 -func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { +// 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 } -// MergeServerHostSecretsSslKey0 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey0 -func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostSecretsSslKey0) error { +// 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 @@ -13809,22 +12071,24 @@ func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey0(v ServerHostS return err } -// AsServerHostSecretsSslKey1 returns the union data inside the ServerHost_Secrets_Ssl_Key as a ServerHostSecretsSslKey1 -func (t ServerHost_Secrets_Ssl_Key) AsServerHostSecretsSslKey1() (ServerHostSecretsSslKey1, error) { - var body ServerHostSecretsSslKey1 +// 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 } -// FromServerHostSecretsSslKey1 overwrites any union data inside the ServerHost_Secrets_Ssl_Key as the provided ServerHostSecretsSslKey1 -func (t *ServerHost_Secrets_Ssl_Key) FromServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { +// 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 } -// MergeServerHostSecretsSslKey1 performs a merge with any union data inside the ServerHost_Secrets_Ssl_Key, using the provided ServerHostSecretsSslKey1 -func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostSecretsSslKey1) error { +// 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 @@ -13835,32 +12099,24 @@ func (t *ServerHost_Secrets_Ssl_Key) MergeServerHostSecretsSslKey1(v ServerHostS return err } -func (t ServerHost_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *ServerHost_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsUpdateOutputElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey0 -func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey0() (UpdateOutputElasticsearchSecretsSslKey0, error) { - var body UpdateOutputElasticsearchSecretsSslKey0 +// 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 } -// FromUpdateOutputElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey0 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { +// 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 } -// MergeUpdateOutputElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey0 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey0(v UpdateOutputElasticsearchSecretsSslKey0) error { +// 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 @@ -13871,22 +12127,24 @@ func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsear return err } -// AsUpdateOutputElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as a UpdateOutputElasticsearchSecretsSslKey1 -func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) AsUpdateOutputElasticsearchSecretsSslKey1() (UpdateOutputElasticsearchSecretsSslKey1, error) { - var body UpdateOutputElasticsearchSecretsSslKey1 +// 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 } -// FromUpdateOutputElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputElasticsearchSecretsSslKey1 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) FromUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { +// 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 } -// MergeUpdateOutputElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputElasticsearchSecretsSslKey1 -func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsearchSecretsSslKey1(v UpdateOutputElasticsearchSecretsSslKey1) error { +// 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 @@ -13897,12 +12155,39 @@ func (t *UpdateOutputElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputElasticsear return err } -func (t UpdateOutputElasticsearch_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { +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 *UpdateOutputElasticsearch_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { +func (t *OutputUnion) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } @@ -14217,68 +12502,6 @@ func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b [ return err } -// AsUpdateOutputRemoteElasticsearchSecretsSslKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey0 -func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey0() (UpdateOutputRemoteElasticsearchSecretsSslKey0, error) { - var body UpdateOutputRemoteElasticsearchSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsSslKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsSslKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey0(v UpdateOutputRemoteElasticsearchSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputRemoteElasticsearchSecretsSslKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as a UpdateOutputRemoteElasticsearchSecretsSslKey1 -func (t UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) AsUpdateOutputRemoteElasticsearchSecretsSslKey1() (UpdateOutputRemoteElasticsearchSecretsSslKey1, error) { - var body UpdateOutputRemoteElasticsearchSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsSslKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key as the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) FromUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsSslKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key, using the provided UpdateOutputRemoteElasticsearchSecretsSslKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) MergeUpdateOutputRemoteElasticsearchSecretsSslKey1(v UpdateOutputRemoteElasticsearchSecretsSslKey1) 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_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputRemoteElasticsearch_Secrets_Ssl_Key) 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 @@ -17187,10 +15410,9 @@ type GetFleetAgentPoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17217,10 +15439,9 @@ type PostFleetAgentPoliciesResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17248,10 +15469,9 @@ type PostFleetAgentPoliciesDeleteResponse struct { Name string `json:"name"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17278,10 +15498,9 @@ type GetFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17308,10 +15527,9 @@ type PutFleetAgentPoliciesAgentpolicyidResponse struct { Item AgentPolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17360,10 +15578,9 @@ type GetFleetEnrollmentApiKeysResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17390,10 +15607,9 @@ type GetFleetEpmPackagesResponse struct { Items []PackageListItem `json:"items"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17441,22 +15657,17 @@ type DeleteFleetEpmPackagesPkgnamePkgversionResponse struct { Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type DeleteFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` -} -type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type0 string -type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string -type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { - union json.RawMessage + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` } +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type string type DeleteFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -17494,10 +15705,9 @@ type GetFleetEpmPackagesPkgnamePkgversionResponse struct { } `json:"metadata,omitempty"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17527,22 +15737,17 @@ type PostFleetEpmPackagesPkgnamePkgversionResponse struct { Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } type PostFleetEpmPackagesPkgnamePkgversion200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type `json:"type"` -} -type PostFleetEpmPackagesPkgnamePkgversion200Items0Type0 string -type PostFleetEpmPackagesPkgnamePkgversion200Items0Type1 = string -type PostFleetEpmPackagesPkgnamePkgversion_200_Items_0_Type struct { - union json.RawMessage + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PostFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` } +type PostFleetEpmPackagesPkgnamePkgversion200Items0Type string type PostFleetEpmPackagesPkgnamePkgversion200Items1 struct { Deferred *bool `json:"deferred,omitempty"` Id string `json:"id"` @@ -17580,10 +15785,9 @@ type GetFleetFleetServerHostsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17610,10 +15814,9 @@ type PostFleetFleetServerHostsResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17640,10 +15843,9 @@ type DeleteFleetFleetServerHostsItemidResponse struct { Id string `json:"id"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17670,10 +15872,9 @@ type GetFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17700,10 +15901,9 @@ type PutFleetFleetServerHostsItemidResponse struct { Item ServerHost `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17733,10 +15933,9 @@ type GetFleetOutputsResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17763,10 +15962,9 @@ type PostFleetOutputsResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17793,16 +15991,14 @@ type DeleteFleetOutputsOutputidResponse struct { Id string `json:"id"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON404 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17829,10 +16025,9 @@ type GetFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17859,10 +16054,9 @@ type PutFleetOutputsOutputidResponse struct { Item OutputUnion `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17892,10 +16086,9 @@ type GetFleetPackagePoliciesResponse struct { Total float32 `json:"total"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17922,16 +16115,14 @@ type PostFleetPackagePoliciesResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON409 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17958,10 +16149,9 @@ type DeleteFleetPackagePoliciesPackagepolicyidResponse struct { Id string `json:"id"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -17988,10 +16178,9 @@ type GetFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON404 *struct { Message string `json:"message"` @@ -18021,16 +16210,14 @@ type PutFleetPackagePoliciesPackagepolicyidResponse struct { Item PackagePolicy `json:"item"` } JSON400 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } JSON403 *struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` } } @@ -18569,10 +16756,9 @@ func ParseGetFleetAgentPoliciesResponse(rsp *http.Response) (*GetFleetAgentPolic case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18609,10 +16795,9 @@ func ParsePostFleetAgentPoliciesResponse(rsp *http.Response) (*PostFleetAgentPol case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18650,10 +16835,9 @@ func ParsePostFleetAgentPoliciesDeleteResponse(rsp *http.Response) (*PostFleetAg case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18690,10 +16874,9 @@ func ParseGetFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*GetFl case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18730,10 +16913,9 @@ func ParsePutFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*PutFl case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18792,10 +16974,9 @@ func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnroll case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18832,10 +17013,9 @@ func ParseGetFleetEpmPackagesResponse(rsp *http.Response) (*GetFleetEpmPackagesR case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18888,10 +17068,9 @@ func ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (* case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18931,10 +17110,9 @@ func ParseGetFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Get case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -18974,10 +17152,9 @@ func ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Po case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19017,10 +17194,9 @@ func ParseGetFleetFleetServerHostsResponse(rsp *http.Response) (*GetFleetFleetSe case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19057,10 +17233,9 @@ func ParsePostFleetFleetServerHostsResponse(rsp *http.Response) (*PostFleetFleet case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19097,10 +17272,9 @@ func ParseDeleteFleetFleetServerHostsItemidResponse(rsp *http.Response) (*Delete case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19137,10 +17311,9 @@ func ParseGetFleetFleetServerHostsItemidResponse(rsp *http.Response) (*GetFleetF case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19177,10 +17350,9 @@ func ParsePutFleetFleetServerHostsItemidResponse(rsp *http.Response) (*PutFleetF case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19220,10 +17392,9 @@ func ParseGetFleetOutputsResponse(rsp *http.Response) (*GetFleetOutputsResponse, case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19260,10 +17431,9 @@ func ParsePostFleetOutputsResponse(rsp *http.Response) (*PostFleetOutputsRespons case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19300,10 +17470,9 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19312,10 +17481,9 @@ func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOu case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19352,10 +17520,9 @@ func ParseGetFleetOutputsOutputidResponse(rsp *http.Response) (*GetFleetOutputsO case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19392,10 +17559,9 @@ func ParsePutFleetOutputsOutputidResponse(rsp *http.Response) (*PutFleetOutputsO case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19435,10 +17601,9 @@ func ParseGetFleetPackagePoliciesResponse(rsp *http.Response) (*GetFleetPackageP case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19475,10 +17640,9 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19487,10 +17651,9 @@ func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackag case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19527,10 +17690,9 @@ func ParseDeleteFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19567,10 +17729,9 @@ func ParseGetFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*G case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19616,10 +17777,9 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 @@ -19628,10 +17788,9 @@ func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*P case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest struct { - Attributes interface{} `json:"attributes"` - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` + 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 diff --git a/generated/kbapi/transform_schema.go b/generated/kbapi/transform_schema.go index 54b5cc395..f1f0c4883 100644 --- a/generated/kbapi/transform_schema.go +++ b/generated/kbapi/transform_schema.go @@ -837,21 +837,8 @@ func transformFleetPaths(schema *Schema) { 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) } - schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") - schema.Components.Set("schemas.agent_policy_global_data_tags_item", Map{ - "type": "object", - "properties": Map{ - "name": Map{"type": "string"}, - "value": Map{ - "oneOf": []Map{ - {"type": "string"}, - {"type": "number"}, - }, - }, - }, - "required": []string{"name", "value"}, - }) + schema.Components.CreateRef(schema, "agent_policy_global_data_tags_item", "schemas.agent_policy.properties.global_data_tags.items") // Define the value types for the GlobalDataTags agentPoliciesPath.Post.Set("requestBody.content.application/json.schema.properties.global_data_tags.items.$ref", "#/components/schemas/agent_policy_global_data_tags_item") From c0b300efb7007a121c1d9f7f1a158bff1b495512 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Wed, 5 Mar 2025 13:20:03 -0500 Subject: [PATCH 62/89] gen kbapi from github_ref=3757e641278a5186919e35a0f980ac3cda7e8ccd --- generated/kbapi/kibana.gen.go | 1463 ++++----------------------------- 1 file changed, 149 insertions(+), 1314 deletions(-) diff --git a/generated/kbapi/kibana.gen.go b/generated/kbapi/kibana.gen.go index b8608bc75..400a66d4a 100644 --- a/generated/kbapi/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -39,11 +39,11 @@ const ( AgentPolicyMonitoringEnabledTraces AgentPolicyMonitoringEnabled = "traces" ) -// Defines values for AgentPolicyPackagePolicies1Inputs0StreamsRelease. +// Defines values for AgentPolicyPackagePolicies1InputsStreamsRelease. const ( - AgentPolicyPackagePolicies1Inputs0StreamsReleaseBeta AgentPolicyPackagePolicies1Inputs0StreamsRelease = "beta" - AgentPolicyPackagePolicies1Inputs0StreamsReleaseExperimental AgentPolicyPackagePolicies1Inputs0StreamsRelease = "experimental" - AgentPolicyPackagePolicies1Inputs0StreamsReleaseGa AgentPolicyPackagePolicies1Inputs0StreamsRelease = "ga" + AgentPolicyPackagePolicies1InputsStreamsReleaseBeta AgentPolicyPackagePolicies1InputsStreamsRelease = "beta" + AgentPolicyPackagePolicies1InputsStreamsReleaseExperimental AgentPolicyPackagePolicies1InputsStreamsRelease = "experimental" + AgentPolicyPackagePolicies1InputsStreamsReleaseGa AgentPolicyPackagePolicies1InputsStreamsRelease = "ga" ) // Defines values for AgentPolicyStatus. @@ -795,28 +795,16 @@ type DataViewsUpdateDataViewRequestObjectInner struct { // 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"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + 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"` - Agentless *struct { - Resources *struct { - Requests *struct { - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - } `json:"requests,omitempty"` - } `json:"resources,omitempty"` - } `json:"agentless,omitempty"` Agents *float32 `json:"agents,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` @@ -854,7 +842,7 @@ type AgentPolicy struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Enabled bool `json:"enabled"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -864,19 +852,12 @@ type AgentPolicy struct { 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"` - RequiredVersions *[]struct { - // Percentage Target percentage of agents to auto upgrade - Percentage float32 `json:"percentage"` - - // Version Target version for automatic agent upgrade - Version string `json:"version"` - } `json:"required_versions"` - Revision float32 `json:"revision"` - SchemaVersion *string `json:"schema_version,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` - Status AgentPolicyStatus `json:"status"` + 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"` @@ -895,17 +876,69 @@ 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 { - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` + 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 AgentPolicy_PackagePolicies_1_Inputs `json:"inputs"` - IsManaged *bool `json:"is_managed,omitempty"` + 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"` @@ -946,14 +979,16 @@ type AgentPolicyPackagePolicies1 = []struct { SecretReferences *[]struct { Id string `json:"id"` } `json:"secret_references,omitempty"` - SpaceIds *[]string `json:"spaceIds,omitempty"` + UpdatedAt string `json:"updated_at"` + UpdatedBy string `json:"updated_by"` - // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` - Vars *AgentPolicy_PackagePolicies_1_Vars `json:"vars,omitempty"` - Version *string `json:"version,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"` + Version *string `json:"version,omitempty"` } // AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges defines model for AgentPolicy.PackagePolicies.1.Elasticsearch.Privileges. @@ -968,180 +1003,8 @@ type AgentPolicy_PackagePolicies_1_Elasticsearch struct { AdditionalProperties map[string]interface{} `json:"-"` } -// AgentPolicyPackagePolicies1Inputs0 defines model for . -type AgentPolicyPackagePolicies1Inputs0 = []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 *AgentPolicyPackagePolicies1Inputs0StreamsRelease `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"` -} - -// AgentPolicyPackagePolicies1Inputs0StreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.0.Streams.Release. -type AgentPolicyPackagePolicies1Inputs0StreamsRelease string - -// AgentPolicyPackagePolicies1Inputs1 Package policy inputs (see integration documentation to know what inputs are available) -type AgentPolicyPackagePolicies1Inputs1 map[string]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]struct { - // Enabled enable or disable that stream, (default to true) - Enabled *bool `json:"enabled,omitempty"` - - // Vars Input/stream level variable (see integration documentation for more information) - Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties `json:"vars,omitempty"` - } `json:"streams,omitempty"` - - // Vars Input/stream level variable (see integration documentation for more information) - Vars *map[string]*AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties `json:"vars,omitempty"` -} - -// AgentPolicyPackagePolicies1Inputs1StreamsVars0 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars0 = bool - -// AgentPolicyPackagePolicies1Inputs1StreamsVars1 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars1 = string - -// AgentPolicyPackagePolicies1Inputs1StreamsVars2 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars2 = float32 - -// AgentPolicyPackagePolicies1Inputs1StreamsVars3 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars3 = []string - -// AgentPolicyPackagePolicies1Inputs1StreamsVars4 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars4 = []float32 - -// AgentPolicyPackagePolicies1Inputs1StreamsVars5 defines model for . -type AgentPolicyPackagePolicies1Inputs1StreamsVars5 struct { - Id string `json:"id"` - IsSecretRef bool `json:"isSecretRef"` -} - -// AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Streams.Vars.AdditionalProperties. -type AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties struct { - union json.RawMessage -} - -// AgentPolicyPackagePolicies1Inputs1Vars0 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars0 = bool - -// AgentPolicyPackagePolicies1Inputs1Vars1 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars1 = string - -// AgentPolicyPackagePolicies1Inputs1Vars2 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars2 = float32 - -// AgentPolicyPackagePolicies1Inputs1Vars3 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars3 = []string - -// AgentPolicyPackagePolicies1Inputs1Vars4 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars4 = []float32 - -// AgentPolicyPackagePolicies1Inputs1Vars5 defines model for . -type AgentPolicyPackagePolicies1Inputs1Vars5 struct { - Id string `json:"id"` - IsSecretRef bool `json:"isSecretRef"` -} - -// AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Inputs.1.Vars.AdditionalProperties. -type AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties struct { - union json.RawMessage -} - -// AgentPolicy_PackagePolicies_1_Inputs defines model for AgentPolicy.PackagePolicies.1.Inputs. -type AgentPolicy_PackagePolicies_1_Inputs struct { - union json.RawMessage -} - -// AgentPolicyPackagePolicies1Vars0 Package variable (see integration documentation for more information) -type AgentPolicyPackagePolicies1Vars0 map[string]struct { - Frozen *bool `json:"frozen,omitempty"` - Type *string `json:"type,omitempty"` - Value interface{} `json:"value"` -} - -// AgentPolicyPackagePolicies1Vars1 Input/stream level variable (see integration documentation for more information) -type AgentPolicyPackagePolicies1Vars1 map[string]*AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties - -// AgentPolicyPackagePolicies1Vars10 defines model for . -type AgentPolicyPackagePolicies1Vars10 = bool - -// AgentPolicyPackagePolicies1Vars11 defines model for . -type AgentPolicyPackagePolicies1Vars11 = string - -// AgentPolicyPackagePolicies1Vars12 defines model for . -type AgentPolicyPackagePolicies1Vars12 = float32 - -// AgentPolicyPackagePolicies1Vars13 defines model for . -type AgentPolicyPackagePolicies1Vars13 = []string - -// AgentPolicyPackagePolicies1Vars14 defines model for . -type AgentPolicyPackagePolicies1Vars14 = []float32 - -// AgentPolicyPackagePolicies1Vars15 defines model for . -type AgentPolicyPackagePolicies1Vars15 struct { - Id string `json:"id"` - IsSecretRef bool `json:"isSecretRef"` -} - -// AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties defines model for AgentPolicy.PackagePolicies.1.Vars.1.AdditionalProperties. -type AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties struct { - union json.RawMessage -} - -// AgentPolicy_PackagePolicies_1_Vars defines model for AgentPolicy.PackagePolicies.1.Vars. -type AgentPolicy_PackagePolicies_1_Vars struct { - union json.RawMessage -} +// AgentPolicyPackagePolicies1InputsStreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.Streams.Release. +type AgentPolicyPackagePolicies1InputsStreamsRelease string // AgentPolicy_PackagePolicies defines model for AgentPolicy.PackagePolicies. type AgentPolicy_PackagePolicies struct { @@ -1375,38 +1238,21 @@ type NewOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *NewOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { - KibanaApiKey *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` 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"` - SyncIntegrations *bool `json:"sync_integrations,omitempty"` - Type NewOutputRemoteElasticsearchType `json:"type"` + 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 -// NewOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . -type NewOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { - Id string `json:"id"` -} - -// NewOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . -type NewOutputRemoteElasticsearchSecretsKibanaApiKey1 = string - -// NewOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for NewOutputRemoteElasticsearch.Secrets.KibanaApiKey. -type NewOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { - union json.RawMessage -} - // NewOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type NewOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1673,8 +1519,6 @@ type OutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` Name string `json:"name"` Preset *OutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id"` @@ -1682,7 +1526,6 @@ type OutputRemoteElasticsearch struct { ServiceToken *string `json:"service_token"` Shipper *OutputShipper `json:"shipper"` Ssl *OutputSsl `json:"ssl"` - SyncIntegrations *bool `json:"sync_integrations,omitempty"` Type OutputRemoteElasticsearchType `json:"type"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -1690,20 +1533,6 @@ type OutputRemoteElasticsearch struct { // OutputRemoteElasticsearchPreset defines model for OutputRemoteElasticsearch.Preset. type OutputRemoteElasticsearchPreset string -// OutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . -type OutputRemoteElasticsearchSecretsKibanaApiKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . -type OutputRemoteElasticsearchSecretsKibanaApiKey1 = string - -// OutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for OutputRemoteElasticsearch.Secrets.KibanaApiKey. -type OutputRemoteElasticsearch_Secrets_KibanaApiKey struct { - union json.RawMessage -} - // OutputRemoteElasticsearchSecretsServiceToken0 defines model for . type OutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -1720,7 +1549,6 @@ type OutputRemoteElasticsearch_Secrets_ServiceToken struct { // OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. type OutputRemoteElasticsearch_Secrets struct { - KibanaApiKey *OutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } @@ -2240,13 +2068,10 @@ type PackagePolicy struct { Revision float32 `json:"revision"` SecretReferences *[]PackagePolicySecretRef `json:"secret_references,omitempty"` SpaceIds *[]string `json:"spaceIds,omitempty"` - - // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` - Vars *map[string]interface{} `json:"vars,omitempty"` - Version *string `json:"version,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. @@ -2292,10 +2117,7 @@ type PackagePolicyRequest struct { Package PackagePolicyRequestPackage `json:"package"` PolicyId *string `json:"policy_id"` PolicyIds *[]string `json:"policy_ids,omitempty"` - - // SupportsAgentless Indicates whether the package policy belongs to an agentless agent policy. - SupportsAgentless *bool `json:"supports_agentless"` - Vars *map[string]interface{} `json:"vars,omitempty"` + Vars *map[string]interface{} `json:"vars,omitempty"` } // PackagePolicyRequestInput defines model for package_policy_request_input. @@ -2526,38 +2348,21 @@ type UpdateOutputRemoteElasticsearch struct { IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - KibanaApiKey *string `json:"kibana_api_key"` - KibanaUrl *string `json:"kibana_url"` Name *string `json:"name,omitempty"` Preset *UpdateOutputRemoteElasticsearchPreset `json:"preset,omitempty"` ProxyId *string `json:"proxy_id,omitempty"` Secrets *struct { - KibanaApiKey *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey `json:"kibana_api_key,omitempty"` 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"` - SyncIntegrations *bool `json:"sync_integrations,omitempty"` - Type *UpdateOutputRemoteElasticsearchType `json:"type,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 -// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 defines model for . -type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 defines model for . -type UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 = string - -// UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey defines model for UpdateOutputRemoteElasticsearch.Secrets.KibanaApiKey. -type UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey struct { - union json.RawMessage -} - // UpdateOutputRemoteElasticsearchSecretsServiceToken0 defines model for . type UpdateOutputRemoteElasticsearchSecretsServiceToken0 struct { Id string `json:"id"` @@ -2639,28 +2444,16 @@ type GetFleetAgentPoliciesParamsFormat string // PostFleetAgentPoliciesJSONBody defines parameters for PostFleetAgentPolicies. type PostFleetAgentPoliciesJSONBody struct { AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + 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"` - Agentless *struct { - Resources *struct { - Requests *struct { - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - } `json:"requests,omitempty"` - } `json:"resources,omitempty"` - } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2695,7 +2488,7 @@ type PostFleetAgentPoliciesJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Enabled bool `json:"enabled"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2706,14 +2499,8 @@ type PostFleetAgentPoliciesJSONBody struct { // 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"` - RequiredVersions *[]struct { - // Percentage Target percentage of agents to auto upgrade - Percentage float32 `json:"percentage"` - - // Version Target version for automatic agent upgrade - Version string `json:"version"` - } `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *interface{} `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -2747,28 +2534,16 @@ type GetFleetAgentPoliciesAgentpolicyidParamsFormat string // PutFleetAgentPoliciesAgentpolicyidJSONBody defines parameters for PutFleetAgentPoliciesAgentpolicyid. type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingFilesInterval *interface{} `json:"agent_logging_files_interval"` - AgentLoggingFilesKeepfiles *interface{} `json:"agent_logging_files_keepfiles"` - AgentLoggingFilesRotateeverybytes *interface{} `json:"agent_logging_files_rotateeverybytes"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - AgentLoggingToFiles *interface{} `json:"agent_logging_to_files"` + 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"` - Agentless *struct { - Resources *struct { - Requests *struct { - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - } `json:"requests,omitempty"` - } `json:"resources,omitempty"` - } `json:"agentless,omitempty"` DataOutputId *string `json:"data_output_id"` Description *string `json:"description,omitempty"` DownloadSourceId *string `json:"download_source_id"` @@ -2803,7 +2578,7 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` } `json:"buffer,omitempty"` - Enabled *bool `json:"enabled,omitempty"` + Enabled bool `json:"enabled"` Host *string `json:"host,omitempty"` Port *float32 `json:"port,omitempty"` } `json:"monitoring_http,omitempty"` @@ -2814,14 +2589,8 @@ type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { // 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"` - RequiredVersions *[]struct { - // Percentage Target percentage of agents to auto upgrade - Percentage float32 `json:"percentage"` - - // Version Target version for automatic agent upgrade - Version string `json:"version"` - } `json:"required_versions,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` + RequiredVersions *interface{} `json:"required_versions,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` // SupportsAgentless Indicates whether the agent policy supports agentless integrations. SupportsAgentless *bool `json:"supports_agentless,omitempty"` @@ -5214,22 +4983,6 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "is_preconfigured") } - if raw, found := object["kibana_api_key"]; found { - err = json.Unmarshal(raw, &a.KibanaApiKey) - if err != nil { - return fmt.Errorf("error reading 'kibana_api_key': %w", err) - } - delete(object, "kibana_api_key") - } - - if raw, found := object["kibana_url"]; found { - err = json.Unmarshal(raw, &a.KibanaUrl) - if err != nil { - return fmt.Errorf("error reading 'kibana_url': %w", err) - } - delete(object, "kibana_url") - } - if raw, found := object["name"]; found { err = json.Unmarshal(raw, &a.Name) if err != nil { @@ -5286,14 +5039,6 @@ func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { delete(object, "ssl") } - if raw, found := object["sync_integrations"]; found { - err = json.Unmarshal(raw, &a.SyncIntegrations) - if err != nil { - return fmt.Errorf("error reading 'sync_integrations': %w", err) - } - delete(object, "sync_integrations") - } - if raw, found := object["type"]; found { err = json.Unmarshal(raw, &a.Type) if err != nil { @@ -5389,20 +5134,6 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } - if a.KibanaApiKey != nil { - object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_api_key': %w", err) - } - } - - if a.KibanaUrl != nil { - object["kibana_url"], err = json.Marshal(a.KibanaUrl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_url': %w", err) - } - } - object["name"], err = json.Marshal(a.Name) if err != nil { return nil, fmt.Errorf("error marshaling 'name': %w", err) @@ -5450,13 +5181,6 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { } } - if a.SyncIntegrations != nil { - object["sync_integrations"], err = json.Marshal(a.SyncIntegrations) - if err != nil { - return nil, fmt.Errorf("error marshaling 'sync_integrations': %w", err) - } - } - object["type"], err = json.Marshal(a.Type) if err != nil { return nil, fmt.Errorf("error marshaling 'type': %w", err) @@ -5471,72 +5195,6 @@ func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0. Returns the specified -// element and whether it was found -func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties -func (a *OutputRemoteElasticsearchSecretsKibanaApiKey0) 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 OutputRemoteElasticsearchSecretsKibanaApiKey0 to handle AdditionalProperties -func (a OutputRemoteElasticsearchSecretsKibanaApiKey0) 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 OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified // element and whether it was found func (a OutputRemoteElasticsearchSecretsServiceToken0) Get(fieldName string) (value interface{}, found bool) { @@ -5628,14 +5286,6 @@ func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { return err } - if raw, found := object["kibana_api_key"]; found { - err = json.Unmarshal(raw, &a.KibanaApiKey) - if err != nil { - return fmt.Errorf("error reading 'kibana_api_key': %w", err) - } - delete(object, "kibana_api_key") - } - if raw, found := object["service_token"]; found { err = json.Unmarshal(raw, &a.ServiceToken) if err != nil { @@ -5663,13 +5313,6 @@ func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { var err error object := make(map[string]json.RawMessage) - if a.KibanaApiKey != nil { - object["kibana_api_key"], err = json.Marshal(a.KibanaApiKey) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana_api_key': %w", err) - } - } - if a.ServiceToken != nil { object["service_token"], err = json.Marshal(a.ServiceToken) if err != nil { @@ -10563,22 +10206,22 @@ func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars0() (AgentPolicyPackagePolicies1Inputs1StreamsVars0, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars0 +// 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 } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// 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 } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars0(v AgentPolicyPackagePolicies1Inputs1StreamsVars0) error { +// 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 @@ -10589,22 +10232,22 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars1() (AgentPolicyPackagePolicies1Inputs1StreamsVars1, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars1 +// 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 } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// 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 } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars1(v AgentPolicyPackagePolicies1Inputs1StreamsVars1) error { +// 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 @@ -10615,22 +10258,32 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars2() (AgentPolicyPackagePolicies1Inputs1StreamsVars2, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars2 +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 +} + +// AsAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue0 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue0() (AgentPolicyGlobalDataTagsItemValue0, error) { + var body AgentPolicyGlobalDataTagsItemValue0 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { +// FromAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) t.union = b return err } -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars2(v AgentPolicyPackagePolicies1Inputs1StreamsVars2) error { +// MergeAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue0 +func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { b, err := json.Marshal(v) if err != nil { return err @@ -10641,647 +10294,15 @@ func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalPropertie return err } -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars3 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars3() (AgentPolicyPackagePolicies1Inputs1StreamsVars3, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars3 +// AsAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue1 +func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue1() (AgentPolicyGlobalDataTagsItemValue1, error) { + var body AgentPolicyGlobalDataTagsItemValue1 err := json.Unmarshal(t.union, &body) return body, err } -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars3(v AgentPolicyPackagePolicies1Inputs1StreamsVars3) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars4 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars4() (AgentPolicyPackagePolicies1Inputs1StreamsVars4, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars4 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars4(v AgentPolicyPackagePolicies1Inputs1StreamsVars4) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1StreamsVars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1StreamsVars5 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1StreamsVars5() (AgentPolicyPackagePolicies1Inputs1StreamsVars5, error) { - var body AgentPolicyPackagePolicies1Inputs1StreamsVars5 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1StreamsVars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1StreamsVars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1StreamsVars5(v AgentPolicyPackagePolicies1Inputs1StreamsVars5) 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_1_Inputs_1_Streams_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Streams_Vars_AdditionalProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars0 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars0() (AgentPolicyPackagePolicies1Inputs1Vars0, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars0(v AgentPolicyPackagePolicies1Inputs1Vars0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars1 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars1() (AgentPolicyPackagePolicies1Inputs1Vars1, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars1(v AgentPolicyPackagePolicies1Inputs1Vars1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars2 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars2 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars2() (AgentPolicyPackagePolicies1Inputs1Vars2, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars2 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars2 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars2 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars2 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars2(v AgentPolicyPackagePolicies1Inputs1Vars2) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars3 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars3 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars3() (AgentPolicyPackagePolicies1Inputs1Vars3, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars3 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars3 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars3 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars3 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars3(v AgentPolicyPackagePolicies1Inputs1Vars3) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars4 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars4 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars4() (AgentPolicyPackagePolicies1Inputs1Vars4, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars4 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars4 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars4 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars4 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars4(v AgentPolicyPackagePolicies1Inputs1Vars4) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1Vars5 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as a AgentPolicyPackagePolicies1Inputs1Vars5 -func (t AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) AsAgentPolicyPackagePolicies1Inputs1Vars5() (AgentPolicyPackagePolicies1Inputs1Vars5, error) { - var body AgentPolicyPackagePolicies1Inputs1Vars5 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1Vars5 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties as the provided AgentPolicyPackagePolicies1Inputs1Vars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) FromAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1Vars5 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Inputs1Vars5 -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) MergeAgentPolicyPackagePolicies1Inputs1Vars5(v AgentPolicyPackagePolicies1Inputs1Vars5) 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_1_Inputs_1_Vars_AdditionalProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Inputs_1_Vars_AdditionalProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Inputs0 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs0 -func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs0() (AgentPolicyPackagePolicies1Inputs0, error) { - var body AgentPolicyPackagePolicies1Inputs0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs0 -func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs0 -func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs0(v AgentPolicyPackagePolicies1Inputs0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Inputs1 returns the union data inside the AgentPolicy_PackagePolicies_1_Inputs as a AgentPolicyPackagePolicies1Inputs1 -func (t AgentPolicy_PackagePolicies_1_Inputs) AsAgentPolicyPackagePolicies1Inputs1() (AgentPolicyPackagePolicies1Inputs1, error) { - var body AgentPolicyPackagePolicies1Inputs1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Inputs1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Inputs as the provided AgentPolicyPackagePolicies1Inputs1 -func (t *AgentPolicy_PackagePolicies_1_Inputs) FromAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Inputs1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Inputs, using the provided AgentPolicyPackagePolicies1Inputs1 -func (t *AgentPolicy_PackagePolicies_1_Inputs) MergeAgentPolicyPackagePolicies1Inputs1(v AgentPolicyPackagePolicies1Inputs1) 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_1_Inputs) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Inputs) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Vars10 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars10 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars10() (AgentPolicyPackagePolicies1Vars10, error) { - var body AgentPolicyPackagePolicies1Vars10 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars10 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars10 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars10 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars10 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars10(v AgentPolicyPackagePolicies1Vars10) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars11 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars11 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars11() (AgentPolicyPackagePolicies1Vars11, error) { - var body AgentPolicyPackagePolicies1Vars11 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars11 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars11 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars11 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars11 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars11(v AgentPolicyPackagePolicies1Vars11) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars12 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars12 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars12() (AgentPolicyPackagePolicies1Vars12, error) { - var body AgentPolicyPackagePolicies1Vars12 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars12 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars12 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars12 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars12 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars12(v AgentPolicyPackagePolicies1Vars12) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars13 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars13 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars13() (AgentPolicyPackagePolicies1Vars13, error) { - var body AgentPolicyPackagePolicies1Vars13 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars13 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars13 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars13 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars13 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars13(v AgentPolicyPackagePolicies1Vars13) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars14 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars14 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars14() (AgentPolicyPackagePolicies1Vars14, error) { - var body AgentPolicyPackagePolicies1Vars14 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars14 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars14 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars14 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars14 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars14(v AgentPolicyPackagePolicies1Vars14) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars15 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as a AgentPolicyPackagePolicies1Vars15 -func (t AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) AsAgentPolicyPackagePolicies1Vars15() (AgentPolicyPackagePolicies1Vars15, error) { - var body AgentPolicyPackagePolicies1Vars15 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars15 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties as the provided AgentPolicyPackagePolicies1Vars15 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) FromAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars15 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties, using the provided AgentPolicyPackagePolicies1Vars15 -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) MergeAgentPolicyPackagePolicies1Vars15(v AgentPolicyPackagePolicies1Vars15) 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_1_Vars_1_AdditionalProperties) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Vars_1_AdditionalProperties) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies1Vars0 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars0 -func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars0() (AgentPolicyPackagePolicies1Vars0, error) { - var body AgentPolicyPackagePolicies1Vars0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars0 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars0 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars0 -func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars0(v AgentPolicyPackagePolicies1Vars0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1Vars1 returns the union data inside the AgentPolicy_PackagePolicies_1_Vars as a AgentPolicyPackagePolicies1Vars1 -func (t AgentPolicy_PackagePolicies_1_Vars) AsAgentPolicyPackagePolicies1Vars1() (AgentPolicyPackagePolicies1Vars1, error) { - var body AgentPolicyPackagePolicies1Vars1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1Vars1 overwrites any union data inside the AgentPolicy_PackagePolicies_1_Vars as the provided AgentPolicyPackagePolicies1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Vars) FromAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1Vars1 performs a merge with any union data inside the AgentPolicy_PackagePolicies_1_Vars, using the provided AgentPolicyPackagePolicies1Vars1 -func (t *AgentPolicy_PackagePolicies_1_Vars) MergeAgentPolicyPackagePolicies1Vars1(v AgentPolicyPackagePolicies1Vars1) 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_1_Vars) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies_1_Vars) 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 -} - -// AsAgentPolicyGlobalDataTagsItemValue0 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue0 -func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue0() (AgentPolicyGlobalDataTagsItemValue0, error) { - var body AgentPolicyGlobalDataTagsItemValue0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyGlobalDataTagsItemValue0 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue0 -func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyGlobalDataTagsItemValue0 performs a merge with any union data inside the AgentPolicyGlobalDataTagsItem_Value, using the provided AgentPolicyGlobalDataTagsItemValue0 -func (t *AgentPolicyGlobalDataTagsItem_Value) MergeAgentPolicyGlobalDataTagsItemValue0(v AgentPolicyGlobalDataTagsItemValue0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyGlobalDataTagsItemValue1 returns the union data inside the AgentPolicyGlobalDataTagsItem_Value as a AgentPolicyGlobalDataTagsItemValue1 -func (t AgentPolicyGlobalDataTagsItem_Value) AsAgentPolicyGlobalDataTagsItemValue1() (AgentPolicyGlobalDataTagsItemValue1, error) { - var body AgentPolicyGlobalDataTagsItemValue1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue1 -func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) error { +// FromAgentPolicyGlobalDataTagsItemValue1 overwrites any union data inside the AgentPolicyGlobalDataTagsItem_Value as the provided AgentPolicyGlobalDataTagsItemValue1 +func (t *AgentPolicyGlobalDataTagsItem_Value) FromAgentPolicyGlobalDataTagsItemValue1(v AgentPolicyGlobalDataTagsItemValue1) error { b, err := json.Marshal(v) t.union = b return err @@ -11495,68 +10516,6 @@ func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } -// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey0() (NewOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body NewOutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey0(v NewOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as a NewOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsNewOutputRemoteElasticsearchSecretsKibanaApiKey1() (NewOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body NewOutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided NewOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeNewOutputRemoteElasticsearchSecretsKibanaApiKey1(v NewOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -11919,68 +10878,6 @@ func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } -// AsOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey0() (OutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey0(v OutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as a OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t OutputRemoteElasticsearch_Secrets_KibanaApiKey) AsOutputRemoteElasticsearchSecretsKibanaApiKey1() (OutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body OutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) FromOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided OutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeOutputRemoteElasticsearchSecretsKibanaApiKey1(v OutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 @@ -12378,68 +11275,6 @@ func (t *UpdateOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { return err } -// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0, error) { - var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey0(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as a UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) AsUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1() (UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1, error) { - var body UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey as the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) FromUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey, using the provided UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) MergeUpdateOutputRemoteElasticsearchSecretsKibanaApiKey1(v UpdateOutputRemoteElasticsearchSecretsKibanaApiKey1) 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_KibanaApiKey) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputRemoteElasticsearch_Secrets_KibanaApiKey) 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 From 65463b58c9e94299cc48d86f77da9e406728dc12 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:40:28 -0500 Subject: [PATCH 63/89] fmt --- internal/fleet/agent_policy/create.go | 4 +- internal/fleet/agent_policy/models.go | 105 ++++++++++++++++++++------ internal/fleet/agent_policy/read.go | 2 +- internal/fleet/agent_policy/schema.go | 34 ++++++++- internal/fleet/agent_policy/update.go | 4 +- 5 files changed, 120 insertions(+), 29 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index 3ed965cf2..ea4420777 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - body, diags := planModel.toAPICreateModel(sVersion) + body, diags := planModel.toAPICreateModel(ctx, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -40,7 +40,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - diags = planModel.populateFromAPI(policy, sVersion) + diags = planModel.populateFromAPI(ctx, policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index f41cefc84..3081d161d 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -1,7 +1,7 @@ package agent_policy import ( - "encoding/json" + "context" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -26,10 +27,10 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` - GlobalDataTags types.String `tfsdk:"global_data_tags"` + GlobalDataTags types.Map `tfsdk:"global_data_tags"` } -func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { if data == nil { return nil } @@ -59,21 +60,36 @@ func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy, serverVe model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) model.Name = types.StringValue(data.Name) model.Namespace = types.StringValue(data.Namespace) - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) && utils.Deref(data.GlobalDataTags) != nil { + if utils.Deref(data.GlobalDataTags) != nil { diags := diag.Diagnostics{} - d, err := json.Marshal(utils.Deref(data.GlobalDataTags)) - if err != nil { - diags.AddError("Failed to marshal global data tags", err.Error()) + var map0 = make(map[string]any) + for _, v := range utils.Deref(data.GlobalDataTags) { + maybeFloat, error := v.Value.AsAgentPolicyGlobalDataTagsItemValue1() + if error != nil { + maybeString, error := v.Value.AsAgentPolicyGlobalDataTagsItemValue0() + if error != nil { + diags.AddError("Failed to unmarshal global data tags", error.Error()) + } + map0[v.Name] = map[string]string{ + "string_value": string(maybeString), + } + } else { + map0[v.Name] = map[string]float32{ + "number_value": float32(maybeFloat), + } + } + } + gdt := utils.MapValueFrom(ctx, map0, getGlobalDataTagsAttrType(), path.Root("global_data_tags"), &diags) + if diags.HasError() { return diags } - strD := string(d) - model.GlobalDataTags = types.StringPointerValue(&strD) + model.GlobalDataTags = gdt } return nil } -func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { @@ -95,21 +111,42 @@ func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.ValueString()) > 0 { + if len(model.GlobalDataTags.Elements()) > 0 { var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueStringPointer() var items []kbapi.AgentPolicyGlobalDataTagsItem - - err := json.Unmarshal([]byte(*str), &items) - if err != nil { - diags.AddError(err.Error(), "") + itemsMap := utils.MapTypeAs[struct { + string_value *string + number_value *float32 + }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + if diags.HasError() { return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } + for k, v := range itemsMap { + if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { + diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags + } + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if v.string_value != nil { + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) + } + if err != nil { + diags.AddError("global_data_tags ES version error", "could not convert global data tags value") + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags + } + items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ + Name: k, + Value: value, + }) + } body.GlobalDataTags = &items } @@ -117,7 +154,7 @@ func (model *agentPolicyModel) toAPICreateModel(serverVersion *version.Version) return body, nil } -func (model *agentPolicyModel) toAPIUpdateModel(serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { +func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) @@ -137,21 +174,43 @@ func (model *agentPolicyModel) toAPIUpdateModel(serverVersion *version.Version) Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.ValueString()) > 0 { + if len(model.GlobalDataTags.Elements()) > 0 { var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - str := model.GlobalDataTags.ValueStringPointer() var items []kbapi.AgentPolicyGlobalDataTagsItem - - err := json.Unmarshal([]byte(*str), &items) - if err != nil { - diags.AddError(err.Error(), "") + itemsMap := utils.MapTypeAs[struct { + string_value *string + number_value *float32 + }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + if diags.HasError() { return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } + for k, v := range itemsMap { + if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { + diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags + } + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if v.string_value != nil { + // s := *v.string_value + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) + } + if err != nil { + diags.AddError("global_data_tags ES version error", "could not convert global data tags value") + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags + } + items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ + Name: k, + Value: value, + }) + } body.GlobalDataTags = &items } diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index 5a8fd1f09..34916f0bd 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -39,7 +39,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - diags = stateModel.populateFromAPI(policy, sVersion) + diags = stateModel.populateFromAPI(ctx, policy, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 123b3c740..a16746f49 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,12 +3,17 @@ package agent_policy import ( "context" + "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -86,7 +91,30 @@ func getSchema() schema.Schema { boolplanmodifier.RequiresReplace(), }, }, - "global_data_tags": schema.StringAttribute{ + "global_data_tags": schema.MapNestedAttribute{ + Description: "user-defined data tags to apply to all inputs. values can be strings (string_value) or numbers (number_value).", + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "string_value": schema.StringAttribute{ + Description: "Custom label for the field.", + Optional: true, + }, + "number_value": schema.Float32Attribute{ + Description: "Popularity count for the field.", + Optional: true, + }, + }, + Validators: []validator.Object{ + objectvalidator.ExactlyOneOf(path.MatchRoot("string_value"), path.MatchRoot("number_value")), + }, + }, + Optional: true, + PlanModifiers: []planmodifier.Map{ + mapplanmodifier.RequiresReplace(), + }, + }, + + "global_data_tags_old": schema.StringAttribute{ Description: "JSON encoded user-defined data tags to apply to all inputs.", Optional: true, PlanModifiers: []planmodifier.String{ @@ -95,3 +123,7 @@ func getSchema() schema.Schema { }, }} } + +func getGlobalDataTagsAttrType() attr.Type { + return getSchema().Attributes["global_data_tags"].GetType() +} diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 822ad68bd..8099e842b 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -27,7 +27,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - body, diags := planModel.toAPIUpdateModel(sVersion) + body, diags := planModel.toAPIUpdateModel(ctx, sVersion) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { @@ -41,7 +41,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(policy, sVersion) + planModel.populateFromAPI(ctx, policy, sVersion) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From 457e02430a62821ef63ce1a397d8829559dab976 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:43:15 -0500 Subject: [PATCH 64/89] schema --- internal/fleet/agent_policy/schema.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index a16746f49..923e3ba6a 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -92,15 +92,15 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.MapNestedAttribute{ - Description: "user-defined data tags to apply to all inputs. values can be strings (string_value) or numbers (number_value).", + Description: "User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both.", NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "string_value": schema.StringAttribute{ - Description: "Custom label for the field.", + Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, }, "number_value": schema.Float32Attribute{ - Description: "Popularity count for the field.", + Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, }, }, @@ -113,14 +113,6 @@ func getSchema() schema.Schema { mapplanmodifier.RequiresReplace(), }, }, - - "global_data_tags_old": schema.StringAttribute{ - Description: "JSON encoded user-defined data tags to apply to all inputs.", - Optional: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, - }, }} } From d9da72571dec337c796fd38542a2afe9dd2380d6 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:45:05 -0500 Subject: [PATCH 65/89] new docs --- docs/resources/fleet_agent_policy.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index 860d9fc10..a4ff14426 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -41,7 +41,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (String) JSON encoded user-defined data tags to apply to all inputs. +- `global_data_tags` (Attributes Map) User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. (see [below for nested schema](#nestedatt--global_data_tags)) - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. @@ -53,6 +53,14 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `id` (String) The ID of this resource. + +### Nested Schema for `global_data_tags` + +Optional: + +- `number_value` (Number) Number value for the field. If this is set, string_value must not be defined. +- `string_value` (String) String value for the field. If this is set, number_value must not be defined. + ## Import Import is supported using the following syntax: From e4b02a975a91bb99d5b0790f2ead1881120ee077 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 15:49:21 -0500 Subject: [PATCH 66/89] test mod --- internal/fleet/agent_policy/resource_test.go | 31 ++++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 368247587..c49ecc257 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -131,7 +131,8 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1"},{"name":"tag2","value":1.1}]`), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1.string_value", "value1"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2.number_value", "1.1"), ), }, { @@ -144,7 +145,8 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags", `[{"name":"tag1","value":"value1a"}]`)), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1.string_value", "value1a"), + ), }, { SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), @@ -223,16 +225,14 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = true monitor_metrics = false skip_destroy = %t - global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1" - }, - { - name = "tag2" - value = 1.1 + global_data_tags = { + tag1 = { + string_value = "value1" + } + tag2 = { + number_value = 1.1 } - ]) + } } data "elasticstack_fleet_enrollment_tokens" "test_policy" { @@ -256,12 +256,11 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { monitor_logs = false monitor_metrics = true skip_destroy = %t - global_data_tags = jsonencode([ - { - name = "tag1" - value = "value1a" + global_data_tags = { + tag1 = { + string_value = "value1a" } - ]) + } } data "elasticstack_fleet_enrollment_tokens" "test_policy" { From 7527ddc6ea0743bf20f32fc69cbe0a2ce1df072a Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Thu, 6 Mar 2025 16:25:00 -0500 Subject: [PATCH 67/89] novalidate --- internal/fleet/agent_policy/schema.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 923e3ba6a..76d8cde1c 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,9 +3,7 @@ package agent_policy import ( "context" - "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" - "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" @@ -13,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -98,15 +95,21 @@ func getSchema() schema.Schema { "string_value": schema.StringAttribute{ Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, + // Validators: []validator.String{ + // stringvalidator.ExactlyOneOf(path.MatchRelative()), + // }, }, "number_value": schema.Float32Attribute{ Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, + // Validators: []validator.Float32{ + // float32validator.ExactlyOneOf(path.MatchRelative()), + // }, }, }, - Validators: []validator.Object{ - objectvalidator.ExactlyOneOf(path.MatchRoot("string_value"), path.MatchRoot("number_value")), - }, + // Validators: []validator.Object{ + // objectvalidator.ExactlyOneOf(path.MatchRelative().AtAnyMapKey()) + // }, }, Optional: true, PlanModifiers: []planmodifier.Map{ From dc0360c93a789a82d6b3bf16b5503b4a26a1c341 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 7 Mar 2025 01:19:21 -0500 Subject: [PATCH 68/89] its alive --- .../resource.tf | 9 ++ internal/fleet/agent_policy/models.go | 131 ++++++++++-------- internal/fleet/agent_policy/resource_test.go | 2 +- internal/fleet/agent_policy/schema.go | 2 +- 4 files changed, 81 insertions(+), 63 deletions(-) diff --git a/examples/resources/elasticstack_fleet_agent_policy/resource.tf b/examples/resources/elasticstack_fleet_agent_policy/resource.tf index 81625d7fc..a6b7befe9 100644 --- a/examples/resources/elasticstack_fleet_agent_policy/resource.tf +++ b/examples/resources/elasticstack_fleet_agent_policy/resource.tf @@ -9,4 +9,13 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { sys_monitoring = true monitor_logs = true monitor_metrics = true + + global_data_tags = { + first_tag = { + string_value = "tag_value" + }, + second_tag = { + number_value = 1.2 + } + } } diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 3081d161d..ab97ff738 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -13,6 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) +type globalDataTagsItemModel struct { + StringValue types.String `tfsdk:"string_value"` + NumberValue types.Float32 `tfsdk:"number_value"` +} + type agentPolicyModel struct { ID types.String `tfsdk:"id"` PolicyID types.String `tfsdk:"policy_id"` @@ -27,7 +32,7 @@ type agentPolicyModel struct { MonitorMetrics types.Bool `tfsdk:"monitor_metrics"` SysMonitoring types.Bool `tfsdk:"sys_monitoring"` SkipDestroy types.Bool `tfsdk:"skip_destroy"` - GlobalDataTags types.Map `tfsdk:"global_data_tags"` + GlobalDataTags types.Map `tfsdk:"global_data_tags"` //> globalDataTagsModel } func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { @@ -62,7 +67,7 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. model.Namespace = types.StringValue(data.Namespace) if utils.Deref(data.GlobalDataTags) != nil { diags := diag.Diagnostics{} - var map0 = make(map[string]any) + var map0 = make(map[string]globalDataTagsItemModel) for _, v := range utils.Deref(data.GlobalDataTags) { maybeFloat, error := v.Value.AsAgentPolicyGlobalDataTagsItemValue1() if error != nil { @@ -70,12 +75,12 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. if error != nil { diags.AddError("Failed to unmarshal global data tags", error.Error()) } - map0[v.Name] = map[string]string{ - "string_value": string(maybeString), + map0[v.Name] = globalDataTagsItemModel{ + StringValue: types.StringValue(maybeString), } } else { - map0[v.Name] = map[string]float32{ - "number_value": float32(maybeFloat), + map0[v.Name] = globalDataTagsItemModel{ + NumberValue: types.Float32Value(float32(maybeFloat)), } } } @@ -118,37 +123,40 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - var items []kbapi.AgentPolicyGlobalDataTagsItem - itemsMap := utils.MapTypeAs[struct { - string_value *string - number_value *float32 - }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, + func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { + // do some checks + if item.StringValue.ValueStringPointer() == nil && item.NumberValue.ValueFloat32Pointer() == nil || item.StringValue.ValueStringPointer() != nil && item.NumberValue.ValueFloat32Pointer() != nil { + diags.AddError("global_data_tags validation_error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if item.StringValue.ValueStringPointer() != nil { + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*item.StringValue.ValueStringPointer()) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*item.NumberValue.ValueFloat32Pointer()) + } + if err != nil { + diags.AddError("global_data_tags validation_error_converting_values", err.Error()) + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + return kbapi.AgentPolicyGlobalDataTagsItem{ + Name: meta.Key, + Value: value, + } + }) + if diags.HasError() { return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } - for k, v := range itemsMap { - if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { - diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags - } - var value kbapi.AgentPolicyGlobalDataTagsItem_Value - var err error - if v.string_value != nil { - err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) - } else { - err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) - } - if err != nil { - diags.AddError("global_data_tags ES version error", "could not convert global data tags value") - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags - } - items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ - Name: k, - Value: value, - }) - } - body.GlobalDataTags = &items + itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0, len(items)) + for _, v := range items { + itemsList = append(itemsList, v) + } + body.GlobalDataTags = &itemsList } return body, nil @@ -181,38 +189,39 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - var items []kbapi.AgentPolicyGlobalDataTagsItem - itemsMap := utils.MapTypeAs[struct { - string_value *string - number_value *float32 - }](ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags) + items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, + func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { + // do some checks + if item.StringValue.ValueStringPointer() == nil && item.NumberValue.ValueFloat32Pointer() == nil || item.StringValue.ValueStringPointer() != nil && item.NumberValue.ValueFloat32Pointer() != nil { + diags.AddError("global_data_tags validation_error", "Global data tags must have exactly one of string_value or number_value") + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if item.StringValue.ValueStringPointer() != nil { + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*item.StringValue.ValueStringPointer()) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*item.NumberValue.ValueFloat32Pointer()) + } + if err != nil { + diags.AddError("global_data_tags validation_error_converting_values", err.Error()) + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + return kbapi.AgentPolicyGlobalDataTagsItem{ + Name: meta.Key, + Value: value, + } + }) if diags.HasError() { return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } - for k, v := range itemsMap { - if (v.string_value != nil && v.number_value != nil) || (v.string_value == nil && v.number_value == nil) { - diags.AddError("global_data_tags ES version error", "Global data tags must have exactly one of string_value or number_value") - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags - } - var value kbapi.AgentPolicyGlobalDataTagsItem_Value - var err error - if v.string_value != nil { - // s := *v.string_value - err = value.FromAgentPolicyGlobalDataTagsItemValue0(*v.string_value) - } else { - err = value.FromAgentPolicyGlobalDataTagsItemValue1(*v.number_value) - } - if err != nil { - diags.AddError("global_data_tags ES version error", "could not convert global data tags value") - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags - } - items = append(items, kbapi.AgentPolicyGlobalDataTagsItem{ - Name: k, - Value: value, - }) - } - body.GlobalDataTags = &items + itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0, len(items)) + for _, v := range items { + itemsList = append(itemsList, v) + } + body.GlobalDataTags = &itemsList } return body, nil diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index c49ecc257..ce334279d 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -228,7 +228,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { global_data_tags = { tag1 = { string_value = "value1" - } + }, tag2 = { number_value = 1.1 } diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 76d8cde1c..fa53d80e5 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -89,7 +89,7 @@ func getSchema() schema.Schema { }, }, "global_data_tags": schema.MapNestedAttribute{ - Description: "User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both.", + Description: "User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. Example -- key1 = {string_value = value1}, key2 = {number_value = 42}", NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "string_value": schema.StringAttribute{ From 1cf7a626efbc44987a7d3581d376006c77593eb9 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 7 Mar 2025 16:35:10 -0500 Subject: [PATCH 69/89] passing tests --- internal/fleet/agent_policy/models.go | 6 ++++-- internal/fleet/agent_policy/schema.go | 12 +----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index ab97ff738..8d7507e76 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -8,6 +8,7 @@ import ( "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/go-version" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" @@ -84,11 +85,12 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. } } } - gdt := utils.MapValueFrom(ctx, map0, getGlobalDataTagsAttrType(), path.Root("global_data_tags"), &diags) + + model.GlobalDataTags = utils.MapValueFrom(ctx, map0, getGlobalDataTagsAttrTypes().(attr.TypeWithElementType).ElementType(), path.Root("global_data_tags"), &diags) if diags.HasError() { return diags } - model.GlobalDataTags = gdt + } return nil diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index fa53d80e5..20dda0337 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -95,21 +95,12 @@ func getSchema() schema.Schema { "string_value": schema.StringAttribute{ Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, - // Validators: []validator.String{ - // stringvalidator.ExactlyOneOf(path.MatchRelative()), - // }, }, "number_value": schema.Float32Attribute{ Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, - // Validators: []validator.Float32{ - // float32validator.ExactlyOneOf(path.MatchRelative()), - // }, }, }, - // Validators: []validator.Object{ - // objectvalidator.ExactlyOneOf(path.MatchRelative().AtAnyMapKey()) - // }, }, Optional: true, PlanModifiers: []planmodifier.Map{ @@ -118,7 +109,6 @@ func getSchema() schema.Schema { }, }} } - -func getGlobalDataTagsAttrType() attr.Type { +func getGlobalDataTagsAttrTypes() attr.Type { return getSchema().Attributes["global_data_tags"].GetType() } From 39998b0462666de4280f2f3091e210ac9cae557d Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 7 Mar 2025 16:35:46 -0500 Subject: [PATCH 70/89] docs --- docs/resources/fleet_agent_policy.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/resources/fleet_agent_policy.md b/docs/resources/fleet_agent_policy.md index a4ff14426..0420a8c33 100644 --- a/docs/resources/fleet_agent_policy.md +++ b/docs/resources/fleet_agent_policy.md @@ -24,6 +24,15 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { sys_monitoring = true monitor_logs = true monitor_metrics = true + + global_data_tags = { + first_tag = { + string_value = "tag_value" + }, + second_tag = { + number_value = 1.2 + } + } } ``` @@ -41,7 +50,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { - `description` (String) The description of the agent policy. - `download_source_id` (String) The identifier for the Elastic Agent binary download server. - `fleet_server_host_id` (String) The identifier for the Fleet server host. -- `global_data_tags` (Attributes Map) User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. (see [below for nested schema](#nestedatt--global_data_tags)) +- `global_data_tags` (Attributes Map) User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. Example -- key1 = {string_value = value1}, key2 = {number_value = 42} (see [below for nested schema](#nestedatt--global_data_tags)) - `monitor_logs` (Boolean) Enable collection of agent logs. - `monitor_metrics` (Boolean) Enable collection of agent metrics. - `monitoring_output_id` (String) The identifier for monitoring output. From 85d079325ace5952163fd2e6eaffbd1a3b816079 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 21 Mar 2025 13:58:10 -0400 Subject: [PATCH 71/89] requested changes --- internal/fleet/agent_policy/create.go | 2 +- internal/fleet/agent_policy/models.go | 18 +++-------- internal/fleet/agent_policy/read.go | 7 +--- internal/fleet/agent_policy/resource_test.go | 34 ++++++++++++++++++++ internal/fleet/agent_policy/schema.go | 10 ++++++ internal/fleet/agent_policy/update.go | 2 +- 6 files changed, 51 insertions(+), 22 deletions(-) diff --git a/internal/fleet/agent_policy/create.go b/internal/fleet/agent_policy/create.go index ea4420777..b07b6a607 100644 --- a/internal/fleet/agent_policy/create.go +++ b/internal/fleet/agent_policy/create.go @@ -40,7 +40,7 @@ func (r *agentPolicyResource) Create(ctx context.Context, req resource.CreateReq return } - diags = planModel.populateFromAPI(ctx, policy, sVersion) + diags = planModel.populateFromAPI(ctx, policy) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 8d7507e76..9a34bc07f 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -2,6 +2,7 @@ package agent_policy import ( "context" + "fmt" "slices" "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" @@ -36,7 +37,7 @@ type agentPolicyModel struct { GlobalDataTags types.Map `tfsdk:"global_data_tags"` //> globalDataTagsModel } -func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy, serverVersion *version.Version) diag.Diagnostics { +func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.AgentPolicy) diag.Diagnostics { if data == nil { return nil } @@ -121,18 +122,12 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi if len(model.GlobalDataTags.Elements()) > 0 { var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { - diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") + diags.AddError("global_data_tags ES version error", fmt.Sprintf("Global data tags are only supported in Elastic Stack %s and above", MinVersionGlobalDataTags)) return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { - // do some checks - if item.StringValue.ValueStringPointer() == nil && item.NumberValue.ValueFloat32Pointer() == nil || item.StringValue.ValueStringPointer() != nil && item.NumberValue.ValueFloat32Pointer() != nil { - diags.AddError("global_data_tags validation_error", "Global data tags must have exactly one of string_value or number_value") - return kbapi.AgentPolicyGlobalDataTagsItem{} - } - var value kbapi.AgentPolicyGlobalDataTagsItem_Value var err error if item.StringValue.ValueStringPointer() != nil { @@ -187,17 +182,12 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi if len(model.GlobalDataTags.Elements()) > 0 { var diags diag.Diagnostics if serverVersion.LessThan(MinVersionGlobalDataTags) { - diags.AddError("global_data_tags ES version error", "Global data tags are only supported in Elastic Stack 8.15.0 and above") + diags.AddError("global_data_tags ES version error", fmt.Sprintf("Global data tags are only supported in Elastic Stack %s and above", MinVersionGlobalDataTags)) return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { - // do some checks - if item.StringValue.ValueStringPointer() == nil && item.NumberValue.ValueFloat32Pointer() == nil || item.StringValue.ValueStringPointer() != nil && item.NumberValue.ValueFloat32Pointer() != nil { - diags.AddError("global_data_tags validation_error", "Global data tags must have exactly one of string_value or number_value") - return kbapi.AgentPolicyGlobalDataTagsItem{} - } var value kbapi.AgentPolicyGlobalDataTagsItem_Value var err error diff --git a/internal/fleet/agent_policy/read.go b/internal/fleet/agent_policy/read.go index 34916f0bd..5ad7f70df 100644 --- a/internal/fleet/agent_policy/read.go +++ b/internal/fleet/agent_policy/read.go @@ -22,11 +22,6 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - sVersion, e := r.client.ServerVersion(ctx) - if e != nil { - return - } - policyID := stateModel.PolicyID.ValueString() policy, diags := fleet.GetAgentPolicy(ctx, client, policyID) resp.Diagnostics.Append(diags...) @@ -39,7 +34,7 @@ func (r *agentPolicyResource) Read(ctx context.Context, req resource.ReadRequest return } - diags = stateModel.populateFromAPI(ctx, policy, sVersion) + diags = stateModel.populateFromAPI(ctx, policy) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index ce334279d..7c726b447 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "regexp" "testing" "github.com/elastic/terraform-provider-elasticstack/internal/acctest" @@ -161,6 +162,11 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags"), ), }, + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyNameGlobalDataTags, false), + ExpectError: regexp.MustCompile("conflicts with"), + }, }, }) } @@ -269,6 +275,34 @@ data "elasticstack_fleet_enrollment_tokens" "test_policy" { `, fmt.Sprintf("Updated Policy %s", id), skipDestroy) } +func testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(id string, skipDestroy bool) string { + return fmt.Sprintf(` +provider "elasticstack" { + elasticsearch {} + kibana {} +} + +resource "elasticstack_fleet_agent_policy" "test_policy" { + name = "%s" + namespace = "default" + description = "This policy was updated" + monitor_logs = false + monitor_metrics = true + skip_destroy = %t + global_data_tags = { + tag1 = { + string_value = "value1a" + number_value = 1.2 + } + } +} + +data "elasticstack_fleet_enrollment_tokens" "test_policy" { + policy_id = elasticstack_fleet_agent_policy.test_policy.policy_id +} +`, fmt.Sprintf("Updated Policy %s", id), skipDestroy) +} + func testAccResourceAgentPolicyUpdateWithNoGlobalDataTags(id string, skipDestroy bool) string { return fmt.Sprintf(` provider "elasticstack" { diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 20dda0337..1ccec483d 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -3,7 +3,10 @@ package agent_policy import ( "context" + "github.com/hashicorp/terraform-plugin-framework-validators/float32validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" @@ -11,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -95,10 +99,16 @@ func getSchema() schema.Schema { "string_value": schema.StringAttribute{ Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, + Validators: []validator.String{ + stringvalidator.ConflictsWith(path.MatchRelative().AtName("number_value")), + }, }, "number_value": schema.Float32Attribute{ Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, + Validators: []validator.Float32{ + float32validator.ConflictsWith(path.MatchRelative().AtName("string_value")), + }, }, }, }, diff --git a/internal/fleet/agent_policy/update.go b/internal/fleet/agent_policy/update.go index 8099e842b..2bdac21e8 100644 --- a/internal/fleet/agent_policy/update.go +++ b/internal/fleet/agent_policy/update.go @@ -41,7 +41,7 @@ func (r *agentPolicyResource) Update(ctx context.Context, req resource.UpdateReq return } - planModel.populateFromAPI(ctx, policy, sVersion) + planModel.populateFromAPI(ctx, policy) diags = resp.State.Set(ctx, planModel) resp.Diagnostics.Append(diags...) From da8b10720fecfe3aad5b8dda374fb1fe8d25162f Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 21 Mar 2025 14:47:42 -0400 Subject: [PATCH 72/89] prep sync --- CHANGELOG.md | 1 - internal/fleet/agent_policy/resource_test.go | 4 ++-- internal/fleet/agent_policy/schema.go | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c575c87d..f9a841ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ - Add missing entries to `data_view.field_formats.params` ([#1001](https://github.com/elastic/terraform-provider-elasticstack/pull/1001)) - Fix namespaces inconsistency when creating elasticstack_kibana_data_view resources ([#1011](https://github.com/elastic/terraform-provider-elasticstack/pull/1011)) - Update rule ID documentation. ([#1047](https://github.com/elastic/terraform-provider-elasticstack/pull/1047)) -- Add `global_data_tags` to fleet agent policies. ([#1044](https://github.com/elastic/terraform-provider-elasticstack/pull/1044)) ## [0.11.13] - 2025-01-09 diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 7c726b447..105603639 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -164,8 +164,8 @@ func TestAccResourceAgentPolicy(t *testing.T) { }, { SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), - Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyNameGlobalDataTags, false), - ExpectError: regexp.MustCompile("conflicts with"), + Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyNameGlobalDataTags, true), + ExpectError: regexp.MustCompile(".*Error: Invalid Attribute Combination.*"), }, }, }) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 1ccec483d..b1f00ea75 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -100,14 +100,14 @@ func getSchema() schema.Schema { Description: "String value for the field. If this is set, number_value must not be defined.", Optional: true, Validators: []validator.String{ - stringvalidator.ConflictsWith(path.MatchRelative().AtName("number_value")), + stringvalidator.ConflictsWith(path.MatchRelative().AtParent().AtName("number_value")), }, }, "number_value": schema.Float32Attribute{ Description: "Number value for the field. If this is set, string_value must not be defined.", Optional: true, Validators: []validator.Float32{ - float32validator.ConflictsWith(path.MatchRelative().AtName("string_value")), + float32validator.ConflictsWith(path.MatchRelative().AtParent().AtName("string_value")), }, }, }, From 044b04e76bb9409a6bfb9b57763bf5cf39c5e32c Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 21 Mar 2025 14:48:38 -0400 Subject: [PATCH 73/89] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d160259c..8fa6477bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Fix namespaces inconsistency when creating elasticstack_kibana_data_view resources ([#1011](https://github.com/elastic/terraform-provider-elasticstack/pull/1011)) - Update rule ID documentation. ([#1047](https://github.com/elastic/terraform-provider-elasticstack/pull/1047)) - Mark `elasticstack_kibana_action_connector.secrets` as sensitive. ([#1045](https://github.com/elastic/terraform-provider-elasticstack/pull/1045)) +- Add `global_data_tags` to fleet agent policies. ([#1044](https://github.com/elastic/terraform-provider-elasticstack/pull/1044)) ## [0.11.13] - 2025-01-09 From 8404167ec8ec319f0fa6e6c918e1b9260a4696bb Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Fri, 21 Mar 2025 15:00:54 -0400 Subject: [PATCH 74/89] separate test, passes --- internal/fleet/agent_policy/resource_test.go | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 105603639..ccb0207cf 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -162,11 +162,6 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags"), ), }, - { - SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), - Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyNameGlobalDataTags, true), - ExpectError: regexp.MustCompile(".*Error: Invalid Attribute Combination.*"), - }, }, }) } @@ -195,6 +190,23 @@ func TestAccResourceAgentPolicySkipDestroy(t *testing.T) { }) } +func TestAccResourceAgentPolicyWithBadGlobalDataTags(t *testing.T) { + policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + // CheckDestroy: func(s *state.State) { return nil }, + ProtoV6ProviderFactories: acctest.Providers, + Steps: []resource.TestStep{ + { + SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), + Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyName, true), + ExpectError: regexp.MustCompile(".*Error: Invalid Attribute Combination.*"), + }, + }, + }) +} + func testAccResourceAgentPolicyCreate(id string, skipDestroy bool) string { return fmt.Sprintf(` provider "elasticstack" { From 42874ed86e6a2722d1d7432fc26287b51e675751 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Fri, 21 Mar 2025 23:23:29 -0400 Subject: [PATCH 75/89] remove comment in test --- internal/fleet/agent_policy/resource_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index ccb0207cf..3654e2ac9 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -195,7 +195,6 @@ func TestAccResourceAgentPolicyWithBadGlobalDataTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, - // CheckDestroy: func(s *state.State) { return nil }, ProtoV6ProviderFactories: acctest.Providers, Steps: []resource.TestStep{ { From 5254b77501ee245a5bf236db8adfacdfa9b37f55 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Sat, 22 Mar 2025 00:45:59 -0400 Subject: [PATCH 76/89] fmt --- internal/fleet/agent_policy/resource_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 3654e2ac9..1e2b8e915 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -194,7 +194,7 @@ func TestAccResourceAgentPolicyWithBadGlobalDataTags(t *testing.T) { policyName := sdkacctest.RandStringFromCharSet(22, sdkacctest.CharSetAlphaNum) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(t) }, ProtoV6ProviderFactories: acctest.Providers, Steps: []resource.TestStep{ { From 542d49186dd2507b0c560752fd4981c4620ebcd3 Mon Sep 17 00:00:00 2001 From: Alec Ghazarian Date: Sat, 22 Mar 2025 00:52:06 -0400 Subject: [PATCH 77/89] test name change to create --- internal/fleet/agent_policy/resource_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 1e2b8e915..4081277bd 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -199,7 +199,7 @@ func TestAccResourceAgentPolicyWithBadGlobalDataTags(t *testing.T) { Steps: []resource.TestStep{ { SkipFunc: versionutils.CheckIfVersionIsUnsupported(minVersionGlobalDataTags), - Config: testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(policyName, true), + Config: testAccResourceAgentPolicyCreateWithBadGlobalDataTags(policyName, true), ExpectError: regexp.MustCompile(".*Error: Invalid Attribute Combination.*"), }, }, @@ -259,7 +259,7 @@ data "elasticstack_fleet_enrollment_tokens" "test_policy" { `, fmt.Sprintf("Policy %s", id), skipDestroy) } -func testAccResourceAgentPolicyUpdateWithGlobalDataTags(id string, skipDestroy bool) string { +func testAccResourceAgentPolicyCreateWithBadGlobalDataTags(id string, skipDestroy bool) string { return fmt.Sprintf(` provider "elasticstack" { elasticsearch {} @@ -269,13 +269,14 @@ provider "elasticstack" { resource "elasticstack_fleet_agent_policy" "test_policy" { name = "%s" namespace = "default" - description = "This policy was updated" + description = "This policy was not created due to bad tags" monitor_logs = false monitor_metrics = true skip_destroy = %t global_data_tags = { tag1 = { string_value = "value1a" + number_value = 1.2 } } } @@ -286,7 +287,7 @@ data "elasticstack_fleet_enrollment_tokens" "test_policy" { `, fmt.Sprintf("Updated Policy %s", id), skipDestroy) } -func testAccResourceAgentPolicyUpdateWithBadGlobalDataTags(id string, skipDestroy bool) string { +func testAccResourceAgentPolicyUpdateWithGlobalDataTags(id string, skipDestroy bool) string { return fmt.Sprintf(` provider "elasticstack" { elasticsearch {} @@ -303,7 +304,6 @@ resource "elasticstack_fleet_agent_policy" "test_policy" { global_data_tags = { tag1 = { string_value = "value1a" - number_value = 1.2 } } } From f946c4fee66be70c3627d65face635d834d32684 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 26 Mar 2025 00:03:01 +0000 Subject: [PATCH 78/89] remove RequiresReplace --- internal/fleet/agent_policy/schema.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index b1f00ea75..44233908f 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" @@ -113,9 +112,6 @@ func getSchema() schema.Schema { }, }, Optional: true, - PlanModifiers: []planmodifier.Map{ - mapplanmodifier.RequiresReplace(), - }, }, }} } From bb521373bba05879893337a2588d6d45e00e6dcf Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 26 Mar 2025 00:13:09 +0000 Subject: [PATCH 79/89] readd --- internal/fleet/agent_policy/schema.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index 44233908f..b1f00ea75 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" @@ -112,6 +113,9 @@ func getSchema() schema.Schema { }, }, Optional: true, + PlanModifiers: []planmodifier.Map{ + mapplanmodifier.RequiresReplace(), + }, }, }} } From ce2247d8a107514d638a12063b9b7cfbd508243d Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 27 Mar 2025 15:10:34 +0000 Subject: [PATCH 80/89] attempt computed, and UseStateForUnknown --- internal/fleet/agent_policy/schema.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index b1f00ea75..e4dc09ff9 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -112,9 +112,10 @@ func getSchema() schema.Schema { }, }, }, + Computed: true, Optional: true, PlanModifiers: []planmodifier.Map{ - mapplanmodifier.RequiresReplace(), + mapplanmodifier.UseStateForUnknown(), }, }, }} From 128e72f42c20d47d24b4ff7d24cee1384301491c Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 27 Mar 2025 15:29:46 +0000 Subject: [PATCH 81/89] maybe add a default --- internal/fleet/agent_policy/schema.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index e4dc09ff9..bae7e9abd 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -11,10 +11,12 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" ) func (r *agentPolicyResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { @@ -114,6 +116,12 @@ func getSchema() schema.Schema { }, Computed: true, Optional: true, + Default: mapdefault.StaticValue(types.MapValueMust(types.ObjectType{ + AttrTypes: map[string]attr.Type{ + "string_value": types.StringType, + "number_value": types.Float32Type, + }, + }, map[string]attr.Value{})), PlanModifiers: []planmodifier.Map{ mapplanmodifier.UseStateForUnknown(), }, From d7a6b8a8210498d1351b4c2f4b4b4255eca6e987 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 27 Mar 2025 18:04:56 +0000 Subject: [PATCH 82/89] perhaps default without useState --- internal/fleet/agent_policy/schema.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/fleet/agent_policy/schema.go b/internal/fleet/agent_policy/schema.go index bae7e9abd..c6fc0b812 100644 --- a/internal/fleet/agent_policy/schema.go +++ b/internal/fleet/agent_policy/schema.go @@ -12,7 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapdefault" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/mapplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" @@ -122,9 +121,6 @@ func getSchema() schema.Schema { "number_value": types.Float32Type, }, }, map[string]attr.Value{})), - PlanModifiers: []planmodifier.Map{ - mapplanmodifier.UseStateForUnknown(), - }, }, }} } From eecdd15249ce6adf9fc7d1d16f4d737ed988d34b Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 27 Mar 2025 18:14:01 +0000 Subject: [PATCH 83/89] send an empty global_data_tags on update --- internal/fleet/agent_policy/models.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 9a34bc07f..3f5ba3044 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -214,6 +214,9 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi itemsList = append(itemsList, v) } body.GlobalDataTags = &itemsList + } else { + itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0) + body.GlobalDataTags = &itemsList } return body, nil From fc99c6d274776cad0ccae70f5c8d71f63e45f92f Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 27 Mar 2025 18:20:57 +0000 Subject: [PATCH 84/89] only for min ver and higher --- internal/fleet/agent_policy/models.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 3f5ba3044..8bee1ed05 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -215,8 +215,10 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi } body.GlobalDataTags = &itemsList } else { - itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0) - body.GlobalDataTags = &itemsList + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) { + itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0) + body.GlobalDataTags = &itemsList + } } return body, nil From 5b9b0e6f2e8302313cd360e44d040a117d4344d0 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 27 Mar 2025 18:38:41 +0000 Subject: [PATCH 85/89] check elements directly --- internal/fleet/agent_policy/resource_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 4081277bd..e2da0b358 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -159,7 +159,8 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2"), ), }, }, From c115ce16f652fa122a29dffea43a0ef36fe54fcd Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 3 Apr 2025 11:39:42 -0400 Subject: [PATCH 86/89] datatags -- update test should test the removal of tag2 --- internal/fleet/agent_policy/resource_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index e2da0b358..1158eb3f5 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -147,6 +147,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1.string_value", "value1a"), + resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2"), ), }, { From e854fa16fdd6275c94e016e8d2fe2e4eb584d3bb Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Wed, 9 Apr 2025 19:05:37 +0000 Subject: [PATCH 87/89] test count --- internal/fleet/agent_policy/resource_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/fleet/agent_policy/resource_test.go b/internal/fleet/agent_policy/resource_test.go index 1158eb3f5..a8b183123 100644 --- a/internal/fleet/agent_policy/resource_test.go +++ b/internal/fleet/agent_policy/resource_test.go @@ -160,8 +160,7 @@ func TestAccResourceAgentPolicy(t *testing.T) { resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_logs", "false"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "monitor_metrics", "true"), resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "skip_destroy", "false"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag1"), - resource.TestCheckNoResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.tag2"), + resource.TestCheckResourceAttr("elasticstack_fleet_agent_policy.test_policy", "global_data_tags.#", "0"), ), }, }, From 314eadf31ca92d0856c4bfd87db011c2adca22b0 Mon Sep 17 00:00:00 2001 From: "Alec G (smartalec)" Date: Thu, 10 Apr 2025 17:45:08 +0000 Subject: [PATCH 88/89] drying code --- internal/fleet/agent_policy/models.go | 136 +++++++++++--------------- 1 file changed, 59 insertions(+), 77 deletions(-) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 8bee1ed05..6ff4b7b81 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -60,8 +60,8 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. if !utils.IsKnown(model.MonitorLogs) { model.MonitorLogs = types.BoolValue(false) } - if !utils.IsKnown(model.MonitorLogs) { - model.MonitorLogs = types.BoolValue(false) + if !utils.IsKnown(model.MonitorMetrics) { + model.MonitorMetrics = types.BoolValue(false) } model.MonitoringOutputId = types.StringPointerValue(data.MonitoringOutputId) @@ -97,6 +97,55 @@ func (model *agentPolicyModel) populateFromAPI(ctx context.Context, data *kbapi. return nil } +// convertGlobalDataTags converts the global data tags from terraform model to API model +// and performs version validation +func (model *agentPolicyModel) convertGlobalDataTags(ctx context.Context, serverVersion *version.Version) (*[]kbapi.AgentPolicyGlobalDataTagsItem, diag.Diagnostics) { + var diags diag.Diagnostics + + if len(model.GlobalDataTags.Elements()) == 0 { + if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) { + emptyList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0) + return &emptyList, diags + } + return nil, diags + } + + if serverVersion.LessThan(MinVersionGlobalDataTags) { + diags.AddError("global_data_tags ES version error", fmt.Sprintf("Global data tags are only supported in Elastic Stack %s and above", MinVersionGlobalDataTags)) + return nil, diags + } + + items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, + func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { + var value kbapi.AgentPolicyGlobalDataTagsItem_Value + var err error + if item.StringValue.ValueStringPointer() != nil { + err = value.FromAgentPolicyGlobalDataTagsItemValue0(*item.StringValue.ValueStringPointer()) + } else { + err = value.FromAgentPolicyGlobalDataTagsItemValue1(*item.NumberValue.ValueFloat32Pointer()) + } + if err != nil { + diags.AddError("global_data_tags validation_error_converting_values", err.Error()) + return kbapi.AgentPolicyGlobalDataTagsItem{} + } + return kbapi.AgentPolicyGlobalDataTagsItem{ + Name: meta.Key, + Value: value, + } + }) + + if diags.HasError() { + return nil, diags + } + + itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0, len(items)) + for _, v := range items { + itemsList = append(itemsList, v) + } + + return &itemsList, diags +} + func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersion *version.Version) (kbapi.PostFleetAgentPoliciesJSONRequestBody, diag.Diagnostics) { monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) @@ -119,42 +168,11 @@ func (model *agentPolicyModel) toAPICreateModel(ctx context.Context, serverVersi Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.Elements()) > 0 { - var diags diag.Diagnostics - if serverVersion.LessThan(MinVersionGlobalDataTags) { - diags.AddError("global_data_tags ES version error", fmt.Sprintf("Global data tags are only supported in Elastic Stack %s and above", MinVersionGlobalDataTags)) - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags - } - - items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, - func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { - var value kbapi.AgentPolicyGlobalDataTagsItem_Value - var err error - if item.StringValue.ValueStringPointer() != nil { - err = value.FromAgentPolicyGlobalDataTagsItemValue0(*item.StringValue.ValueStringPointer()) - } else { - err = value.FromAgentPolicyGlobalDataTagsItemValue1(*item.NumberValue.ValueFloat32Pointer()) - } - if err != nil { - diags.AddError("global_data_tags validation_error_converting_values", err.Error()) - return kbapi.AgentPolicyGlobalDataTagsItem{} - } - return kbapi.AgentPolicyGlobalDataTagsItem{ - Name: meta.Key, - Value: value, - } - }) - - if diags.HasError() { - return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags - } - - itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0, len(items)) - for _, v := range items { - itemsList = append(itemsList, v) - } - body.GlobalDataTags = &itemsList + tags, diags := model.convertGlobalDataTags(ctx, serverVersion) + if diags.HasError() { + return kbapi.PostFleetAgentPoliciesJSONRequestBody{}, diags } + body.GlobalDataTags = tags return body, nil } @@ -179,47 +197,11 @@ func (model *agentPolicyModel) toAPIUpdateModel(ctx context.Context, serverVersi Namespace: model.Namespace.ValueString(), } - if len(model.GlobalDataTags.Elements()) > 0 { - var diags diag.Diagnostics - if serverVersion.LessThan(MinVersionGlobalDataTags) { - diags.AddError("global_data_tags ES version error", fmt.Sprintf("Global data tags are only supported in Elastic Stack %s and above", MinVersionGlobalDataTags)) - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags - } - - items := utils.MapTypeToMap(ctx, model.GlobalDataTags, path.Root("global_data_tags"), &diags, - func(item globalDataTagsItemModel, meta utils.MapMeta) kbapi.AgentPolicyGlobalDataTagsItem { - - var value kbapi.AgentPolicyGlobalDataTagsItem_Value - var err error - if item.StringValue.ValueStringPointer() != nil { - err = value.FromAgentPolicyGlobalDataTagsItemValue0(*item.StringValue.ValueStringPointer()) - } else { - err = value.FromAgentPolicyGlobalDataTagsItemValue1(*item.NumberValue.ValueFloat32Pointer()) - } - if err != nil { - diags.AddError("global_data_tags validation_error_converting_values", err.Error()) - return kbapi.AgentPolicyGlobalDataTagsItem{} - } - return kbapi.AgentPolicyGlobalDataTagsItem{ - Name: meta.Key, - Value: value, - } - }) - if diags.HasError() { - return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags - } - - itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0, len(items)) - for _, v := range items { - itemsList = append(itemsList, v) - } - body.GlobalDataTags = &itemsList - } else { - if serverVersion.GreaterThanOrEqual(MinVersionGlobalDataTags) { - itemsList := make([]kbapi.AgentPolicyGlobalDataTagsItem, 0) - body.GlobalDataTags = &itemsList - } + tags, diags := model.convertGlobalDataTags(ctx, serverVersion) + if diags.HasError() { + return kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{}, diags } + body.GlobalDataTags = tags return body, nil } From eb9fa9ff44edbe914867fe5b6cd1600a710fc49e Mon Sep 17 00:00:00 2001 From: Toby Brain Date: Fri, 11 Apr 2025 08:48:44 +1000 Subject: [PATCH 89/89] Fixup changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fa6477bd..38adc1229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## [Unreleased] +- Add `global_data_tags` to fleet agent policies. ([#1044](https://github.com/elastic/terraform-provider-elasticstack/pull/1044)) + ## [0.11.14] - 2025-03-17 - Fix a provider crash when interacting with elasticstack_kibana_data_view resources created with 0.11.0. ([#979](https://github.com/elastic/terraform-provider-elasticstack/pull/979)) @@ -8,7 +10,6 @@ - Fix namespaces inconsistency when creating elasticstack_kibana_data_view resources ([#1011](https://github.com/elastic/terraform-provider-elasticstack/pull/1011)) - Update rule ID documentation. ([#1047](https://github.com/elastic/terraform-provider-elasticstack/pull/1047)) - Mark `elasticstack_kibana_action_connector.secrets` as sensitive. ([#1045](https://github.com/elastic/terraform-provider-elasticstack/pull/1045)) -- Add `global_data_tags` to fleet agent policies. ([#1044](https://github.com/elastic/terraform-provider-elasticstack/pull/1044)) ## [0.11.13] - 2025-01-09