diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index 292916b217c..7e681054ca5 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -416,6 +416,14 @@ These resource(s) are available for use in the current release of ASO. Different To install the CRDs for these resources, your ASO configuration must include `insights.azure.com/*` as a one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations. +### Next Release + +Development of these new resources is complete and they will be available in the next release of ASO. + +| Resource | ARM Version | CRD Version | Supported From | Sample | +|--------------------|--------------------|----------------------|----------------|--------| +| ScheduledQueryRule | 2024-01-01-preview | v1api20240101preview | v2.12.0 | - | + ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. @@ -427,7 +435,7 @@ These resource(s) are available for use in the current release of ASO. Different | [Component](https://azure.github.io/azure-service-operator/reference/insights/v1api20200202/#insights.azure.com/v1api20200202.Component) | 2020-02-02 | v1api20200202 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20200202_component.yaml) | | [DiagnosticSetting](https://azure.github.io/azure-service-operator/reference/insights/v1api20210501preview/#insights.azure.com/v1api20210501preview.DiagnosticSetting) | 2021-05-01-preview | v1api20210501preview | v2.11.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api20210501preview/v1api20210501preview_diagnosticsetting.yaml) | | [MetricAlert](https://azure.github.io/azure-service-operator/reference/insights/v1api20180301/#insights.azure.com/v1api20180301.MetricAlert) | 2018-03-01 | v1api20180301 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20180301_metricalert.yaml) | -| [ScheduledQueryRule](https://azure.github.io/azure-service-operator/reference/insights/v1api20220615/#insights.azure.com/v1api20220615.ScheduledQueryRule) | 2022-06-15 | v1api20220615 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20220615_scheduledqueryrule.yaml) | +| [ScheduledQueryRule](https://azure.github.io/azure-service-operator/reference/insights/v1api20220615/#insights.azure.com/v1api20220615.ScheduledQueryRule) | 2022-06-15 | v1api20220615 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api20220615/v1api20220615_scheduledqueryrule.yaml) | | [Webtest](https://azure.github.io/azure-service-operator/reference/insights/v1api20220615/#insights.azure.com/v1api20220615.Webtest) | 2022-06-15 | v1api20220615 | v2.7.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20220615_webtest.yaml) | | [Webtest](https://azure.github.io/azure-service-operator/reference/insights/v1api20180501preview/#insights.azure.com/v1api20180501preview.Webtest) | 2018-05-01-preview | v1api20180501preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20180501preview_webtest.yaml) | diff --git a/docs/hugo/content/reference/insights/_index.md b/docs/hugo/content/reference/insights/_index.md index ce1798d156b..d3059777ba9 100644 --- a/docs/hugo/content/reference/insights/_index.md +++ b/docs/hugo/content/reference/insights/_index.md @@ -5,6 +5,14 @@ no_list: true --- To install the CRDs for these resources, your ASO configuration must include `insights.azure.com/*` as a one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations. +### Next Release + +Development of these new resources is complete and they will be available in the next release of ASO. + +| Resource | ARM Version | CRD Version | Supported From | Sample | +|--------------------|--------------------|----------------------|----------------|--------| +| ScheduledQueryRule | 2024-01-01-preview | v1api20240101preview | v2.12.0 | - | + ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. @@ -16,7 +24,7 @@ These resource(s) are available for use in the current release of ASO. Different | [Component](https://azure.github.io/azure-service-operator/reference/insights/v1api20200202/#insights.azure.com/v1api20200202.Component) | 2020-02-02 | v1api20200202 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20200202_component.yaml) | | [DiagnosticSetting](https://azure.github.io/azure-service-operator/reference/insights/v1api20210501preview/#insights.azure.com/v1api20210501preview.DiagnosticSetting) | 2021-05-01-preview | v1api20210501preview | v2.11.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api20210501preview/v1api20210501preview_diagnosticsetting.yaml) | | [MetricAlert](https://azure.github.io/azure-service-operator/reference/insights/v1api20180301/#insights.azure.com/v1api20180301.MetricAlert) | 2018-03-01 | v1api20180301 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20180301_metricalert.yaml) | -| [ScheduledQueryRule](https://azure.github.io/azure-service-operator/reference/insights/v1api20220615/#insights.azure.com/v1api20220615.ScheduledQueryRule) | 2022-06-15 | v1api20220615 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20220615_scheduledqueryrule.yaml) | +| [ScheduledQueryRule](https://azure.github.io/azure-service-operator/reference/insights/v1api20220615/#insights.azure.com/v1api20220615.ScheduledQueryRule) | 2022-06-15 | v1api20220615 | v2.4.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api20220615/v1api20220615_scheduledqueryrule.yaml) | | [Webtest](https://azure.github.io/azure-service-operator/reference/insights/v1api20220615/#insights.azure.com/v1api20220615.Webtest) | 2022-06-15 | v1api20220615 | v2.7.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20220615_webtest.yaml) | | [Webtest](https://azure.github.io/azure-service-operator/reference/insights/v1api20180501preview/#insights.azure.com/v1api20180501preview.Webtest) | 2018-05-01-preview | v1api20180501preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/insights/v1api/v1api20180501preview_webtest.yaml) | diff --git a/v2/api/insights/customizations/scheduled_query_rule_extension_types_gen.go b/v2/api/insights/customizations/scheduled_query_rule_extension_types_gen.go index b2c9e8fd7c8..93a6488c9eb 100644 --- a/v2/api/insights/customizations/scheduled_query_rule_extension_types_gen.go +++ b/v2/api/insights/customizations/scheduled_query_rule_extension_types_gen.go @@ -5,7 +5,9 @@ package customizations import ( v20220615 "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615" - storage "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615/storage" + v20220615s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615/storage" + v20240101p "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview" + v20240101ps "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +18,7 @@ type ScheduledQueryRuleExtension struct { func (extension *ScheduledQueryRuleExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20220615.ScheduledQueryRule{}, - &storage.ScheduledQueryRule{}} + &v20220615s.ScheduledQueryRule{}, + &v20240101p.ScheduledQueryRule{}, + &v20240101ps.ScheduledQueryRule{}} } diff --git a/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_spec_types_gen.go b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_spec_types_gen.go new file mode 100644 index 00000000000..4aeb60bd7ca --- /dev/null +++ b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_spec_types_gen.go @@ -0,0 +1,316 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type ScheduledQueryRule_Spec struct { + // Identity: The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + + // Kind: Indicates the type of scheduled query rule. The default is LogAlert. + Kind *ScheduledQueryRule_Kind_Spec `json:"kind,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + + // Properties: The rule properties of the resource. + Properties *ScheduledQueryRuleProperties `json:"properties,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &ScheduledQueryRule_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01-preview" +func (rule ScheduledQueryRule_Spec) GetAPIVersion() string { + return "2024-01-01-preview" +} + +// GetName returns the Name of the resource +func (rule *ScheduledQueryRule_Spec) GetName() string { + return rule.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.Insights/scheduledQueryRules" +func (rule *ScheduledQueryRule_Spec) GetType() string { + return "Microsoft.Insights/scheduledQueryRules" +} + +// Identity for the resource. +type Identity struct { + // Type: Type of managed service identity. + Type *Identity_Type `json:"type,omitempty"` + UserAssignedIdentities map[string]UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} + +// +kubebuilder:validation:Enum={"EventLogAlert","LogAlert","LogToMetric"} +type ScheduledQueryRule_Kind_Spec string + +const ( + ScheduledQueryRule_Kind_Spec_EventLogAlert = ScheduledQueryRule_Kind_Spec("EventLogAlert") + ScheduledQueryRule_Kind_Spec_LogAlert = ScheduledQueryRule_Kind_Spec("LogAlert") + ScheduledQueryRule_Kind_Spec_LogToMetric = ScheduledQueryRule_Kind_Spec("LogToMetric") +) + +// Mapping from string to ScheduledQueryRule_Kind_Spec +var scheduledQueryRule_Kind_Spec_Values = map[string]ScheduledQueryRule_Kind_Spec{ + "eventlogalert": ScheduledQueryRule_Kind_Spec_EventLogAlert, + "logalert": ScheduledQueryRule_Kind_Spec_LogAlert, + "logtometric": ScheduledQueryRule_Kind_Spec_LogToMetric, +} + +// scheduled query rule Definition +type ScheduledQueryRuleProperties struct { + // Actions: Actions to invoke when the alert fires. + Actions *Actions `json:"actions,omitempty"` + + // AutoMitigate: The flag that indicates whether the alert should be automatically resolved or not. The default is true. + // Relevant only for rules of the kind LogAlert. + AutoMitigate *bool `json:"autoMitigate,omitempty"` + + // CheckWorkspaceAlertsStorageConfigured: The flag which indicates whether this scheduled query rule should be stored in + // the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. + CheckWorkspaceAlertsStorageConfigured *bool `json:"checkWorkspaceAlertsStorageConfigured,omitempty"` + + // Criteria: The rule criteria that defines the conditions of the scheduled query rule. + Criteria *ScheduledQueryRuleCriteria `json:"criteria,omitempty"` + + // Description: The description of the scheduled query rule. + Description *string `json:"description,omitempty"` + + // DisplayName: The display name of the alert rule + DisplayName *string `json:"displayName,omitempty"` + + // Enabled: The flag which indicates whether this scheduled query rule is enabled. Value should be true or false + Enabled *bool `json:"enabled,omitempty"` + + // EvaluationFrequency: How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant + // and required only for rules of the kind LogAlert. + EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` + + // MuteActionsDuration: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. + // Relevant only for rules of the kind LogAlert. + MuteActionsDuration *string `json:"muteActionsDuration,omitempty"` + + // OverrideQueryTimeRange: If specified then overrides the query time range (default is + // WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + OverrideQueryTimeRange *string `json:"overrideQueryTimeRange,omitempty"` + + // ResolveConfiguration: Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. + ResolveConfiguration *RuleResolveConfiguration `json:"resolveConfiguration,omitempty"` + Scopes []string `json:"scopes,omitempty"` + + // Severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only + // for rules of the kind LogAlert. + Severity *ScheduledQueryRuleProperties_Severity `json:"severity,omitempty"` + + // SkipQueryValidation: The flag which indicates whether the provided query should be validated or not. The default is + // false. Relevant only for rules of the kind LogAlert. + SkipQueryValidation *bool `json:"skipQueryValidation,omitempty"` + + // TargetResourceTypes: List of resource type of the target resource(s) on which the alert is created/updated. For example + // if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert + // will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of + // the kind LogAlert + TargetResourceTypes []string `json:"targetResourceTypes,omitempty"` + + // WindowSize: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). + // Relevant and required only for rules of the kind LogAlert. + WindowSize *string `json:"windowSize,omitempty"` +} + +// Actions to invoke when the alert fires. +type Actions struct { + ActionGroups []string `json:"actionGroups,omitempty"` + + // ActionProperties: The properties of an action properties. + ActionProperties map[string]string `json:"actionProperties,omitempty"` + + // CustomProperties: The properties of an alert payload. + CustomProperties map[string]string `json:"customProperties,omitempty"` +} + +// +kubebuilder:validation:Enum={"None","SystemAssigned","UserAssigned"} +type Identity_Type string + +const ( + Identity_Type_None = Identity_Type("None") + Identity_Type_SystemAssigned = Identity_Type("SystemAssigned") + Identity_Type_UserAssigned = Identity_Type("UserAssigned") +) + +// Mapping from string to Identity_Type +var identity_Type_Values = map[string]Identity_Type{ + "none": Identity_Type_None, + "systemassigned": Identity_Type_SystemAssigned, + "userassigned": Identity_Type_UserAssigned, +} + +// TBD. Relevant only for rules of the kind LogAlert. +type RuleResolveConfiguration struct { + // AutoResolved: The flag that indicates whether or not to auto resolve a fired alert. + AutoResolved *bool `json:"autoResolved,omitempty"` + + // TimeToResolve: The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented + // in ISO 8601 duration format. + TimeToResolve *string `json:"timeToResolve,omitempty"` +} + +// The rule criteria that defines the conditions of the scheduled query rule. +type ScheduledQueryRuleCriteria struct { + // AllOf: A list of conditions to evaluate against the specified scopes + AllOf []Condition `json:"allOf,omitempty"` +} + +// +kubebuilder:validation:Enum={0,1,2,3,4} +type ScheduledQueryRuleProperties_Severity int + +const ( + ScheduledQueryRuleProperties_Severity_0 = ScheduledQueryRuleProperties_Severity(0) + ScheduledQueryRuleProperties_Severity_1 = ScheduledQueryRuleProperties_Severity(1) + ScheduledQueryRuleProperties_Severity_2 = ScheduledQueryRuleProperties_Severity(2) + ScheduledQueryRuleProperties_Severity_3 = ScheduledQueryRuleProperties_Severity(3) + ScheduledQueryRuleProperties_Severity_4 = ScheduledQueryRuleProperties_Severity(4) +) + +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { +} + +// A condition of the scheduled query rule. +type Condition struct { + // AlertSensitivity: The extent of deviation required to trigger an alert. Allowed values are 'Low', 'Medium' and 'High'. + // This will affect how tight the threshold is to the metric series pattern. Relevant and required only for dynamic + // threshold rules of the kind LogAlert. + AlertSensitivity *string `json:"alertSensitivity,omitempty"` + + // CriterionType: Specifies the type of threshold criteria + CriterionType *Condition_CriterionType `json:"criterionType,omitempty"` + + // Dimensions: List of Dimensions conditions + Dimensions []Dimension `json:"dimensions,omitempty"` + + // FailingPeriods: The minimum number of violations required within the selected lookback time window required to raise an + // alert. Relevant only for rules of the kind LogAlert. + FailingPeriods *Condition_FailingPeriods `json:"failingPeriods,omitempty"` + + // IgnoreDataBefore: Use this option to set the date from which to start learning the metric historical data and calculate + // the dynamic thresholds (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert. + IgnoreDataBefore *string `json:"ignoreDataBefore,omitempty"` + + // MetricMeasureColumn: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. + MetricMeasureColumn *string `json:"metricMeasureColumn,omitempty"` + + // MetricName: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. + MetricName *string `json:"metricName,omitempty"` + + // Operator: The criteria operator. Relevant and required only for rules of the kind LogAlert. + Operator *Condition_Operator `json:"operator,omitempty"` + + // Query: Log query alert + Query *string `json:"query,omitempty"` + ResourceIdColumn *string `json:"resourceIdColumn,omitempty"` + + // Threshold: the criteria threshold value that activates the alert. Relevant and required only for static threshold rules + // of the kind LogAlert. + Threshold *float64 `json:"threshold,omitempty"` + + // TimeAggregation: Aggregation type. Relevant and required only for rules of the kind LogAlert. + TimeAggregation *Condition_TimeAggregation `json:"timeAggregation,omitempty"` +} + +// +kubebuilder:validation:Enum={"DynamicThresholdCriterion","StaticThresholdCriterion"} +type Condition_CriterionType string + +const ( + Condition_CriterionType_DynamicThresholdCriterion = Condition_CriterionType("DynamicThresholdCriterion") + Condition_CriterionType_StaticThresholdCriterion = Condition_CriterionType("StaticThresholdCriterion") +) + +// Mapping from string to Condition_CriterionType +var condition_CriterionType_Values = map[string]Condition_CriterionType{ + "dynamicthresholdcriterion": Condition_CriterionType_DynamicThresholdCriterion, + "staticthresholdcriterion": Condition_CriterionType_StaticThresholdCriterion, +} + +type Condition_FailingPeriods struct { + // MinFailingPeriodsToAlert: The number of violations to trigger an alert. Should be smaller or equal to + // numberOfEvaluationPeriods. Default value is 1 + MinFailingPeriodsToAlert *int `json:"minFailingPeriodsToAlert,omitempty"` + + // NumberOfEvaluationPeriods: The number of aggregated lookback points. The lookback time window is calculated based on the + // aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 + NumberOfEvaluationPeriods *int `json:"numberOfEvaluationPeriods,omitempty"` +} + +// +kubebuilder:validation:Enum={"Equals","GreaterOrLessThan","GreaterThan","GreaterThanOrEqual","LessThan","LessThanOrEqual"} +type Condition_Operator string + +const ( + Condition_Operator_Equals = Condition_Operator("Equals") + Condition_Operator_GreaterOrLessThan = Condition_Operator("GreaterOrLessThan") + Condition_Operator_GreaterThan = Condition_Operator("GreaterThan") + Condition_Operator_GreaterThanOrEqual = Condition_Operator("GreaterThanOrEqual") + Condition_Operator_LessThan = Condition_Operator("LessThan") + Condition_Operator_LessThanOrEqual = Condition_Operator("LessThanOrEqual") +) + +// Mapping from string to Condition_Operator +var condition_Operator_Values = map[string]Condition_Operator{ + "equals": Condition_Operator_Equals, + "greaterorlessthan": Condition_Operator_GreaterOrLessThan, + "greaterthan": Condition_Operator_GreaterThan, + "greaterthanorequal": Condition_Operator_GreaterThanOrEqual, + "lessthan": Condition_Operator_LessThan, + "lessthanorequal": Condition_Operator_LessThanOrEqual, +} + +// +kubebuilder:validation:Enum={"Average","Count","Maximum","Minimum","Total"} +type Condition_TimeAggregation string + +const ( + Condition_TimeAggregation_Average = Condition_TimeAggregation("Average") + Condition_TimeAggregation_Count = Condition_TimeAggregation("Count") + Condition_TimeAggregation_Maximum = Condition_TimeAggregation("Maximum") + Condition_TimeAggregation_Minimum = Condition_TimeAggregation("Minimum") + Condition_TimeAggregation_Total = Condition_TimeAggregation("Total") +) + +// Mapping from string to Condition_TimeAggregation +var condition_TimeAggregation_Values = map[string]Condition_TimeAggregation{ + "average": Condition_TimeAggregation_Average, + "count": Condition_TimeAggregation_Count, + "maximum": Condition_TimeAggregation_Maximum, + "minimum": Condition_TimeAggregation_Minimum, + "total": Condition_TimeAggregation_Total, +} + +// Dimension splitting and filtering definition +type Dimension struct { + // Name: Name of the dimension + Name *string `json:"name,omitempty"` + + // Operator: Operator for dimension values + Operator *Dimension_Operator `json:"operator,omitempty"` + + // Values: List of dimension values + Values []string `json:"values,omitempty"` +} + +// +kubebuilder:validation:Enum={"Exclude","Include"} +type Dimension_Operator string + +const ( + Dimension_Operator_Exclude = Dimension_Operator("Exclude") + Dimension_Operator_Include = Dimension_Operator("Include") +) + +// Mapping from string to Dimension_Operator +var dimension_Operator_Values = map[string]Dimension_Operator{ + "exclude": Dimension_Operator_Exclude, + "include": Dimension_Operator_Include, +} diff --git a/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_spec_types_gen_test.go b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_spec_types_gen_test.go new file mode 100644 index 00000000000..7afda83452a --- /dev/null +++ b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_spec_types_gen_test.go @@ -0,0 +1,732 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_Actions_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Actions via JSON returns original", + prop.ForAll(RunJSONSerializationTestForActions, ActionsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForActions runs a test to see if a specific instance of Actions round trips to JSON and back losslessly +func RunJSONSerializationTestForActions(subject Actions) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Actions + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Actions instances for property testing - lazily instantiated by ActionsGenerator() +var actionsGenerator gopter.Gen + +// ActionsGenerator returns a generator of Actions instances for property testing. +func ActionsGenerator() gopter.Gen { + if actionsGenerator != nil { + return actionsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForActions(generators) + actionsGenerator = gen.Struct(reflect.TypeOf(Actions{}), generators) + + return actionsGenerator +} + +// AddIndependentPropertyGeneratorsForActions is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForActions(gens map[string]gopter.Gen) { + gens["ActionGroups"] = gen.SliceOf(gen.AlphaString()) + gens["ActionProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["CustomProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +func Test_Condition_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition, ConditionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition runs a test to see if a specific instance of Condition round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition(subject Condition) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition instances for property testing - lazily instantiated by ConditionGenerator() +var conditionGenerator gopter.Gen + +// ConditionGenerator returns a generator of Condition instances for property testing. +// We first initialize conditionGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ConditionGenerator() gopter.Gen { + if conditionGenerator != nil { + return conditionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition(generators) + conditionGenerator = gen.Struct(reflect.TypeOf(Condition{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition(generators) + AddRelatedPropertyGeneratorsForCondition(generators) + conditionGenerator = gen.Struct(reflect.TypeOf(Condition{}), generators) + + return conditionGenerator +} + +// AddIndependentPropertyGeneratorsForCondition is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition(gens map[string]gopter.Gen) { + gens["AlertSensitivity"] = gen.PtrOf(gen.AlphaString()) + gens["CriterionType"] = gen.PtrOf(gen.OneConstOf(Condition_CriterionType_DynamicThresholdCriterion, Condition_CriterionType_StaticThresholdCriterion)) + gens["IgnoreDataBefore"] = gen.PtrOf(gen.AlphaString()) + gens["MetricMeasureColumn"] = gen.PtrOf(gen.AlphaString()) + gens["MetricName"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf( + Condition_Operator_Equals, + Condition_Operator_GreaterOrLessThan, + Condition_Operator_GreaterThan, + Condition_Operator_GreaterThanOrEqual, + Condition_Operator_LessThan, + Condition_Operator_LessThanOrEqual)) + gens["Query"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceIdColumn"] = gen.PtrOf(gen.AlphaString()) + gens["Threshold"] = gen.PtrOf(gen.Float64()) + gens["TimeAggregation"] = gen.PtrOf(gen.OneConstOf( + Condition_TimeAggregation_Average, + Condition_TimeAggregation_Count, + Condition_TimeAggregation_Maximum, + Condition_TimeAggregation_Minimum, + Condition_TimeAggregation_Total)) +} + +// AddRelatedPropertyGeneratorsForCondition is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCondition(gens map[string]gopter.Gen) { + gens["Dimensions"] = gen.SliceOf(DimensionGenerator()) + gens["FailingPeriods"] = gen.PtrOf(Condition_FailingPeriodsGenerator()) +} + +func Test_Condition_FailingPeriods_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_FailingPeriods via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_FailingPeriods, Condition_FailingPeriodsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_FailingPeriods runs a test to see if a specific instance of Condition_FailingPeriods round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_FailingPeriods(subject Condition_FailingPeriods) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_FailingPeriods + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_FailingPeriods instances for property testing - lazily instantiated by +// Condition_FailingPeriodsGenerator() +var condition_FailingPeriodsGenerator gopter.Gen + +// Condition_FailingPeriodsGenerator returns a generator of Condition_FailingPeriods instances for property testing. +func Condition_FailingPeriodsGenerator() gopter.Gen { + if condition_FailingPeriodsGenerator != nil { + return condition_FailingPeriodsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_FailingPeriods(generators) + condition_FailingPeriodsGenerator = gen.Struct(reflect.TypeOf(Condition_FailingPeriods{}), generators) + + return condition_FailingPeriodsGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_FailingPeriods is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_FailingPeriods(gens map[string]gopter.Gen) { + gens["MinFailingPeriodsToAlert"] = gen.PtrOf(gen.Int()) + gens["NumberOfEvaluationPeriods"] = gen.PtrOf(gen.Int()) +} + +func Test_Dimension_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Dimension via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDimension, DimensionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDimension runs a test to see if a specific instance of Dimension round trips to JSON and back losslessly +func RunJSONSerializationTestForDimension(subject Dimension) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Dimension + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Dimension instances for property testing - lazily instantiated by DimensionGenerator() +var dimensionGenerator gopter.Gen + +// DimensionGenerator returns a generator of Dimension instances for property testing. +func DimensionGenerator() gopter.Gen { + if dimensionGenerator != nil { + return dimensionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDimension(generators) + dimensionGenerator = gen.Struct(reflect.TypeOf(Dimension{}), generators) + + return dimensionGenerator +} + +// AddIndependentPropertyGeneratorsForDimension is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDimension(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf(Dimension_Operator_Exclude, Dimension_Operator_Include)) + gens["Values"] = gen.SliceOf(gen.AlphaString()) +} + +func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity(subject Identity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() +var identityGenerator gopter.Gen + +// IdentityGenerator returns a generator of Identity instances for property testing. +// We first initialize identityGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + AddRelatedPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + return identityGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf(Identity_Type_None, Identity_Type_SystemAssigned, Identity_Type_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf( + gen.AlphaString(), + UserAssignedIdentityDetailsGenerator()) +} + +func Test_RuleResolveConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RuleResolveConfiguration via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleResolveConfiguration, RuleResolveConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleResolveConfiguration runs a test to see if a specific instance of RuleResolveConfiguration round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleResolveConfiguration(subject RuleResolveConfiguration) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RuleResolveConfiguration + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RuleResolveConfiguration instances for property testing - lazily instantiated by +// RuleResolveConfigurationGenerator() +var ruleResolveConfigurationGenerator gopter.Gen + +// RuleResolveConfigurationGenerator returns a generator of RuleResolveConfiguration instances for property testing. +func RuleResolveConfigurationGenerator() gopter.Gen { + if ruleResolveConfigurationGenerator != nil { + return ruleResolveConfigurationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleResolveConfiguration(generators) + ruleResolveConfigurationGenerator = gen.Struct(reflect.TypeOf(RuleResolveConfiguration{}), generators) + + return ruleResolveConfigurationGenerator +} + +// AddIndependentPropertyGeneratorsForRuleResolveConfiguration is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleResolveConfiguration(gens map[string]gopter.Gen) { + gens["AutoResolved"] = gen.PtrOf(gen.Bool()) + gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScheduledQueryRuleCriteria_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleCriteria via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleCriteria, ScheduledQueryRuleCriteriaGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleCriteria runs a test to see if a specific instance of ScheduledQueryRuleCriteria round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleCriteria(subject ScheduledQueryRuleCriteria) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleCriteria + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleCriteria instances for property testing - lazily instantiated by +// ScheduledQueryRuleCriteriaGenerator() +var scheduledQueryRuleCriteriaGenerator gopter.Gen + +// ScheduledQueryRuleCriteriaGenerator returns a generator of ScheduledQueryRuleCriteria instances for property testing. +func ScheduledQueryRuleCriteriaGenerator() gopter.Gen { + if scheduledQueryRuleCriteriaGenerator != nil { + return scheduledQueryRuleCriteriaGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria(generators) + scheduledQueryRuleCriteriaGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleCriteria{}), generators) + + return scheduledQueryRuleCriteriaGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria(gens map[string]gopter.Gen) { + gens["AllOf"] = gen.SliceOf(ConditionGenerator()) +} + +func Test_ScheduledQueryRuleProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleProperties, ScheduledQueryRulePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleProperties runs a test to see if a specific instance of ScheduledQueryRuleProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleProperties(subject ScheduledQueryRuleProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleProperties instances for property testing - lazily instantiated by +// ScheduledQueryRulePropertiesGenerator() +var scheduledQueryRulePropertiesGenerator gopter.Gen + +// ScheduledQueryRulePropertiesGenerator returns a generator of ScheduledQueryRuleProperties instances for property testing. +// We first initialize scheduledQueryRulePropertiesGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRulePropertiesGenerator() gopter.Gen { + if scheduledQueryRulePropertiesGenerator != nil { + return scheduledQueryRulePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties(generators) + scheduledQueryRulePropertiesGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRuleProperties(generators) + scheduledQueryRulePropertiesGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleProperties{}), generators) + + return scheduledQueryRulePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties(gens map[string]gopter.Gen) { + gens["AutoMitigate"] = gen.PtrOf(gen.Bool()) + gens["CheckWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["EvaluationFrequency"] = gen.PtrOf(gen.AlphaString()) + gens["MuteActionsDuration"] = gen.PtrOf(gen.AlphaString()) + gens["OverrideQueryTimeRange"] = gen.PtrOf(gen.AlphaString()) + gens["Scopes"] = gen.SliceOf(gen.AlphaString()) + gens["Severity"] = gen.PtrOf(gen.OneConstOf( + ScheduledQueryRuleProperties_Severity_0, + ScheduledQueryRuleProperties_Severity_1, + ScheduledQueryRuleProperties_Severity_2, + ScheduledQueryRuleProperties_Severity_3, + ScheduledQueryRuleProperties_Severity_4)) + gens["SkipQueryValidation"] = gen.PtrOf(gen.Bool()) + gens["TargetResourceTypes"] = gen.SliceOf(gen.AlphaString()) + gens["WindowSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleProperties(gens map[string]gopter.Gen) { + gens["Actions"] = gen.PtrOf(ActionsGenerator()) + gens["Criteria"] = gen.PtrOf(ScheduledQueryRuleCriteriaGenerator()) + gens["ResolveConfiguration"] = gen.PtrOf(RuleResolveConfigurationGenerator()) +} + +func Test_ScheduledQueryRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule_Spec, ScheduledQueryRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule_Spec runs a test to see if a specific instance of ScheduledQueryRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule_Spec(subject ScheduledQueryRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule_Spec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule_Spec instances for property testing - lazily instantiated by +// ScheduledQueryRule_SpecGenerator() +var scheduledQueryRule_SpecGenerator gopter.Gen + +// ScheduledQueryRule_SpecGenerator returns a generator of ScheduledQueryRule_Spec instances for property testing. +// We first initialize scheduledQueryRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRule_SpecGenerator() gopter.Gen { + if scheduledQueryRule_SpecGenerator != nil { + return scheduledQueryRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(generators) + scheduledQueryRule_SpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec(generators) + scheduledQueryRule_SpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_Spec{}), generators) + + return scheduledQueryRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(gens map[string]gopter.Gen) { + gens["Kind"] = gen.PtrOf(gen.OneConstOf(ScheduledQueryRule_Kind_Spec_EventLogAlert, ScheduledQueryRule_Kind_Spec_LogAlert, ScheduledQueryRule_Kind_Spec_LogToMetric)) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.AlphaString() + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["Properties"] = gen.PtrOf(ScheduledQueryRulePropertiesGenerator()) +} + +func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityDetails via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityDetails + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by +// UserAssignedIdentityDetailsGenerator() +var userAssignedIdentityDetailsGenerator gopter.Gen + +// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. +func UserAssignedIdentityDetailsGenerator() gopter.Gen { + if userAssignedIdentityDetailsGenerator != nil { + return userAssignedIdentityDetailsGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) + + return userAssignedIdentityDetailsGenerator +} diff --git a/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_status_types_gen.go b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_status_types_gen.go new file mode 100644 index 00000000000..f12831cd55a --- /dev/null +++ b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_status_types_gen.go @@ -0,0 +1,394 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +type ScheduledQueryRule_STATUS struct { + // Etag: The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per + // the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + // HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and + // If-Range (section 14.27) header fields. + Etag *string `json:"etag,omitempty"` + + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Identity: The identity of the resource. + Identity *Identity_STATUS `json:"identity,omitempty"` + + // Kind: Indicates the type of scheduled query rule. The default is LogAlert. + Kind *ScheduledQueryRule_Kind_STATUS `json:"kind,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: The rule properties of the resource. + Properties *ScheduledQueryRuleProperties_STATUS `json:"properties,omitempty"` + + // SystemData: SystemData of ScheduledQueryRule. + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// Identity for the resource. +type Identity_STATUS struct { + // PrincipalId: The principal ID of resource identity. + PrincipalId *string `json:"principalId,omitempty"` + + // TenantId: The tenant ID of resource. + TenantId *string `json:"tenantId,omitempty"` + + // Type: Type of managed service identity. + Type *Identity_Type_STATUS `json:"type,omitempty"` + + // UserAssignedIdentities: The list of user identities associated with the resource. The user identity dictionary key + // references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]UserIdentityProperties_STATUS `json:"userAssignedIdentities,omitempty"` +} + +type ScheduledQueryRule_Kind_STATUS string + +const ( + ScheduledQueryRule_Kind_STATUS_EventLogAlert = ScheduledQueryRule_Kind_STATUS("EventLogAlert") + ScheduledQueryRule_Kind_STATUS_LogAlert = ScheduledQueryRule_Kind_STATUS("LogAlert") + ScheduledQueryRule_Kind_STATUS_LogToMetric = ScheduledQueryRule_Kind_STATUS("LogToMetric") +) + +// Mapping from string to ScheduledQueryRule_Kind_STATUS +var scheduledQueryRule_Kind_STATUS_Values = map[string]ScheduledQueryRule_Kind_STATUS{ + "eventlogalert": ScheduledQueryRule_Kind_STATUS_EventLogAlert, + "logalert": ScheduledQueryRule_Kind_STATUS_LogAlert, + "logtometric": ScheduledQueryRule_Kind_STATUS_LogToMetric, +} + +// scheduled query rule Definition +type ScheduledQueryRuleProperties_STATUS struct { + // Actions: Actions to invoke when the alert fires. + Actions *Actions_STATUS `json:"actions,omitempty"` + + // AutoMitigate: The flag that indicates whether the alert should be automatically resolved or not. The default is true. + // Relevant only for rules of the kind LogAlert. + AutoMitigate *bool `json:"autoMitigate,omitempty"` + + // CheckWorkspaceAlertsStorageConfigured: The flag which indicates whether this scheduled query rule should be stored in + // the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. + CheckWorkspaceAlertsStorageConfigured *bool `json:"checkWorkspaceAlertsStorageConfigured,omitempty"` + + // CreatedWithApiVersion: The api-version used when creating this alert rule + CreatedWithApiVersion *string `json:"createdWithApiVersion,omitempty"` + + // Criteria: The rule criteria that defines the conditions of the scheduled query rule. + Criteria *ScheduledQueryRuleCriteria_STATUS `json:"criteria,omitempty"` + + // Description: The description of the scheduled query rule. + Description *string `json:"description,omitempty"` + + // DisplayName: The display name of the alert rule + DisplayName *string `json:"displayName,omitempty"` + + // Enabled: The flag which indicates whether this scheduled query rule is enabled. Value should be true or false + Enabled *bool `json:"enabled,omitempty"` + + // EvaluationFrequency: How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant + // and required only for rules of the kind LogAlert. + EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` + + // IsLegacyLogAnalyticsRule: True if alert rule is legacy Log Analytic rule + IsLegacyLogAnalyticsRule *bool `json:"isLegacyLogAnalyticsRule,omitempty"` + + // IsWorkspaceAlertsStorageConfigured: The flag which indicates whether this scheduled query rule has been configured to be + // stored in the customer's storage. The default is false. + IsWorkspaceAlertsStorageConfigured *bool `json:"isWorkspaceAlertsStorageConfigured,omitempty"` + + // MuteActionsDuration: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. + // Relevant only for rules of the kind LogAlert. + MuteActionsDuration *string `json:"muteActionsDuration,omitempty"` + + // OverrideQueryTimeRange: If specified then overrides the query time range (default is + // WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + OverrideQueryTimeRange *string `json:"overrideQueryTimeRange,omitempty"` + + // ResolveConfiguration: Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. + ResolveConfiguration *RuleResolveConfiguration_STATUS `json:"resolveConfiguration,omitempty"` + + // Scopes: The list of resource id's that this scheduled query rule is scoped to. + Scopes []string `json:"scopes,omitempty"` + + // Severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only + // for rules of the kind LogAlert. + Severity *ScheduledQueryRuleProperties_Severity_STATUS `json:"severity,omitempty"` + + // SkipQueryValidation: The flag which indicates whether the provided query should be validated or not. The default is + // false. Relevant only for rules of the kind LogAlert. + SkipQueryValidation *bool `json:"skipQueryValidation,omitempty"` + + // TargetResourceTypes: List of resource type of the target resource(s) on which the alert is created/updated. For example + // if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert + // will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of + // the kind LogAlert + TargetResourceTypes []string `json:"targetResourceTypes,omitempty"` + + // WindowSize: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). + // Relevant and required only for rules of the kind LogAlert. + WindowSize *string `json:"windowSize,omitempty"` +} + +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + // CreatedAt: The timestamp of resource creation (UTC). + CreatedAt *string `json:"createdAt,omitempty"` + + // CreatedBy: The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // CreatedByType: The type of identity that created the resource. + CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"` + + // LastModifiedAt: The timestamp of resource last modification (UTC) + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + + // LastModifiedBy: The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // LastModifiedByType: The type of identity that last modified the resource. + LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"` +} + +// Actions to invoke when the alert fires. +type Actions_STATUS struct { + // ActionGroups: Action Group resource Ids to invoke when the alert fires. + ActionGroups []string `json:"actionGroups,omitempty"` + + // ActionProperties: The properties of an action properties. + ActionProperties map[string]string `json:"actionProperties,omitempty"` + + // CustomProperties: The properties of an alert payload. + CustomProperties map[string]string `json:"customProperties,omitempty"` +} + +type Identity_Type_STATUS string + +const ( + Identity_Type_STATUS_None = Identity_Type_STATUS("None") + Identity_Type_STATUS_SystemAssigned = Identity_Type_STATUS("SystemAssigned") + Identity_Type_STATUS_UserAssigned = Identity_Type_STATUS("UserAssigned") +) + +// Mapping from string to Identity_Type_STATUS +var identity_Type_STATUS_Values = map[string]Identity_Type_STATUS{ + "none": Identity_Type_STATUS_None, + "systemassigned": Identity_Type_STATUS_SystemAssigned, + "userassigned": Identity_Type_STATUS_UserAssigned, +} + +// TBD. Relevant only for rules of the kind LogAlert. +type RuleResolveConfiguration_STATUS struct { + // AutoResolved: The flag that indicates whether or not to auto resolve a fired alert. + AutoResolved *bool `json:"autoResolved,omitempty"` + + // TimeToResolve: The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented + // in ISO 8601 duration format. + TimeToResolve *string `json:"timeToResolve,omitempty"` +} + +// The rule criteria that defines the conditions of the scheduled query rule. +type ScheduledQueryRuleCriteria_STATUS struct { + // AllOf: A list of conditions to evaluate against the specified scopes + AllOf []Condition_STATUS `json:"allOf,omitempty"` +} + +type ScheduledQueryRuleProperties_Severity_STATUS int + +const ( + ScheduledQueryRuleProperties_Severity_STATUS_0 = ScheduledQueryRuleProperties_Severity_STATUS(0) + ScheduledQueryRuleProperties_Severity_STATUS_1 = ScheduledQueryRuleProperties_Severity_STATUS(1) + ScheduledQueryRuleProperties_Severity_STATUS_2 = ScheduledQueryRuleProperties_Severity_STATUS(2) + ScheduledQueryRuleProperties_Severity_STATUS_3 = ScheduledQueryRuleProperties_Severity_STATUS(3) + ScheduledQueryRuleProperties_Severity_STATUS_4 = ScheduledQueryRuleProperties_Severity_STATUS(4) +) + +type SystemData_CreatedByType_STATUS string + +const ( + SystemData_CreatedByType_STATUS_Application = SystemData_CreatedByType_STATUS("Application") + SystemData_CreatedByType_STATUS_Key = SystemData_CreatedByType_STATUS("Key") + SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity") + SystemData_CreatedByType_STATUS_User = SystemData_CreatedByType_STATUS("User") +) + +// Mapping from string to SystemData_CreatedByType_STATUS +var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{ + "application": SystemData_CreatedByType_STATUS_Application, + "key": SystemData_CreatedByType_STATUS_Key, + "managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity, + "user": SystemData_CreatedByType_STATUS_User, +} + +type SystemData_LastModifiedByType_STATUS string + +const ( + SystemData_LastModifiedByType_STATUS_Application = SystemData_LastModifiedByType_STATUS("Application") + SystemData_LastModifiedByType_STATUS_Key = SystemData_LastModifiedByType_STATUS("Key") + SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity") + SystemData_LastModifiedByType_STATUS_User = SystemData_LastModifiedByType_STATUS("User") +) + +// Mapping from string to SystemData_LastModifiedByType_STATUS +var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{ + "application": SystemData_LastModifiedByType_STATUS_Application, + "key": SystemData_LastModifiedByType_STATUS_Key, + "managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity, + "user": SystemData_LastModifiedByType_STATUS_User, +} + +// User assigned identity properties. +type UserIdentityProperties_STATUS struct { + // ClientId: The client id of user assigned identity. + ClientId *string `json:"clientId,omitempty"` + + // PrincipalId: The principal id of user assigned identity. + PrincipalId *string `json:"principalId,omitempty"` +} + +// A condition of the scheduled query rule. +type Condition_STATUS struct { + // AlertSensitivity: The extent of deviation required to trigger an alert. Allowed values are 'Low', 'Medium' and 'High'. + // This will affect how tight the threshold is to the metric series pattern. Relevant and required only for dynamic + // threshold rules of the kind LogAlert. + AlertSensitivity *string `json:"alertSensitivity,omitempty"` + + // CriterionType: Specifies the type of threshold criteria + CriterionType *Condition_CriterionType_STATUS `json:"criterionType,omitempty"` + + // Dimensions: List of Dimensions conditions + Dimensions []Dimension_STATUS `json:"dimensions,omitempty"` + + // FailingPeriods: The minimum number of violations required within the selected lookback time window required to raise an + // alert. Relevant only for rules of the kind LogAlert. + FailingPeriods *Condition_FailingPeriods_STATUS `json:"failingPeriods,omitempty"` + + // IgnoreDataBefore: Use this option to set the date from which to start learning the metric historical data and calculate + // the dynamic thresholds (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert. + IgnoreDataBefore *string `json:"ignoreDataBefore,omitempty"` + + // MetricMeasureColumn: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. + MetricMeasureColumn *string `json:"metricMeasureColumn,omitempty"` + + // MetricName: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. + MetricName *string `json:"metricName,omitempty"` + + // Operator: The criteria operator. Relevant and required only for rules of the kind LogAlert. + Operator *Condition_Operator_STATUS `json:"operator,omitempty"` + + // Query: Log query alert + Query *string `json:"query,omitempty"` + + // ResourceIdColumn: The column containing the resource id. The content of the column must be a uri formatted as resource + // id. Relevant only for rules of the kind LogAlert. + ResourceIdColumn *string `json:"resourceIdColumn,omitempty"` + + // Threshold: the criteria threshold value that activates the alert. Relevant and required only for static threshold rules + // of the kind LogAlert. + Threshold *float64 `json:"threshold,omitempty"` + + // TimeAggregation: Aggregation type. Relevant and required only for rules of the kind LogAlert. + TimeAggregation *Condition_TimeAggregation_STATUS `json:"timeAggregation,omitempty"` +} + +type Condition_CriterionType_STATUS string + +const ( + Condition_CriterionType_STATUS_DynamicThresholdCriterion = Condition_CriterionType_STATUS("DynamicThresholdCriterion") + Condition_CriterionType_STATUS_StaticThresholdCriterion = Condition_CriterionType_STATUS("StaticThresholdCriterion") +) + +// Mapping from string to Condition_CriterionType_STATUS +var condition_CriterionType_STATUS_Values = map[string]Condition_CriterionType_STATUS{ + "dynamicthresholdcriterion": Condition_CriterionType_STATUS_DynamicThresholdCriterion, + "staticthresholdcriterion": Condition_CriterionType_STATUS_StaticThresholdCriterion, +} + +type Condition_FailingPeriods_STATUS struct { + // MinFailingPeriodsToAlert: The number of violations to trigger an alert. Should be smaller or equal to + // numberOfEvaluationPeriods. Default value is 1 + MinFailingPeriodsToAlert *int `json:"minFailingPeriodsToAlert,omitempty"` + + // NumberOfEvaluationPeriods: The number of aggregated lookback points. The lookback time window is calculated based on the + // aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 + NumberOfEvaluationPeriods *int `json:"numberOfEvaluationPeriods,omitempty"` +} + +type Condition_Operator_STATUS string + +const ( + Condition_Operator_STATUS_Equals = Condition_Operator_STATUS("Equals") + Condition_Operator_STATUS_GreaterOrLessThan = Condition_Operator_STATUS("GreaterOrLessThan") + Condition_Operator_STATUS_GreaterThan = Condition_Operator_STATUS("GreaterThan") + Condition_Operator_STATUS_GreaterThanOrEqual = Condition_Operator_STATUS("GreaterThanOrEqual") + Condition_Operator_STATUS_LessThan = Condition_Operator_STATUS("LessThan") + Condition_Operator_STATUS_LessThanOrEqual = Condition_Operator_STATUS("LessThanOrEqual") +) + +// Mapping from string to Condition_Operator_STATUS +var condition_Operator_STATUS_Values = map[string]Condition_Operator_STATUS{ + "equals": Condition_Operator_STATUS_Equals, + "greaterorlessthan": Condition_Operator_STATUS_GreaterOrLessThan, + "greaterthan": Condition_Operator_STATUS_GreaterThan, + "greaterthanorequal": Condition_Operator_STATUS_GreaterThanOrEqual, + "lessthan": Condition_Operator_STATUS_LessThan, + "lessthanorequal": Condition_Operator_STATUS_LessThanOrEqual, +} + +type Condition_TimeAggregation_STATUS string + +const ( + Condition_TimeAggregation_STATUS_Average = Condition_TimeAggregation_STATUS("Average") + Condition_TimeAggregation_STATUS_Count = Condition_TimeAggregation_STATUS("Count") + Condition_TimeAggregation_STATUS_Maximum = Condition_TimeAggregation_STATUS("Maximum") + Condition_TimeAggregation_STATUS_Minimum = Condition_TimeAggregation_STATUS("Minimum") + Condition_TimeAggregation_STATUS_Total = Condition_TimeAggregation_STATUS("Total") +) + +// Mapping from string to Condition_TimeAggregation_STATUS +var condition_TimeAggregation_STATUS_Values = map[string]Condition_TimeAggregation_STATUS{ + "average": Condition_TimeAggregation_STATUS_Average, + "count": Condition_TimeAggregation_STATUS_Count, + "maximum": Condition_TimeAggregation_STATUS_Maximum, + "minimum": Condition_TimeAggregation_STATUS_Minimum, + "total": Condition_TimeAggregation_STATUS_Total, +} + +// Dimension splitting and filtering definition +type Dimension_STATUS struct { + // Name: Name of the dimension + Name *string `json:"name,omitempty"` + + // Operator: Operator for dimension values + Operator *Dimension_Operator_STATUS `json:"operator,omitempty"` + + // Values: List of dimension values + Values []string `json:"values,omitempty"` +} + +type Dimension_Operator_STATUS string + +const ( + Dimension_Operator_STATUS_Exclude = Dimension_Operator_STATUS("Exclude") + Dimension_Operator_STATUS_Include = Dimension_Operator_STATUS("Include") +) + +// Mapping from string to Dimension_Operator_STATUS +var dimension_Operator_STATUS_Values = map[string]Dimension_Operator_STATUS{ + "exclude": Dimension_Operator_STATUS_Exclude, + "include": Dimension_Operator_STATUS_Include, +} diff --git a/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_status_types_gen_test.go b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_status_types_gen_test.go new file mode 100644 index 00000000000..75ad7ab8b74 --- /dev/null +++ b/v2/api/insights/v1api20240101preview/arm/scheduled_query_rule_status_types_gen_test.go @@ -0,0 +1,821 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_Actions_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Actions_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForActions_STATUS, Actions_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForActions_STATUS runs a test to see if a specific instance of Actions_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForActions_STATUS(subject Actions_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Actions_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Actions_STATUS instances for property testing - lazily instantiated by Actions_STATUSGenerator() +var actions_STATUSGenerator gopter.Gen + +// Actions_STATUSGenerator returns a generator of Actions_STATUS instances for property testing. +func Actions_STATUSGenerator() gopter.Gen { + if actions_STATUSGenerator != nil { + return actions_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForActions_STATUS(generators) + actions_STATUSGenerator = gen.Struct(reflect.TypeOf(Actions_STATUS{}), generators) + + return actions_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForActions_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForActions_STATUS(gens map[string]gopter.Gen) { + gens["ActionGroups"] = gen.SliceOf(gen.AlphaString()) + gens["ActionProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["CustomProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +func Test_Condition_FailingPeriods_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_FailingPeriods_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_FailingPeriods_STATUS, Condition_FailingPeriods_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_FailingPeriods_STATUS runs a test to see if a specific instance of Condition_FailingPeriods_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_FailingPeriods_STATUS(subject Condition_FailingPeriods_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_FailingPeriods_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_FailingPeriods_STATUS instances for property testing - lazily instantiated by +// Condition_FailingPeriods_STATUSGenerator() +var condition_FailingPeriods_STATUSGenerator gopter.Gen + +// Condition_FailingPeriods_STATUSGenerator returns a generator of Condition_FailingPeriods_STATUS instances for property testing. +func Condition_FailingPeriods_STATUSGenerator() gopter.Gen { + if condition_FailingPeriods_STATUSGenerator != nil { + return condition_FailingPeriods_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS(generators) + condition_FailingPeriods_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_FailingPeriods_STATUS{}), generators) + + return condition_FailingPeriods_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS(gens map[string]gopter.Gen) { + gens["MinFailingPeriodsToAlert"] = gen.PtrOf(gen.Int()) + gens["NumberOfEvaluationPeriods"] = gen.PtrOf(gen.Int()) +} + +func Test_Condition_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_STATUS, Condition_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_STATUS runs a test to see if a specific instance of Condition_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_STATUS(subject Condition_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_STATUS instances for property testing - lazily instantiated by Condition_STATUSGenerator() +var condition_STATUSGenerator gopter.Gen + +// Condition_STATUSGenerator returns a generator of Condition_STATUS instances for property testing. +// We first initialize condition_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Condition_STATUSGenerator() gopter.Gen { + if condition_STATUSGenerator != nil { + return condition_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_STATUS(generators) + condition_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_STATUS(generators) + AddRelatedPropertyGeneratorsForCondition_STATUS(generators) + condition_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_STATUS{}), generators) + + return condition_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_STATUS(gens map[string]gopter.Gen) { + gens["AlertSensitivity"] = gen.PtrOf(gen.AlphaString()) + gens["CriterionType"] = gen.PtrOf(gen.OneConstOf(Condition_CriterionType_STATUS_DynamicThresholdCriterion, Condition_CriterionType_STATUS_StaticThresholdCriterion)) + gens["IgnoreDataBefore"] = gen.PtrOf(gen.AlphaString()) + gens["MetricMeasureColumn"] = gen.PtrOf(gen.AlphaString()) + gens["MetricName"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf( + Condition_Operator_STATUS_Equals, + Condition_Operator_STATUS_GreaterOrLessThan, + Condition_Operator_STATUS_GreaterThan, + Condition_Operator_STATUS_GreaterThanOrEqual, + Condition_Operator_STATUS_LessThan, + Condition_Operator_STATUS_LessThanOrEqual)) + gens["Query"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceIdColumn"] = gen.PtrOf(gen.AlphaString()) + gens["Threshold"] = gen.PtrOf(gen.Float64()) + gens["TimeAggregation"] = gen.PtrOf(gen.OneConstOf( + Condition_TimeAggregation_STATUS_Average, + Condition_TimeAggregation_STATUS_Count, + Condition_TimeAggregation_STATUS_Maximum, + Condition_TimeAggregation_STATUS_Minimum, + Condition_TimeAggregation_STATUS_Total)) +} + +// AddRelatedPropertyGeneratorsForCondition_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCondition_STATUS(gens map[string]gopter.Gen) { + gens["Dimensions"] = gen.SliceOf(Dimension_STATUSGenerator()) + gens["FailingPeriods"] = gen.PtrOf(Condition_FailingPeriods_STATUSGenerator()) +} + +func Test_Dimension_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Dimension_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDimension_STATUS, Dimension_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDimension_STATUS runs a test to see if a specific instance of Dimension_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForDimension_STATUS(subject Dimension_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Dimension_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Dimension_STATUS instances for property testing - lazily instantiated by Dimension_STATUSGenerator() +var dimension_STATUSGenerator gopter.Gen + +// Dimension_STATUSGenerator returns a generator of Dimension_STATUS instances for property testing. +func Dimension_STATUSGenerator() gopter.Gen { + if dimension_STATUSGenerator != nil { + return dimension_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDimension_STATUS(generators) + dimension_STATUSGenerator = gen.Struct(reflect.TypeOf(Dimension_STATUS{}), generators) + + return dimension_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForDimension_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDimension_STATUS(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf(Dimension_Operator_STATUS_Exclude, Dimension_Operator_STATUS_Include)) + gens["Values"] = gen.SliceOf(gen.AlphaString()) +} + +func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() +var identity_STATUSGenerator gopter.Gen + +// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. +// We first initialize identity_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_STATUSGenerator() gopter.Gen { + if identity_STATUSGenerator != nil { + return identity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + return identity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.OneConstOf(Identity_Type_STATUS_None, Identity_Type_STATUS_SystemAssigned, Identity_Type_STATUS_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf( + gen.AlphaString(), + UserIdentityProperties_STATUSGenerator()) +} + +func Test_RuleResolveConfiguration_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RuleResolveConfiguration_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleResolveConfiguration_STATUS, RuleResolveConfiguration_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleResolveConfiguration_STATUS runs a test to see if a specific instance of RuleResolveConfiguration_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleResolveConfiguration_STATUS(subject RuleResolveConfiguration_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RuleResolveConfiguration_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RuleResolveConfiguration_STATUS instances for property testing - lazily instantiated by +// RuleResolveConfiguration_STATUSGenerator() +var ruleResolveConfiguration_STATUSGenerator gopter.Gen + +// RuleResolveConfiguration_STATUSGenerator returns a generator of RuleResolveConfiguration_STATUS instances for property testing. +func RuleResolveConfiguration_STATUSGenerator() gopter.Gen { + if ruleResolveConfiguration_STATUSGenerator != nil { + return ruleResolveConfiguration_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS(generators) + ruleResolveConfiguration_STATUSGenerator = gen.Struct(reflect.TypeOf(RuleResolveConfiguration_STATUS{}), generators) + + return ruleResolveConfiguration_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS(gens map[string]gopter.Gen) { + gens["AutoResolved"] = gen.PtrOf(gen.Bool()) + gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScheduledQueryRuleCriteria_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleCriteria_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS, ScheduledQueryRuleCriteria_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS runs a test to see if a specific instance of ScheduledQueryRuleCriteria_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS(subject ScheduledQueryRuleCriteria_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleCriteria_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleCriteria_STATUS instances for property testing - lazily instantiated by +// ScheduledQueryRuleCriteria_STATUSGenerator() +var scheduledQueryRuleCriteria_STATUSGenerator gopter.Gen + +// ScheduledQueryRuleCriteria_STATUSGenerator returns a generator of ScheduledQueryRuleCriteria_STATUS instances for property testing. +func ScheduledQueryRuleCriteria_STATUSGenerator() gopter.Gen { + if scheduledQueryRuleCriteria_STATUSGenerator != nil { + return scheduledQueryRuleCriteria_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS(generators) + scheduledQueryRuleCriteria_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleCriteria_STATUS{}), generators) + + return scheduledQueryRuleCriteria_STATUSGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS(gens map[string]gopter.Gen) { + gens["AllOf"] = gen.SliceOf(Condition_STATUSGenerator()) +} + +func Test_ScheduledQueryRuleProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleProperties_STATUS, ScheduledQueryRuleProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleProperties_STATUS runs a test to see if a specific instance of ScheduledQueryRuleProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleProperties_STATUS(subject ScheduledQueryRuleProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleProperties_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleProperties_STATUS instances for property testing - lazily instantiated by +// ScheduledQueryRuleProperties_STATUSGenerator() +var scheduledQueryRuleProperties_STATUSGenerator gopter.Gen + +// ScheduledQueryRuleProperties_STATUSGenerator returns a generator of ScheduledQueryRuleProperties_STATUS instances for property testing. +// We first initialize scheduledQueryRuleProperties_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRuleProperties_STATUSGenerator() gopter.Gen { + if scheduledQueryRuleProperties_STATUSGenerator != nil { + return scheduledQueryRuleProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties_STATUS(generators) + scheduledQueryRuleProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRuleProperties_STATUS(generators) + scheduledQueryRuleProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleProperties_STATUS{}), generators) + + return scheduledQueryRuleProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRuleProperties_STATUS(gens map[string]gopter.Gen) { + gens["AutoMitigate"] = gen.PtrOf(gen.Bool()) + gens["CheckWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["CreatedWithApiVersion"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["EvaluationFrequency"] = gen.PtrOf(gen.AlphaString()) + gens["IsLegacyLogAnalyticsRule"] = gen.PtrOf(gen.Bool()) + gens["IsWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["MuteActionsDuration"] = gen.PtrOf(gen.AlphaString()) + gens["OverrideQueryTimeRange"] = gen.PtrOf(gen.AlphaString()) + gens["Scopes"] = gen.SliceOf(gen.AlphaString()) + gens["Severity"] = gen.PtrOf(gen.OneConstOf( + ScheduledQueryRuleProperties_Severity_STATUS_0, + ScheduledQueryRuleProperties_Severity_STATUS_1, + ScheduledQueryRuleProperties_Severity_STATUS_2, + ScheduledQueryRuleProperties_Severity_STATUS_3, + ScheduledQueryRuleProperties_Severity_STATUS_4)) + gens["SkipQueryValidation"] = gen.PtrOf(gen.Bool()) + gens["TargetResourceTypes"] = gen.SliceOf(gen.AlphaString()) + gens["WindowSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleProperties_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleProperties_STATUS(gens map[string]gopter.Gen) { + gens["Actions"] = gen.PtrOf(Actions_STATUSGenerator()) + gens["Criteria"] = gen.PtrOf(ScheduledQueryRuleCriteria_STATUSGenerator()) + gens["ResolveConfiguration"] = gen.PtrOf(RuleResolveConfiguration_STATUSGenerator()) +} + +func Test_ScheduledQueryRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule_STATUS, ScheduledQueryRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule_STATUS runs a test to see if a specific instance of ScheduledQueryRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule_STATUS(subject ScheduledQueryRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule_STATUS instances for property testing - lazily instantiated by +// ScheduledQueryRule_STATUSGenerator() +var scheduledQueryRule_STATUSGenerator gopter.Gen + +// ScheduledQueryRule_STATUSGenerator returns a generator of ScheduledQueryRule_STATUS instances for property testing. +// We first initialize scheduledQueryRule_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRule_STATUSGenerator() gopter.Gen { + if scheduledQueryRule_STATUSGenerator != nil { + return scheduledQueryRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + scheduledQueryRule_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + scheduledQueryRule_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_STATUS{}), generators) + + return scheduledQueryRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(gens map[string]gopter.Gen) { + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Kind"] = gen.PtrOf(gen.OneConstOf(ScheduledQueryRule_Kind_STATUS_EventLogAlert, ScheduledQueryRule_Kind_STATUS_LogAlert, ScheduledQueryRule_Kind_STATUS_LogToMetric)) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["Properties"] = gen.PtrOf(ScheduledQueryRuleProperties_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() +var systemData_STATUSGenerator gopter.Gen + +// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. +func SystemData_STATUSGenerator() gopter.Gen { + if systemData_STATUSGenerator != nil { + return systemData_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) + systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) + + return systemData_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_CreatedByType_STATUS_Application, + SystemData_CreatedByType_STATUS_Key, + SystemData_CreatedByType_STATUS_ManagedIdentity, + SystemData_CreatedByType_STATUS_User)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_LastModifiedByType_STATUS_Application, + SystemData_LastModifiedByType_STATUS_Key, + SystemData_LastModifiedByType_STATUS_ManagedIdentity, + SystemData_LastModifiedByType_STATUS_User)) +} + +func Test_UserIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserIdentityProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserIdentityProperties_STATUS, UserIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserIdentityProperties_STATUS runs a test to see if a specific instance of UserIdentityProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForUserIdentityProperties_STATUS(subject UserIdentityProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserIdentityProperties_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserIdentityProperties_STATUS instances for property testing - lazily instantiated by +// UserIdentityProperties_STATUSGenerator() +var userIdentityProperties_STATUSGenerator gopter.Gen + +// UserIdentityProperties_STATUSGenerator returns a generator of UserIdentityProperties_STATUS instances for property testing. +func UserIdentityProperties_STATUSGenerator() gopter.Gen { + if userIdentityProperties_STATUSGenerator != nil { + return userIdentityProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS(generators) + userIdentityProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(UserIdentityProperties_STATUS{}), generators) + + return userIdentityProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/insights/v1api20240101preview/arm/structure.txt b/v2/api/insights/v1api20240101preview/arm/structure.txt new file mode 100644 index 00000000000..8615fe1aa0e --- /dev/null +++ b/v2/api/insights/v1api20240101preview/arm/structure.txt @@ -0,0 +1,176 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview/arm +-------------------------------------------------------------------------------- +ScheduledQueryRule_STATUS: Object (10 properties) +├── Etag: *string +├── Id: *string +├── Identity: *Object (4 properties) +│ ├── PrincipalId: *string +│ ├── TenantId: *string +│ ├── Type: *Enum (3 values) +│ │ ├── "None" +│ │ ├── "SystemAssigned" +│ │ └── "UserAssigned" +│ └── UserAssignedIdentities: map[string]Object (2 properties) +│ ├── ClientId: *string +│ └── PrincipalId: *string +├── Kind: *Enum (3 values) +│ ├── "EventLogAlert" +│ ├── "LogAlert" +│ └── "LogToMetric" +├── Location: *string +├── Name: *string +├── Properties: *Object (19 properties) +│ ├── Actions: *Object (3 properties) +│ │ ├── ActionGroups: string[] +│ │ ├── ActionProperties: map[string]string +│ │ └── CustomProperties: map[string]string +│ ├── AutoMitigate: *bool +│ ├── CheckWorkspaceAlertsStorageConfigured: *bool +│ ├── CreatedWithApiVersion: *string +│ ├── Criteria: *Object (1 property) +│ │ └── AllOf: Object (12 properties)[] +│ │ ├── AlertSensitivity: *string +│ │ ├── CriterionType: *Enum (2 values) +│ │ │ ├── "DynamicThresholdCriterion" +│ │ │ └── "StaticThresholdCriterion" +│ │ ├── Dimensions: Object (3 properties)[] +│ │ │ ├── Name: *string +│ │ │ ├── Operator: *Enum (2 values) +│ │ │ │ ├── "Exclude" +│ │ │ │ └── "Include" +│ │ │ └── Values: string[] +│ │ ├── FailingPeriods: *Object (2 properties) +│ │ │ ├── MinFailingPeriodsToAlert: *int +│ │ │ └── NumberOfEvaluationPeriods: *int +│ │ ├── IgnoreDataBefore: *string +│ │ ├── MetricMeasureColumn: *string +│ │ ├── MetricName: *string +│ │ ├── Operator: *Enum (6 values) +│ │ │ ├── "Equals" +│ │ │ ├── "GreaterOrLessThan" +│ │ │ ├── "GreaterThan" +│ │ │ ├── "GreaterThanOrEqual" +│ │ │ ├── "LessThan" +│ │ │ └── "LessThanOrEqual" +│ │ ├── Query: *string +│ │ ├── ResourceIdColumn: *string +│ │ ├── Threshold: *float64 +│ │ └── TimeAggregation: *Enum (5 values) +│ │ ├── "Average" +│ │ ├── "Count" +│ │ ├── "Maximum" +│ │ ├── "Minimum" +│ │ └── "Total" +│ ├── Description: *string +│ ├── DisplayName: *string +│ ├── Enabled: *bool +│ ├── EvaluationFrequency: *string +│ ├── IsLegacyLogAnalyticsRule: *bool +│ ├── IsWorkspaceAlertsStorageConfigured: *bool +│ ├── MuteActionsDuration: *string +│ ├── OverrideQueryTimeRange: *string +│ ├── ResolveConfiguration: *Object (2 properties) +│ │ ├── AutoResolved: *bool +│ │ └── TimeToResolve: *string +│ ├── Scopes: string[] +│ ├── Severity: *Enum (5 values) +│ │ ├── 0 +│ │ ├── 1 +│ │ ├── 2 +│ │ ├── 3 +│ │ └── 4 +│ ├── SkipQueryValidation: *bool +│ ├── TargetResourceTypes: string[] +│ └── WindowSize: *string +├── SystemData: *Object (6 properties) +│ ├── CreatedAt: *string +│ ├── CreatedBy: *string +│ ├── CreatedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ ├── LastModifiedAt: *string +│ ├── LastModifiedBy: *string +│ └── LastModifiedByType: *Enum (4 values) +│ ├── "Application" +│ ├── "Key" +│ ├── "ManagedIdentity" +│ └── "User" +├── Tags: map[string]string +└── Type: *string +ScheduledQueryRule_Spec: Object (6 properties) +├── Identity: *Object (2 properties) +│ ├── Type: *Enum (3 values) +│ │ ├── "None" +│ │ ├── "SystemAssigned" +│ │ └── "UserAssigned" +│ └── UserAssignedIdentities: map[string]Object (0 properties) +├── Kind: *Enum (3 values) +│ ├── "EventLogAlert" +│ ├── "LogAlert" +│ └── "LogToMetric" +├── Location: *string +├── Name: string +├── Properties: *Object (16 properties) +│ ├── Actions: *Object (3 properties) +│ │ ├── ActionGroups: string[] +│ │ ├── ActionProperties: map[string]string +│ │ └── CustomProperties: map[string]string +│ ├── AutoMitigate: *bool +│ ├── CheckWorkspaceAlertsStorageConfigured: *bool +│ ├── Criteria: *Object (1 property) +│ │ └── AllOf: Object (12 properties)[] +│ │ ├── AlertSensitivity: *string +│ │ ├── CriterionType: *Enum (2 values) +│ │ │ ├── "DynamicThresholdCriterion" +│ │ │ └── "StaticThresholdCriterion" +│ │ ├── Dimensions: Object (3 properties)[] +│ │ │ ├── Name: *string +│ │ │ ├── Operator: *Enum (2 values) +│ │ │ │ ├── "Exclude" +│ │ │ │ └── "Include" +│ │ │ └── Values: string[] +│ │ ├── FailingPeriods: *Object (2 properties) +│ │ │ ├── MinFailingPeriodsToAlert: *int +│ │ │ └── NumberOfEvaluationPeriods: *int +│ │ ├── IgnoreDataBefore: *string +│ │ ├── MetricMeasureColumn: *string +│ │ ├── MetricName: *string +│ │ ├── Operator: *Enum (6 values) +│ │ │ ├── "Equals" +│ │ │ ├── "GreaterOrLessThan" +│ │ │ ├── "GreaterThan" +│ │ │ ├── "GreaterThanOrEqual" +│ │ │ ├── "LessThan" +│ │ │ └── "LessThanOrEqual" +│ │ ├── Query: *string +│ │ ├── ResourceIdColumn: *string +│ │ ├── Threshold: *float64 +│ │ └── TimeAggregation: *Enum (5 values) +│ │ ├── "Average" +│ │ ├── "Count" +│ │ ├── "Maximum" +│ │ ├── "Minimum" +│ │ └── "Total" +│ ├── Description: *string +│ ├── DisplayName: *string +│ ├── Enabled: *bool +│ ├── EvaluationFrequency: *string +│ ├── MuteActionsDuration: *string +│ ├── OverrideQueryTimeRange: *string +│ ├── ResolveConfiguration: *Object (2 properties) +│ │ ├── AutoResolved: *bool +│ │ └── TimeToResolve: *string +│ ├── Scopes: string[] +│ ├── Severity: *Enum (5 values) +│ │ ├── 0 +│ │ ├── 1 +│ │ ├── 2 +│ │ ├── 3 +│ │ └── 4 +│ ├── SkipQueryValidation: *bool +│ ├── TargetResourceTypes: string[] +│ └── WindowSize: *string +└── Tags: map[string]string diff --git a/v2/api/insights/v1api20240101preview/doc.go b/v2/api/insights/v1api20240101preview/doc.go new file mode 100644 index 00000000000..304fd1452d8 --- /dev/null +++ b/v2/api/insights/v1api20240101preview/doc.go @@ -0,0 +1,10 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20240101preview contains API Schema definitions for the insights v1api20240101preview API group +// +groupName=insights.azure.com +package v1api20240101preview diff --git a/v2/api/insights/v1api20240101preview/groupversion_info_gen.go b/v2/api/insights/v1api20240101preview/groupversion_info_gen.go new file mode 100644 index 00000000000..9d1c4f23e40 --- /dev/null +++ b/v2/api/insights/v1api20240101preview/groupversion_info_gen.go @@ -0,0 +1,32 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20240101preview contains API Schema definitions for the insights v1api20240101preview API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=insights.azure.com +// +versionName=v1api20240101preview +package v1api20240101preview + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "insights.azure.com", Version: "v1api20240101preview"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder +) diff --git a/v2/api/insights/v1api20240101preview/scheduled_query_rule_types_gen.go b/v2/api/insights/v1api20240101preview/scheduled_query_rule_types_gen.go new file mode 100644 index 00000000000..e1923f7805b --- /dev/null +++ b/v2/api/insights/v1api20240101preview/scheduled_query_rule_types_gen.go @@ -0,0 +1,4770 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101preview + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview/arm" + storage "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /monitor/resource-manager/Microsoft.Insights/preview/2024-01-01-preview/scheduledQueryRule_API.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName} +type ScheduledQueryRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ScheduledQueryRule_Spec `json:"spec,omitempty"` + Status ScheduledQueryRule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &ScheduledQueryRule{} + +// GetConditions returns the conditions of the resource +func (rule *ScheduledQueryRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *ScheduledQueryRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ conversion.Convertible = &ScheduledQueryRule{} + +// ConvertFrom populates our ScheduledQueryRule from the provided hub ScheduledQueryRule +func (rule *ScheduledQueryRule) ConvertFrom(hub conversion.Hub) error { + // intermediate variable for conversion + var source storage.ScheduledQueryRule + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = rule.AssignProperties_From_ScheduledQueryRule(&source) + if err != nil { + return eris.Wrap(err, "converting from source to rule") + } + + return nil +} + +// ConvertTo populates the provided hub ScheduledQueryRule from our ScheduledQueryRule +func (rule *ScheduledQueryRule) ConvertTo(hub conversion.Hub) error { + // intermediate variable for conversion + var destination storage.ScheduledQueryRule + err := rule.AssignProperties_To_ScheduledQueryRule(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") + } + + return nil +} + +// +kubebuilder:webhook:path=/mutate-insights-azure-com-v1api20240101preview-scheduledqueryrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=insights.azure.com,resources=scheduledqueryrules,verbs=create;update,versions=v1api20240101preview,name=default.v1api20240101preview.scheduledqueryrules.insights.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &ScheduledQueryRule{} + +// Default applies defaults to the ScheduledQueryRule resource +func (rule *ScheduledQueryRule) Default() { + rule.defaultImpl() + var temp any = rule + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (rule *ScheduledQueryRule) defaultAzureName() { + if rule.Spec.AzureName == "" { + rule.Spec.AzureName = rule.Name + } +} + +// defaultImpl applies the code generated defaults to the ScheduledQueryRule resource +func (rule *ScheduledQueryRule) defaultImpl() { rule.defaultAzureName() } + +var _ configmaps.Exporter = &ScheduledQueryRule{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (rule *ScheduledQueryRule) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &ScheduledQueryRule{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (rule *ScheduledQueryRule) SecretDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.SecretExpressions +} + +var _ genruntime.KubernetesResource = &ScheduledQueryRule{} + +// AzureName returns the Azure name of the resource +func (rule *ScheduledQueryRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01-preview" +func (rule ScheduledQueryRule) GetAPIVersion() string { + return "2024-01-01-preview" +} + +// GetResourceScope returns the scope of the resource +func (rule *ScheduledQueryRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *ScheduledQueryRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *ScheduledQueryRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *ScheduledQueryRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.Insights/scheduledQueryRules" +func (rule *ScheduledQueryRule) GetType() string { + return "Microsoft.Insights/scheduledQueryRules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *ScheduledQueryRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &ScheduledQueryRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *ScheduledQueryRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *ScheduledQueryRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*ScheduledQueryRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st ScheduledQueryRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-insights-azure-com-v1api20240101preview-scheduledqueryrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=insights.azure.com,resources=scheduledqueryrules,verbs=create;update,versions=v1api20240101preview,name=validate.v1api20240101preview.scheduledqueryrules.insights.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &ScheduledQueryRule{} + +// ValidateCreate validates the creation of the resource +func (rule *ScheduledQueryRule) ValidateCreate() (admission.Warnings, error) { + validations := rule.createValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (rule *ScheduledQueryRule) ValidateDelete() (admission.Warnings, error) { + validations := rule.deleteValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (rule *ScheduledQueryRule) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := rule.updateValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + return genruntime.ValidateUpdate(old, validations) +} + +// createValidations validates the creation of the resource +func (rule *ScheduledQueryRule) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference, rule.validateSecretDestinations, rule.validateConfigMapDestinations} +} + +// deleteValidations validates the deletion of the resource +func (rule *ScheduledQueryRule) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (rule *ScheduledQueryRule) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateResourceReferences() + }, + rule.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateSecretDestinations() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateConfigMapDestinations() + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (rule *ScheduledQueryRule) validateConfigMapDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(rule, nil, rule.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (rule *ScheduledQueryRule) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(rule) +} + +// validateResourceReferences validates all resource references +func (rule *ScheduledQueryRule) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (rule *ScheduledQueryRule) validateSecretDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + return secrets.ValidateDestinations(rule, nil, rule.Spec.OperatorSpec.SecretExpressions) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (rule *ScheduledQueryRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*ScheduledQueryRule) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, rule) +} + +// AssignProperties_From_ScheduledQueryRule populates our ScheduledQueryRule from the provided source ScheduledQueryRule +func (rule *ScheduledQueryRule) AssignProperties_From_ScheduledQueryRule(source *storage.ScheduledQueryRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec ScheduledQueryRule_Spec + err := spec.AssignProperties_From_ScheduledQueryRule_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status ScheduledQueryRule_STATUS + err = status.AssignProperties_From_ScheduledQueryRule_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRule_STATUS() to populate field Status") + } + rule.Status = status + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRule populates the provided destination ScheduledQueryRule from our ScheduledQueryRule +func (rule *ScheduledQueryRule) AssignProperties_To_ScheduledQueryRule(destination *storage.ScheduledQueryRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec storage.ScheduledQueryRule_Spec + err := rule.Spec.AssignProperties_To_ScheduledQueryRule_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.ScheduledQueryRule_STATUS + err = rule.Status.AssignProperties_To_ScheduledQueryRule_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRule_STATUS() to populate field Status") + } + destination.Status = status + + // No error + return nil +} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *ScheduledQueryRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion(), + Kind: "ScheduledQueryRule", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /monitor/resource-manager/Microsoft.Insights/preview/2024-01-01-preview/scheduledQueryRule_API.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName} +type ScheduledQueryRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ScheduledQueryRule `json:"items"` +} + +// +kubebuilder:validation:Enum={"2024-01-01-preview"} +type APIVersion string + +const APIVersion_Value = APIVersion("2024-01-01-preview") + +type ScheduledQueryRule_Spec struct { + // Actions: Actions to invoke when the alert fires. + Actions *Actions `json:"actions,omitempty"` + + // AutoMitigate: The flag that indicates whether the alert should be automatically resolved or not. The default is true. + // Relevant only for rules of the kind LogAlert. + AutoMitigate *bool `json:"autoMitigate,omitempty"` + + // +kubebuilder:validation:Pattern="^[^#<>%&:\\?/{}*]{1,260}$" + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + + // CheckWorkspaceAlertsStorageConfigured: The flag which indicates whether this scheduled query rule should be stored in + // the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. + CheckWorkspaceAlertsStorageConfigured *bool `json:"checkWorkspaceAlertsStorageConfigured,omitempty"` + + // Criteria: The rule criteria that defines the conditions of the scheduled query rule. + Criteria *ScheduledQueryRuleCriteria `json:"criteria,omitempty"` + + // Description: The description of the scheduled query rule. + Description *string `json:"description,omitempty"` + + // DisplayName: The display name of the alert rule + DisplayName *string `json:"displayName,omitempty"` + + // Enabled: The flag which indicates whether this scheduled query rule is enabled. Value should be true or false + Enabled *bool `json:"enabled,omitempty"` + + // EvaluationFrequency: How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant + // and required only for rules of the kind LogAlert. + EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` + + // Identity: The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + + // Kind: Indicates the type of scheduled query rule. The default is LogAlert. + Kind *ScheduledQueryRule_Kind_Spec `json:"kind,omitempty"` + + // +kubebuilder:validation:Required + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // MuteActionsDuration: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. + // Relevant only for rules of the kind LogAlert. + MuteActionsDuration *string `json:"muteActionsDuration,omitempty"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *ScheduledQueryRuleOperatorSpec `json:"operatorSpec,omitempty"` + + // OverrideQueryTimeRange: If specified then overrides the query time range (default is + // WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + OverrideQueryTimeRange *string `json:"overrideQueryTimeRange,omitempty"` + + // +kubebuilder:validation:Required + // Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also + // controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a + // reference to a resources.azure.com/ResourceGroup resource + Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"` + + // ResolveConfiguration: Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. + ResolveConfiguration *RuleResolveConfiguration `json:"resolveConfiguration,omitempty"` + + // ScopesReferences: The list of resource id's that this scheduled query rule is scoped to. + ScopesReferences []genruntime.ResourceReference `armReference:"Scopes" json:"scopesReferences,omitempty"` + + // Severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only + // for rules of the kind LogAlert. + Severity *ScheduledQueryRuleProperties_Severity `json:"severity,omitempty"` + + // SkipQueryValidation: The flag which indicates whether the provided query should be validated or not. The default is + // false. Relevant only for rules of the kind LogAlert. + SkipQueryValidation *bool `json:"skipQueryValidation,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` + + // TargetResourceTypes: List of resource type of the target resource(s) on which the alert is created/updated. For example + // if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert + // will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of + // the kind LogAlert + TargetResourceTypes []string `json:"targetResourceTypes,omitempty"` + + // WindowSize: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). + // Relevant and required only for rules of the kind LogAlert. + WindowSize *string `json:"windowSize,omitempty"` +} + +var _ genruntime.ARMTransformer = &ScheduledQueryRule_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (rule *ScheduledQueryRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if rule == nil { + return nil, nil + } + result := &arm.ScheduledQueryRule_Spec{} + + // Set property "Identity": + if rule.Identity != nil { + identity_ARM, err := (*rule.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identity_ARM.(*arm.Identity) + result.Identity = &identity + } + + // Set property "Kind": + if rule.Kind != nil { + var temp string + temp = string(*rule.Kind) + kind := arm.ScheduledQueryRule_Kind_Spec(temp) + result.Kind = &kind + } + + // Set property "Location": + if rule.Location != nil { + location := *rule.Location + result.Location = &location + } + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if rule.Actions != nil || + rule.AutoMitigate != nil || + rule.CheckWorkspaceAlertsStorageConfigured != nil || + rule.Criteria != nil || + rule.Description != nil || + rule.DisplayName != nil || + rule.Enabled != nil || + rule.EvaluationFrequency != nil || + rule.MuteActionsDuration != nil || + rule.OverrideQueryTimeRange != nil || + rule.ResolveConfiguration != nil || + rule.ScopesReferences != nil || + rule.Severity != nil || + rule.SkipQueryValidation != nil || + rule.TargetResourceTypes != nil || + rule.WindowSize != nil { + result.Properties = &arm.ScheduledQueryRuleProperties{} + } + if rule.Actions != nil { + actions_ARM, err := (*rule.Actions).ConvertToARM(resolved) + if err != nil { + return nil, err + } + actions := *actions_ARM.(*arm.Actions) + result.Properties.Actions = &actions + } + if rule.AutoMitigate != nil { + autoMitigate := *rule.AutoMitigate + result.Properties.AutoMitigate = &autoMitigate + } + if rule.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *rule.CheckWorkspaceAlertsStorageConfigured + result.Properties.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } + if rule.Criteria != nil { + criteria_ARM, err := (*rule.Criteria).ConvertToARM(resolved) + if err != nil { + return nil, err + } + criteria := *criteria_ARM.(*arm.ScheduledQueryRuleCriteria) + result.Properties.Criteria = &criteria + } + if rule.Description != nil { + description := *rule.Description + result.Properties.Description = &description + } + if rule.DisplayName != nil { + displayName := *rule.DisplayName + result.Properties.DisplayName = &displayName + } + if rule.Enabled != nil { + enabled := *rule.Enabled + result.Properties.Enabled = &enabled + } + if rule.EvaluationFrequency != nil { + evaluationFrequency := *rule.EvaluationFrequency + result.Properties.EvaluationFrequency = &evaluationFrequency + } + if rule.MuteActionsDuration != nil { + muteActionsDuration := *rule.MuteActionsDuration + result.Properties.MuteActionsDuration = &muteActionsDuration + } + if rule.OverrideQueryTimeRange != nil { + overrideQueryTimeRange := *rule.OverrideQueryTimeRange + result.Properties.OverrideQueryTimeRange = &overrideQueryTimeRange + } + if rule.ResolveConfiguration != nil { + resolveConfiguration_ARM, err := (*rule.ResolveConfiguration).ConvertToARM(resolved) + if err != nil { + return nil, err + } + resolveConfiguration := *resolveConfiguration_ARM.(*arm.RuleResolveConfiguration) + result.Properties.ResolveConfiguration = &resolveConfiguration + } + for _, item := range rule.ScopesReferences { + itemARMID, err := resolved.ResolvedReferences.Lookup(item) + if err != nil { + return nil, err + } + result.Properties.Scopes = append(result.Properties.Scopes, itemARMID) + } + if rule.Severity != nil { + var temp int + temp = int(*rule.Severity) + severity := arm.ScheduledQueryRuleProperties_Severity(temp) + result.Properties.Severity = &severity + } + if rule.SkipQueryValidation != nil { + skipQueryValidation := *rule.SkipQueryValidation + result.Properties.SkipQueryValidation = &skipQueryValidation + } + for _, item := range rule.TargetResourceTypes { + result.Properties.TargetResourceTypes = append(result.Properties.TargetResourceTypes, item) + } + if rule.WindowSize != nil { + windowSize := *rule.WindowSize + result.Properties.WindowSize = &windowSize + } + + // Set property "Tags": + if rule.Tags != nil { + result.Tags = make(map[string]string, len(rule.Tags)) + for key, value := range rule.Tags { + result.Tags[key] = value + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *ScheduledQueryRule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.ScheduledQueryRule_Spec{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *ScheduledQueryRule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.ScheduledQueryRule_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.ScheduledQueryRule_Spec, got %T", armInput) + } + + // Set property "Actions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Actions != nil { + var actions1 Actions + err := actions1.PopulateFromARM(owner, *typedInput.Properties.Actions) + if err != nil { + return err + } + actions := actions1 + rule.Actions = &actions + } + } + + // Set property "AutoMitigate": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoMitigate != nil { + autoMitigate := *typedInput.Properties.AutoMitigate + rule.AutoMitigate = &autoMitigate + } + } + + // Set property "AzureName": + rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "CheckWorkspaceAlertsStorageConfigured": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *typedInput.Properties.CheckWorkspaceAlertsStorageConfigured + rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } + } + + // Set property "Criteria": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Criteria != nil { + var criteria1 ScheduledQueryRuleCriteria + err := criteria1.PopulateFromARM(owner, *typedInput.Properties.Criteria) + if err != nil { + return err + } + criteria := criteria1 + rule.Criteria = &criteria + } + } + + // Set property "Description": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Description != nil { + description := *typedInput.Properties.Description + rule.Description = &description + } + } + + // Set property "DisplayName": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DisplayName != nil { + displayName := *typedInput.Properties.DisplayName + rule.DisplayName = &displayName + } + } + + // Set property "Enabled": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Enabled != nil { + enabled := *typedInput.Properties.Enabled + rule.Enabled = &enabled + } + } + + // Set property "EvaluationFrequency": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EvaluationFrequency != nil { + evaluationFrequency := *typedInput.Properties.EvaluationFrequency + rule.EvaluationFrequency = &evaluationFrequency + } + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 Identity + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + rule.Identity = &identity + } + + // Set property "Kind": + if typedInput.Kind != nil { + var temp string + temp = string(*typedInput.Kind) + kind := ScheduledQueryRule_Kind_Spec(temp) + rule.Kind = &kind + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + rule.Location = &location + } + + // Set property "MuteActionsDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MuteActionsDuration != nil { + muteActionsDuration := *typedInput.Properties.MuteActionsDuration + rule.MuteActionsDuration = &muteActionsDuration + } + } + + // no assignment for property "OperatorSpec" + + // Set property "OverrideQueryTimeRange": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.OverrideQueryTimeRange != nil { + overrideQueryTimeRange := *typedInput.Properties.OverrideQueryTimeRange + rule.OverrideQueryTimeRange = &overrideQueryTimeRange + } + } + + // Set property "Owner": + rule.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "ResolveConfiguration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ResolveConfiguration != nil { + var resolveConfiguration1 RuleResolveConfiguration + err := resolveConfiguration1.PopulateFromARM(owner, *typedInput.Properties.ResolveConfiguration) + if err != nil { + return err + } + resolveConfiguration := resolveConfiguration1 + rule.ResolveConfiguration = &resolveConfiguration + } + } + + // no assignment for property "ScopesReferences" + + // Set property "Severity": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Severity != nil { + var temp int + temp = int(*typedInput.Properties.Severity) + severity := ScheduledQueryRuleProperties_Severity(temp) + rule.Severity = &severity + } + } + + // Set property "SkipQueryValidation": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SkipQueryValidation != nil { + skipQueryValidation := *typedInput.Properties.SkipQueryValidation + rule.SkipQueryValidation = &skipQueryValidation + } + } + + // Set property "Tags": + if typedInput.Tags != nil { + rule.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + rule.Tags[key] = value + } + } + + // Set property "TargetResourceTypes": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.TargetResourceTypes { + rule.TargetResourceTypes = append(rule.TargetResourceTypes, item) + } + } + + // Set property "WindowSize": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.WindowSize != nil { + windowSize := *typedInput.Properties.WindowSize + rule.WindowSize = &windowSize + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &ScheduledQueryRule_Spec{} + +// ConvertSpecFrom populates our ScheduledQueryRule_Spec from the provided source +func (rule *ScheduledQueryRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*storage.ScheduledQueryRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_ScheduledQueryRule_Spec(src) + } + + // Convert to an intermediate form + src = &storage.ScheduledQueryRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_ScheduledQueryRule_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our ScheduledQueryRule_Spec +func (rule *ScheduledQueryRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*storage.ScheduledQueryRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_ScheduledQueryRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.ScheduledQueryRule_Spec{} + err := rule.AssignProperties_To_ScheduledQueryRule_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_ScheduledQueryRule_Spec populates our ScheduledQueryRule_Spec from the provided source ScheduledQueryRule_Spec +func (rule *ScheduledQueryRule_Spec) AssignProperties_From_ScheduledQueryRule_Spec(source *storage.ScheduledQueryRule_Spec) error { + + // Actions + if source.Actions != nil { + var action Actions + err := action.AssignProperties_From_Actions(source.Actions) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Actions() to populate field Actions") + } + rule.Actions = &action + } else { + rule.Actions = nil + } + + // AutoMitigate + if source.AutoMitigate != nil { + autoMitigate := *source.AutoMitigate + rule.AutoMitigate = &autoMitigate + } else { + rule.AutoMitigate = nil + } + + // AzureName + rule.AzureName = source.AzureName + + // CheckWorkspaceAlertsStorageConfigured + if source.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *source.CheckWorkspaceAlertsStorageConfigured + rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + rule.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Criteria + if source.Criteria != nil { + var criterion ScheduledQueryRuleCriteria + err := criterion.AssignProperties_From_ScheduledQueryRuleCriteria(source.Criteria) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleCriteria() to populate field Criteria") + } + rule.Criteria = &criterion + } else { + rule.Criteria = nil + } + + // Description + rule.Description = genruntime.ClonePointerToString(source.Description) + + // DisplayName + rule.DisplayName = genruntime.ClonePointerToString(source.DisplayName) + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + rule.Enabled = &enabled + } else { + rule.Enabled = nil + } + + // EvaluationFrequency + rule.EvaluationFrequency = genruntime.ClonePointerToString(source.EvaluationFrequency) + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.AssignProperties_From_Identity(source.Identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Identity() to populate field Identity") + } + rule.Identity = &identity + } else { + rule.Identity = nil + } + + // Kind + if source.Kind != nil { + kind := *source.Kind + kindTemp := genruntime.ToEnum(kind, scheduledQueryRule_Kind_Spec_Values) + rule.Kind = &kindTemp + } else { + rule.Kind = nil + } + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // MuteActionsDuration + rule.MuteActionsDuration = genruntime.ClonePointerToString(source.MuteActionsDuration) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec ScheduledQueryRuleOperatorSpec + err := operatorSpec.AssignProperties_From_ScheduledQueryRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + + // OverrideQueryTimeRange + rule.OverrideQueryTimeRange = genruntime.ClonePointerToString(source.OverrideQueryTimeRange) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // ResolveConfiguration + if source.ResolveConfiguration != nil { + var resolveConfiguration RuleResolveConfiguration + err := resolveConfiguration.AssignProperties_From_RuleResolveConfiguration(source.ResolveConfiguration) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_RuleResolveConfiguration() to populate field ResolveConfiguration") + } + rule.ResolveConfiguration = &resolveConfiguration + } else { + rule.ResolveConfiguration = nil + } + + // ScopesReferences + if source.ScopesReferences != nil { + scopesReferenceList := make([]genruntime.ResourceReference, len(source.ScopesReferences)) + for scopesReferenceIndex, scopesReferenceItem := range source.ScopesReferences { + // Shadow the loop variable to avoid aliasing + scopesReferenceItem := scopesReferenceItem + scopesReferenceList[scopesReferenceIndex] = scopesReferenceItem.Copy() + } + rule.ScopesReferences = scopesReferenceList + } else { + rule.ScopesReferences = nil + } + + // Severity + if source.Severity != nil { + severity := ScheduledQueryRuleProperties_Severity(*source.Severity) + rule.Severity = &severity + } else { + rule.Severity = nil + } + + // SkipQueryValidation + if source.SkipQueryValidation != nil { + skipQueryValidation := *source.SkipQueryValidation + rule.SkipQueryValidation = &skipQueryValidation + } else { + rule.SkipQueryValidation = nil + } + + // Tags + rule.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // TargetResourceTypes + rule.TargetResourceTypes = genruntime.CloneSliceOfString(source.TargetResourceTypes) + + // WindowSize + rule.WindowSize = genruntime.ClonePointerToString(source.WindowSize) + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRule_Spec populates the provided destination ScheduledQueryRule_Spec from our ScheduledQueryRule_Spec +func (rule *ScheduledQueryRule_Spec) AssignProperties_To_ScheduledQueryRule_Spec(destination *storage.ScheduledQueryRule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Actions + if rule.Actions != nil { + var action storage.Actions + err := rule.Actions.AssignProperties_To_Actions(&action) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Actions() to populate field Actions") + } + destination.Actions = &action + } else { + destination.Actions = nil + } + + // AutoMitigate + if rule.AutoMitigate != nil { + autoMitigate := *rule.AutoMitigate + destination.AutoMitigate = &autoMitigate + } else { + destination.AutoMitigate = nil + } + + // AzureName + destination.AzureName = rule.AzureName + + // CheckWorkspaceAlertsStorageConfigured + if rule.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *rule.CheckWorkspaceAlertsStorageConfigured + destination.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + destination.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Criteria + if rule.Criteria != nil { + var criterion storage.ScheduledQueryRuleCriteria + err := rule.Criteria.AssignProperties_To_ScheduledQueryRuleCriteria(&criterion) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleCriteria() to populate field Criteria") + } + destination.Criteria = &criterion + } else { + destination.Criteria = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(rule.Description) + + // DisplayName + destination.DisplayName = genruntime.ClonePointerToString(rule.DisplayName) + + // Enabled + if rule.Enabled != nil { + enabled := *rule.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // EvaluationFrequency + destination.EvaluationFrequency = genruntime.ClonePointerToString(rule.EvaluationFrequency) + + // Identity + if rule.Identity != nil { + var identity storage.Identity + err := rule.Identity.AssignProperties_To_Identity(&identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Identity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Kind + if rule.Kind != nil { + kind := string(*rule.Kind) + destination.Kind = &kind + } else { + destination.Kind = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // MuteActionsDuration + destination.MuteActionsDuration = genruntime.ClonePointerToString(rule.MuteActionsDuration) + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec storage.ScheduledQueryRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_ScheduledQueryRuleOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion() + + // OverrideQueryTimeRange + destination.OverrideQueryTimeRange = genruntime.ClonePointerToString(rule.OverrideQueryTimeRange) + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // ResolveConfiguration + if rule.ResolveConfiguration != nil { + var resolveConfiguration storage.RuleResolveConfiguration + err := rule.ResolveConfiguration.AssignProperties_To_RuleResolveConfiguration(&resolveConfiguration) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_RuleResolveConfiguration() to populate field ResolveConfiguration") + } + destination.ResolveConfiguration = &resolveConfiguration + } else { + destination.ResolveConfiguration = nil + } + + // ScopesReferences + if rule.ScopesReferences != nil { + scopesReferenceList := make([]genruntime.ResourceReference, len(rule.ScopesReferences)) + for scopesReferenceIndex, scopesReferenceItem := range rule.ScopesReferences { + // Shadow the loop variable to avoid aliasing + scopesReferenceItem := scopesReferenceItem + scopesReferenceList[scopesReferenceIndex] = scopesReferenceItem.Copy() + } + destination.ScopesReferences = scopesReferenceList + } else { + destination.ScopesReferences = nil + } + + // Severity + if rule.Severity != nil { + severity := int(*rule.Severity) + destination.Severity = &severity + } else { + destination.Severity = nil + } + + // SkipQueryValidation + if rule.SkipQueryValidation != nil { + skipQueryValidation := *rule.SkipQueryValidation + destination.SkipQueryValidation = &skipQueryValidation + } else { + destination.SkipQueryValidation = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(rule.Tags) + + // TargetResourceTypes + destination.TargetResourceTypes = genruntime.CloneSliceOfString(rule.TargetResourceTypes) + + // WindowSize + destination.WindowSize = genruntime.ClonePointerToString(rule.WindowSize) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (rule *ScheduledQueryRule_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (rule *ScheduledQueryRule_Spec) SetAzureName(azureName string) { rule.AzureName = azureName } + +type ScheduledQueryRule_STATUS struct { + // Actions: Actions to invoke when the alert fires. + Actions *Actions_STATUS `json:"actions,omitempty"` + + // AutoMitigate: The flag that indicates whether the alert should be automatically resolved or not. The default is true. + // Relevant only for rules of the kind LogAlert. + AutoMitigate *bool `json:"autoMitigate,omitempty"` + + // CheckWorkspaceAlertsStorageConfigured: The flag which indicates whether this scheduled query rule should be stored in + // the customer's storage. The default is false. Relevant only for rules of the kind LogAlert. + CheckWorkspaceAlertsStorageConfigured *bool `json:"checkWorkspaceAlertsStorageConfigured,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CreatedWithApiVersion: The api-version used when creating this alert rule + CreatedWithApiVersion *string `json:"createdWithApiVersion,omitempty"` + + // Criteria: The rule criteria that defines the conditions of the scheduled query rule. + Criteria *ScheduledQueryRuleCriteria_STATUS `json:"criteria,omitempty"` + + // Description: The description of the scheduled query rule. + Description *string `json:"description,omitempty"` + + // DisplayName: The display name of the alert rule + DisplayName *string `json:"displayName,omitempty"` + + // Enabled: The flag which indicates whether this scheduled query rule is enabled. Value should be true or false + Enabled *bool `json:"enabled,omitempty"` + + // Etag: The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per + // the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + // HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and + // If-Range (section 14.27) header fields. + Etag *string `json:"etag,omitempty"` + + // EvaluationFrequency: How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant + // and required only for rules of the kind LogAlert. + EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` + + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Identity: The identity of the resource. + Identity *Identity_STATUS `json:"identity,omitempty"` + + // IsLegacyLogAnalyticsRule: True if alert rule is legacy Log Analytic rule + IsLegacyLogAnalyticsRule *bool `json:"isLegacyLogAnalyticsRule,omitempty"` + + // IsWorkspaceAlertsStorageConfigured: The flag which indicates whether this scheduled query rule has been configured to be + // stored in the customer's storage. The default is false. + IsWorkspaceAlertsStorageConfigured *bool `json:"isWorkspaceAlertsStorageConfigured,omitempty"` + + // Kind: Indicates the type of scheduled query rule. The default is LogAlert. + Kind *ScheduledQueryRule_Kind_STATUS `json:"kind,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // MuteActionsDuration: Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. + // Relevant only for rules of the kind LogAlert. + MuteActionsDuration *string `json:"muteActionsDuration,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // OverrideQueryTimeRange: If specified then overrides the query time range (default is + // WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert. + OverrideQueryTimeRange *string `json:"overrideQueryTimeRange,omitempty"` + + // ResolveConfiguration: Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. + ResolveConfiguration *RuleResolveConfiguration_STATUS `json:"resolveConfiguration,omitempty"` + + // Scopes: The list of resource id's that this scheduled query rule is scoped to. + Scopes []string `json:"scopes,omitempty"` + + // Severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only + // for rules of the kind LogAlert. + Severity *ScheduledQueryRuleProperties_Severity_STATUS `json:"severity,omitempty"` + + // SkipQueryValidation: The flag which indicates whether the provided query should be validated or not. The default is + // false. Relevant only for rules of the kind LogAlert. + SkipQueryValidation *bool `json:"skipQueryValidation,omitempty"` + + // SystemData: SystemData of ScheduledQueryRule. + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` + + // TargetResourceTypes: List of resource type of the target resource(s) on which the alert is created/updated. For example + // if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert + // will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of + // the kind LogAlert + TargetResourceTypes []string `json:"targetResourceTypes,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + + // WindowSize: The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). + // Relevant and required only for rules of the kind LogAlert. + WindowSize *string `json:"windowSize,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &ScheduledQueryRule_STATUS{} + +// ConvertStatusFrom populates our ScheduledQueryRule_STATUS from the provided source +func (rule *ScheduledQueryRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*storage.ScheduledQueryRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_ScheduledQueryRule_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.ScheduledQueryRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_ScheduledQueryRule_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our ScheduledQueryRule_STATUS +func (rule *ScheduledQueryRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*storage.ScheduledQueryRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_ScheduledQueryRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.ScheduledQueryRule_STATUS{} + err := rule.AssignProperties_To_ScheduledQueryRule_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &ScheduledQueryRule_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *ScheduledQueryRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.ScheduledQueryRule_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *ScheduledQueryRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.ScheduledQueryRule_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.ScheduledQueryRule_STATUS, got %T", armInput) + } + + // Set property "Actions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Actions != nil { + var actions1 Actions_STATUS + err := actions1.PopulateFromARM(owner, *typedInput.Properties.Actions) + if err != nil { + return err + } + actions := actions1 + rule.Actions = &actions + } + } + + // Set property "AutoMitigate": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoMitigate != nil { + autoMitigate := *typedInput.Properties.AutoMitigate + rule.AutoMitigate = &autoMitigate + } + } + + // Set property "CheckWorkspaceAlertsStorageConfigured": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *typedInput.Properties.CheckWorkspaceAlertsStorageConfigured + rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } + } + + // no assignment for property "Conditions" + + // Set property "CreatedWithApiVersion": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedWithApiVersion != nil { + createdWithApiVersion := *typedInput.Properties.CreatedWithApiVersion + rule.CreatedWithApiVersion = &createdWithApiVersion + } + } + + // Set property "Criteria": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Criteria != nil { + var criteria1 ScheduledQueryRuleCriteria_STATUS + err := criteria1.PopulateFromARM(owner, *typedInput.Properties.Criteria) + if err != nil { + return err + } + criteria := criteria1 + rule.Criteria = &criteria + } + } + + // Set property "Description": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Description != nil { + description := *typedInput.Properties.Description + rule.Description = &description + } + } + + // Set property "DisplayName": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DisplayName != nil { + displayName := *typedInput.Properties.DisplayName + rule.DisplayName = &displayName + } + } + + // Set property "Enabled": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Enabled != nil { + enabled := *typedInput.Properties.Enabled + rule.Enabled = &enabled + } + } + + // Set property "Etag": + if typedInput.Etag != nil { + etag := *typedInput.Etag + rule.Etag = &etag + } + + // Set property "EvaluationFrequency": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EvaluationFrequency != nil { + evaluationFrequency := *typedInput.Properties.EvaluationFrequency + rule.EvaluationFrequency = &evaluationFrequency + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + rule.Id = &id + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 Identity_STATUS + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + rule.Identity = &identity + } + + // Set property "IsLegacyLogAnalyticsRule": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsLegacyLogAnalyticsRule != nil { + isLegacyLogAnalyticsRule := *typedInput.Properties.IsLegacyLogAnalyticsRule + rule.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule + } + } + + // Set property "IsWorkspaceAlertsStorageConfigured": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsWorkspaceAlertsStorageConfigured != nil { + isWorkspaceAlertsStorageConfigured := *typedInput.Properties.IsWorkspaceAlertsStorageConfigured + rule.IsWorkspaceAlertsStorageConfigured = &isWorkspaceAlertsStorageConfigured + } + } + + // Set property "Kind": + if typedInput.Kind != nil { + var temp string + temp = string(*typedInput.Kind) + kind := ScheduledQueryRule_Kind_STATUS(temp) + rule.Kind = &kind + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + rule.Location = &location + } + + // Set property "MuteActionsDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MuteActionsDuration != nil { + muteActionsDuration := *typedInput.Properties.MuteActionsDuration + rule.MuteActionsDuration = &muteActionsDuration + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + rule.Name = &name + } + + // Set property "OverrideQueryTimeRange": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.OverrideQueryTimeRange != nil { + overrideQueryTimeRange := *typedInput.Properties.OverrideQueryTimeRange + rule.OverrideQueryTimeRange = &overrideQueryTimeRange + } + } + + // Set property "ResolveConfiguration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ResolveConfiguration != nil { + var resolveConfiguration1 RuleResolveConfiguration_STATUS + err := resolveConfiguration1.PopulateFromARM(owner, *typedInput.Properties.ResolveConfiguration) + if err != nil { + return err + } + resolveConfiguration := resolveConfiguration1 + rule.ResolveConfiguration = &resolveConfiguration + } + } + + // Set property "Scopes": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.Scopes { + rule.Scopes = append(rule.Scopes, item) + } + } + + // Set property "Severity": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Severity != nil { + var temp int + temp = int(*typedInput.Properties.Severity) + severity := ScheduledQueryRuleProperties_Severity_STATUS(temp) + rule.Severity = &severity + } + } + + // Set property "SkipQueryValidation": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SkipQueryValidation != nil { + skipQueryValidation := *typedInput.Properties.SkipQueryValidation + rule.SkipQueryValidation = &skipQueryValidation + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + rule.SystemData = &systemData + } + + // Set property "Tags": + if typedInput.Tags != nil { + rule.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + rule.Tags[key] = value + } + } + + // Set property "TargetResourceTypes": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.TargetResourceTypes { + rule.TargetResourceTypes = append(rule.TargetResourceTypes, item) + } + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + rule.Type = &typeVar + } + + // Set property "WindowSize": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.WindowSize != nil { + windowSize := *typedInput.Properties.WindowSize + rule.WindowSize = &windowSize + } + } + + // No error + return nil +} + +// AssignProperties_From_ScheduledQueryRule_STATUS populates our ScheduledQueryRule_STATUS from the provided source ScheduledQueryRule_STATUS +func (rule *ScheduledQueryRule_STATUS) AssignProperties_From_ScheduledQueryRule_STATUS(source *storage.ScheduledQueryRule_STATUS) error { + + // Actions + if source.Actions != nil { + var action Actions_STATUS + err := action.AssignProperties_From_Actions_STATUS(source.Actions) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Actions_STATUS() to populate field Actions") + } + rule.Actions = &action + } else { + rule.Actions = nil + } + + // AutoMitigate + if source.AutoMitigate != nil { + autoMitigate := *source.AutoMitigate + rule.AutoMitigate = &autoMitigate + } else { + rule.AutoMitigate = nil + } + + // CheckWorkspaceAlertsStorageConfigured + if source.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *source.CheckWorkspaceAlertsStorageConfigured + rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + rule.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedWithApiVersion + rule.CreatedWithApiVersion = genruntime.ClonePointerToString(source.CreatedWithApiVersion) + + // Criteria + if source.Criteria != nil { + var criterion ScheduledQueryRuleCriteria_STATUS + err := criterion.AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(source.Criteria) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleCriteria_STATUS() to populate field Criteria") + } + rule.Criteria = &criterion + } else { + rule.Criteria = nil + } + + // Description + rule.Description = genruntime.ClonePointerToString(source.Description) + + // DisplayName + rule.DisplayName = genruntime.ClonePointerToString(source.DisplayName) + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + rule.Enabled = &enabled + } else { + rule.Enabled = nil + } + + // Etag + rule.Etag = genruntime.ClonePointerToString(source.Etag) + + // EvaluationFrequency + rule.EvaluationFrequency = genruntime.ClonePointerToString(source.EvaluationFrequency) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Identity + if source.Identity != nil { + var identity Identity_STATUS + err := identity.AssignProperties_From_Identity_STATUS(source.Identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Identity_STATUS() to populate field Identity") + } + rule.Identity = &identity + } else { + rule.Identity = nil + } + + // IsLegacyLogAnalyticsRule + if source.IsLegacyLogAnalyticsRule != nil { + isLegacyLogAnalyticsRule := *source.IsLegacyLogAnalyticsRule + rule.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule + } else { + rule.IsLegacyLogAnalyticsRule = nil + } + + // IsWorkspaceAlertsStorageConfigured + if source.IsWorkspaceAlertsStorageConfigured != nil { + isWorkspaceAlertsStorageConfigured := *source.IsWorkspaceAlertsStorageConfigured + rule.IsWorkspaceAlertsStorageConfigured = &isWorkspaceAlertsStorageConfigured + } else { + rule.IsWorkspaceAlertsStorageConfigured = nil + } + + // Kind + if source.Kind != nil { + kind := *source.Kind + kindTemp := genruntime.ToEnum(kind, scheduledQueryRule_Kind_STATUS_Values) + rule.Kind = &kindTemp + } else { + rule.Kind = nil + } + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // MuteActionsDuration + rule.MuteActionsDuration = genruntime.ClonePointerToString(source.MuteActionsDuration) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // OverrideQueryTimeRange + rule.OverrideQueryTimeRange = genruntime.ClonePointerToString(source.OverrideQueryTimeRange) + + // ResolveConfiguration + if source.ResolveConfiguration != nil { + var resolveConfiguration RuleResolveConfiguration_STATUS + err := resolveConfiguration.AssignProperties_From_RuleResolveConfiguration_STATUS(source.ResolveConfiguration) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_RuleResolveConfiguration_STATUS() to populate field ResolveConfiguration") + } + rule.ResolveConfiguration = &resolveConfiguration + } else { + rule.ResolveConfiguration = nil + } + + // Scopes + rule.Scopes = genruntime.CloneSliceOfString(source.Scopes) + + // Severity + if source.Severity != nil { + severity := ScheduledQueryRuleProperties_Severity_STATUS(*source.Severity) + rule.Severity = &severity + } else { + rule.Severity = nil + } + + // SkipQueryValidation + if source.SkipQueryValidation != nil { + skipQueryValidation := *source.SkipQueryValidation + rule.SkipQueryValidation = &skipQueryValidation + } else { + rule.SkipQueryValidation = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + rule.SystemData = &systemDatum + } else { + rule.SystemData = nil + } + + // Tags + rule.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // TargetResourceTypes + rule.TargetResourceTypes = genruntime.CloneSliceOfString(source.TargetResourceTypes) + + // Type + rule.Type = genruntime.ClonePointerToString(source.Type) + + // WindowSize + rule.WindowSize = genruntime.ClonePointerToString(source.WindowSize) + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRule_STATUS populates the provided destination ScheduledQueryRule_STATUS from our ScheduledQueryRule_STATUS +func (rule *ScheduledQueryRule_STATUS) AssignProperties_To_ScheduledQueryRule_STATUS(destination *storage.ScheduledQueryRule_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Actions + if rule.Actions != nil { + var action storage.Actions_STATUS + err := rule.Actions.AssignProperties_To_Actions_STATUS(&action) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Actions_STATUS() to populate field Actions") + } + destination.Actions = &action + } else { + destination.Actions = nil + } + + // AutoMitigate + if rule.AutoMitigate != nil { + autoMitigate := *rule.AutoMitigate + destination.AutoMitigate = &autoMitigate + } else { + destination.AutoMitigate = nil + } + + // CheckWorkspaceAlertsStorageConfigured + if rule.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *rule.CheckWorkspaceAlertsStorageConfigured + destination.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + destination.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // CreatedWithApiVersion + destination.CreatedWithApiVersion = genruntime.ClonePointerToString(rule.CreatedWithApiVersion) + + // Criteria + if rule.Criteria != nil { + var criterion storage.ScheduledQueryRuleCriteria_STATUS + err := rule.Criteria.AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(&criterion) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleCriteria_STATUS() to populate field Criteria") + } + destination.Criteria = &criterion + } else { + destination.Criteria = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(rule.Description) + + // DisplayName + destination.DisplayName = genruntime.ClonePointerToString(rule.DisplayName) + + // Enabled + if rule.Enabled != nil { + enabled := *rule.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Etag + destination.Etag = genruntime.ClonePointerToString(rule.Etag) + + // EvaluationFrequency + destination.EvaluationFrequency = genruntime.ClonePointerToString(rule.EvaluationFrequency) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Identity + if rule.Identity != nil { + var identity storage.Identity_STATUS + err := rule.Identity.AssignProperties_To_Identity_STATUS(&identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Identity_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // IsLegacyLogAnalyticsRule + if rule.IsLegacyLogAnalyticsRule != nil { + isLegacyLogAnalyticsRule := *rule.IsLegacyLogAnalyticsRule + destination.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule + } else { + destination.IsLegacyLogAnalyticsRule = nil + } + + // IsWorkspaceAlertsStorageConfigured + if rule.IsWorkspaceAlertsStorageConfigured != nil { + isWorkspaceAlertsStorageConfigured := *rule.IsWorkspaceAlertsStorageConfigured + destination.IsWorkspaceAlertsStorageConfigured = &isWorkspaceAlertsStorageConfigured + } else { + destination.IsWorkspaceAlertsStorageConfigured = nil + } + + // Kind + if rule.Kind != nil { + kind := string(*rule.Kind) + destination.Kind = &kind + } else { + destination.Kind = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // MuteActionsDuration + destination.MuteActionsDuration = genruntime.ClonePointerToString(rule.MuteActionsDuration) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // OverrideQueryTimeRange + destination.OverrideQueryTimeRange = genruntime.ClonePointerToString(rule.OverrideQueryTimeRange) + + // ResolveConfiguration + if rule.ResolveConfiguration != nil { + var resolveConfiguration storage.RuleResolveConfiguration_STATUS + err := rule.ResolveConfiguration.AssignProperties_To_RuleResolveConfiguration_STATUS(&resolveConfiguration) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_RuleResolveConfiguration_STATUS() to populate field ResolveConfiguration") + } + destination.ResolveConfiguration = &resolveConfiguration + } else { + destination.ResolveConfiguration = nil + } + + // Scopes + destination.Scopes = genruntime.CloneSliceOfString(rule.Scopes) + + // Severity + if rule.Severity != nil { + severity := int(*rule.Severity) + destination.Severity = &severity + } else { + destination.Severity = nil + } + + // SkipQueryValidation + if rule.SkipQueryValidation != nil { + skipQueryValidation := *rule.SkipQueryValidation + destination.SkipQueryValidation = &skipQueryValidation + } else { + destination.SkipQueryValidation = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDatum storage.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(rule.Tags) + + // TargetResourceTypes + destination.TargetResourceTypes = genruntime.CloneSliceOfString(rule.TargetResourceTypes) + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // WindowSize + destination.WindowSize = genruntime.ClonePointerToString(rule.WindowSize) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Actions to invoke when the alert fires. +type Actions struct { + // ActionGroupsReferences: Action Group resource Ids to invoke when the alert fires. + ActionGroupsReferences []genruntime.ResourceReference `armReference:"ActionGroups" json:"actionGroupsReferences,omitempty"` + + // ActionProperties: The properties of an action properties. + ActionProperties map[string]string `json:"actionProperties,omitempty"` + + // CustomProperties: The properties of an alert payload. + CustomProperties map[string]string `json:"customProperties,omitempty"` +} + +var _ genruntime.ARMTransformer = &Actions{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (actions *Actions) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if actions == nil { + return nil, nil + } + result := &arm.Actions{} + + // Set property "ActionGroups": + for _, item := range actions.ActionGroupsReferences { + itemARMID, err := resolved.ResolvedReferences.Lookup(item) + if err != nil { + return nil, err + } + result.ActionGroups = append(result.ActionGroups, itemARMID) + } + + // Set property "ActionProperties": + if actions.ActionProperties != nil { + result.ActionProperties = make(map[string]string, len(actions.ActionProperties)) + for key, value := range actions.ActionProperties { + result.ActionProperties[key] = value + } + } + + // Set property "CustomProperties": + if actions.CustomProperties != nil { + result.CustomProperties = make(map[string]string, len(actions.CustomProperties)) + for key, value := range actions.CustomProperties { + result.CustomProperties[key] = value + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (actions *Actions) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Actions{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (actions *Actions) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Actions) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Actions, got %T", armInput) + } + + // no assignment for property "ActionGroupsReferences" + + // Set property "ActionProperties": + if typedInput.ActionProperties != nil { + actions.ActionProperties = make(map[string]string, len(typedInput.ActionProperties)) + for key, value := range typedInput.ActionProperties { + actions.ActionProperties[key] = value + } + } + + // Set property "CustomProperties": + if typedInput.CustomProperties != nil { + actions.CustomProperties = make(map[string]string, len(typedInput.CustomProperties)) + for key, value := range typedInput.CustomProperties { + actions.CustomProperties[key] = value + } + } + + // No error + return nil +} + +// AssignProperties_From_Actions populates our Actions from the provided source Actions +func (actions *Actions) AssignProperties_From_Actions(source *storage.Actions) error { + + // ActionGroupsReferences + if source.ActionGroupsReferences != nil { + actionGroupsReferenceList := make([]genruntime.ResourceReference, len(source.ActionGroupsReferences)) + for actionGroupsReferenceIndex, actionGroupsReferenceItem := range source.ActionGroupsReferences { + // Shadow the loop variable to avoid aliasing + actionGroupsReferenceItem := actionGroupsReferenceItem + actionGroupsReferenceList[actionGroupsReferenceIndex] = actionGroupsReferenceItem.Copy() + } + actions.ActionGroupsReferences = actionGroupsReferenceList + } else { + actions.ActionGroupsReferences = nil + } + + // ActionProperties + actions.ActionProperties = genruntime.CloneMapOfStringToString(source.ActionProperties) + + // CustomProperties + actions.CustomProperties = genruntime.CloneMapOfStringToString(source.CustomProperties) + + // No error + return nil +} + +// AssignProperties_To_Actions populates the provided destination Actions from our Actions +func (actions *Actions) AssignProperties_To_Actions(destination *storage.Actions) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ActionGroupsReferences + if actions.ActionGroupsReferences != nil { + actionGroupsReferenceList := make([]genruntime.ResourceReference, len(actions.ActionGroupsReferences)) + for actionGroupsReferenceIndex, actionGroupsReferenceItem := range actions.ActionGroupsReferences { + // Shadow the loop variable to avoid aliasing + actionGroupsReferenceItem := actionGroupsReferenceItem + actionGroupsReferenceList[actionGroupsReferenceIndex] = actionGroupsReferenceItem.Copy() + } + destination.ActionGroupsReferences = actionGroupsReferenceList + } else { + destination.ActionGroupsReferences = nil + } + + // ActionProperties + destination.ActionProperties = genruntime.CloneMapOfStringToString(actions.ActionProperties) + + // CustomProperties + destination.CustomProperties = genruntime.CloneMapOfStringToString(actions.CustomProperties) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Actions to invoke when the alert fires. +type Actions_STATUS struct { + // ActionGroups: Action Group resource Ids to invoke when the alert fires. + ActionGroups []string `json:"actionGroups,omitempty"` + + // ActionProperties: The properties of an action properties. + ActionProperties map[string]string `json:"actionProperties,omitempty"` + + // CustomProperties: The properties of an alert payload. + CustomProperties map[string]string `json:"customProperties,omitempty"` +} + +var _ genruntime.FromARMConverter = &Actions_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (actions *Actions_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Actions_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (actions *Actions_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Actions_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Actions_STATUS, got %T", armInput) + } + + // Set property "ActionGroups": + for _, item := range typedInput.ActionGroups { + actions.ActionGroups = append(actions.ActionGroups, item) + } + + // Set property "ActionProperties": + if typedInput.ActionProperties != nil { + actions.ActionProperties = make(map[string]string, len(typedInput.ActionProperties)) + for key, value := range typedInput.ActionProperties { + actions.ActionProperties[key] = value + } + } + + // Set property "CustomProperties": + if typedInput.CustomProperties != nil { + actions.CustomProperties = make(map[string]string, len(typedInput.CustomProperties)) + for key, value := range typedInput.CustomProperties { + actions.CustomProperties[key] = value + } + } + + // No error + return nil +} + +// AssignProperties_From_Actions_STATUS populates our Actions_STATUS from the provided source Actions_STATUS +func (actions *Actions_STATUS) AssignProperties_From_Actions_STATUS(source *storage.Actions_STATUS) error { + + // ActionGroups + actions.ActionGroups = genruntime.CloneSliceOfString(source.ActionGroups) + + // ActionProperties + actions.ActionProperties = genruntime.CloneMapOfStringToString(source.ActionProperties) + + // CustomProperties + actions.CustomProperties = genruntime.CloneMapOfStringToString(source.CustomProperties) + + // No error + return nil +} + +// AssignProperties_To_Actions_STATUS populates the provided destination Actions_STATUS from our Actions_STATUS +func (actions *Actions_STATUS) AssignProperties_To_Actions_STATUS(destination *storage.Actions_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ActionGroups + destination.ActionGroups = genruntime.CloneSliceOfString(actions.ActionGroups) + + // ActionProperties + destination.ActionProperties = genruntime.CloneMapOfStringToString(actions.ActionProperties) + + // CustomProperties + destination.CustomProperties = genruntime.CloneMapOfStringToString(actions.CustomProperties) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Identity for the resource. +type Identity struct { + // +kubebuilder:validation:Required + // Type: Type of managed service identity. + Type *Identity_Type `json:"type,omitempty"` + + // UserAssignedIdentities: The list of user identities associated with the resource. The user identity dictionary key + // references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} + +var _ genruntime.ARMTransformer = &Identity{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (identity *Identity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if identity == nil { + return nil, nil + } + result := &arm.Identity{} + + // Set property "Type": + if identity.Type != nil { + var temp string + temp = string(*identity.Type) + typeVar := arm.Identity_Type(temp) + result.Type = &typeVar + } + + // Set property "UserAssignedIdentities": + result.UserAssignedIdentities = make(map[string]arm.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for _, ident := range identity.UserAssignedIdentities { + identARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference) + if err != nil { + return nil, err + } + key := identARMID + result.UserAssignedIdentities[key] = arm.UserAssignedIdentityDetails{} + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Identity{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *Identity) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Identity) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Identity, got %T", armInput) + } + + // Set property "Type": + if typedInput.Type != nil { + var temp string + temp = string(*typedInput.Type) + typeVar := Identity_Type(temp) + identity.Type = &typeVar + } + + // no assignment for property "UserAssignedIdentities" + + // No error + return nil +} + +// AssignProperties_From_Identity populates our Identity from the provided source Identity +func (identity *Identity) AssignProperties_From_Identity(source *storage.Identity) error { + + // Type + if source.Type != nil { + typeVar := *source.Type + typeTemp := genruntime.ToEnum(typeVar, identity_Type_Values) + identity.Type = &typeTemp + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity UserAssignedIdentityDetails + err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// AssignProperties_To_Identity populates the provided destination Identity from our Identity +func (identity *Identity) AssignProperties_To_Identity(destination *storage.Identity) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Type + if identity.Type != nil { + typeVar := string(*identity.Type) + destination.Type = &typeVar + } else { + destination.Type = nil + } + + // UserAssignedIdentities + if identity.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]storage.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity storage.UserAssignedIdentityDetails + err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityList + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Identity for the resource. +type Identity_STATUS struct { + // PrincipalId: The principal ID of resource identity. + PrincipalId *string `json:"principalId,omitempty"` + + // TenantId: The tenant ID of resource. + TenantId *string `json:"tenantId,omitempty"` + + // Type: Type of managed service identity. + Type *Identity_Type_STATUS `json:"type,omitempty"` + + // UserAssignedIdentities: The list of user identities associated with the resource. The user identity dictionary key + // references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]UserIdentityProperties_STATUS `json:"userAssignedIdentities,omitempty"` +} + +var _ genruntime.FromARMConverter = &Identity_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *Identity_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Identity_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *Identity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Identity_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Identity_STATUS, got %T", armInput) + } + + // Set property "PrincipalId": + if typedInput.PrincipalId != nil { + principalId := *typedInput.PrincipalId + identity.PrincipalId = &principalId + } + + // Set property "TenantId": + if typedInput.TenantId != nil { + tenantId := *typedInput.TenantId + identity.TenantId = &tenantId + } + + // Set property "Type": + if typedInput.Type != nil { + var temp string + temp = string(*typedInput.Type) + typeVar := Identity_Type_STATUS(temp) + identity.Type = &typeVar + } + + // Set property "UserAssignedIdentities": + if typedInput.UserAssignedIdentities != nil { + identity.UserAssignedIdentities = make(map[string]UserIdentityProperties_STATUS, len(typedInput.UserAssignedIdentities)) + for key, value := range typedInput.UserAssignedIdentities { + var value1 UserIdentityProperties_STATUS + err := value1.PopulateFromARM(owner, value) + if err != nil { + return err + } + identity.UserAssignedIdentities[key] = value1 + } + } + + // No error + return nil +} + +// AssignProperties_From_Identity_STATUS populates our Identity_STATUS from the provided source Identity_STATUS +func (identity *Identity_STATUS) AssignProperties_From_Identity_STATUS(source *storage.Identity_STATUS) error { + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // TenantId + identity.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // Type + if source.Type != nil { + typeVar := *source.Type + typeTemp := genruntime.ToEnum(typeVar, identity_Type_STATUS_Values) + identity.Type = &typeTemp + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityMap := make(map[string]UserIdentityProperties_STATUS, len(source.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity UserIdentityProperties_STATUS + err := userAssignedIdentity.AssignProperties_From_UserIdentityProperties_STATUS(&userAssignedIdentityValue) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_UserIdentityProperties_STATUS() to populate field UserAssignedIdentities") + } + userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityMap + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// AssignProperties_To_Identity_STATUS populates the provided destination Identity_STATUS from our Identity_STATUS +func (identity *Identity_STATUS) AssignProperties_To_Identity_STATUS(destination *storage.Identity_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrincipalId + destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId) + + // TenantId + destination.TenantId = genruntime.ClonePointerToString(identity.TenantId) + + // Type + if identity.Type != nil { + typeVar := string(*identity.Type) + destination.Type = &typeVar + } else { + destination.Type = nil + } + + // UserAssignedIdentities + if identity.UserAssignedIdentities != nil { + userAssignedIdentityMap := make(map[string]storage.UserIdentityProperties_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity storage.UserIdentityProperties_STATUS + err := userAssignedIdentityValue.AssignProperties_To_UserIdentityProperties_STATUS(&userAssignedIdentity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_UserIdentityProperties_STATUS() to populate field UserAssignedIdentities") + } + userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityMap + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// TBD. Relevant only for rules of the kind LogAlert. +type RuleResolveConfiguration struct { + // AutoResolved: The flag that indicates whether or not to auto resolve a fired alert. + AutoResolved *bool `json:"autoResolved,omitempty"` + + // TimeToResolve: The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented + // in ISO 8601 duration format. + TimeToResolve *string `json:"timeToResolve,omitempty"` +} + +var _ genruntime.ARMTransformer = &RuleResolveConfiguration{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (configuration *RuleResolveConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if configuration == nil { + return nil, nil + } + result := &arm.RuleResolveConfiguration{} + + // Set property "AutoResolved": + if configuration.AutoResolved != nil { + autoResolved := *configuration.AutoResolved + result.AutoResolved = &autoResolved + } + + // Set property "TimeToResolve": + if configuration.TimeToResolve != nil { + timeToResolve := *configuration.TimeToResolve + result.TimeToResolve = &timeToResolve + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (configuration *RuleResolveConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.RuleResolveConfiguration{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (configuration *RuleResolveConfiguration) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.RuleResolveConfiguration) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.RuleResolveConfiguration, got %T", armInput) + } + + // Set property "AutoResolved": + if typedInput.AutoResolved != nil { + autoResolved := *typedInput.AutoResolved + configuration.AutoResolved = &autoResolved + } + + // Set property "TimeToResolve": + if typedInput.TimeToResolve != nil { + timeToResolve := *typedInput.TimeToResolve + configuration.TimeToResolve = &timeToResolve + } + + // No error + return nil +} + +// AssignProperties_From_RuleResolveConfiguration populates our RuleResolveConfiguration from the provided source RuleResolveConfiguration +func (configuration *RuleResolveConfiguration) AssignProperties_From_RuleResolveConfiguration(source *storage.RuleResolveConfiguration) error { + + // AutoResolved + if source.AutoResolved != nil { + autoResolved := *source.AutoResolved + configuration.AutoResolved = &autoResolved + } else { + configuration.AutoResolved = nil + } + + // TimeToResolve + configuration.TimeToResolve = genruntime.ClonePointerToString(source.TimeToResolve) + + // No error + return nil +} + +// AssignProperties_To_RuleResolveConfiguration populates the provided destination RuleResolveConfiguration from our RuleResolveConfiguration +func (configuration *RuleResolveConfiguration) AssignProperties_To_RuleResolveConfiguration(destination *storage.RuleResolveConfiguration) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoResolved + if configuration.AutoResolved != nil { + autoResolved := *configuration.AutoResolved + destination.AutoResolved = &autoResolved + } else { + destination.AutoResolved = nil + } + + // TimeToResolve + destination.TimeToResolve = genruntime.ClonePointerToString(configuration.TimeToResolve) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// TBD. Relevant only for rules of the kind LogAlert. +type RuleResolveConfiguration_STATUS struct { + // AutoResolved: The flag that indicates whether or not to auto resolve a fired alert. + AutoResolved *bool `json:"autoResolved,omitempty"` + + // TimeToResolve: The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented + // in ISO 8601 duration format. + TimeToResolve *string `json:"timeToResolve,omitempty"` +} + +var _ genruntime.FromARMConverter = &RuleResolveConfiguration_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (configuration *RuleResolveConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.RuleResolveConfiguration_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (configuration *RuleResolveConfiguration_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.RuleResolveConfiguration_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.RuleResolveConfiguration_STATUS, got %T", armInput) + } + + // Set property "AutoResolved": + if typedInput.AutoResolved != nil { + autoResolved := *typedInput.AutoResolved + configuration.AutoResolved = &autoResolved + } + + // Set property "TimeToResolve": + if typedInput.TimeToResolve != nil { + timeToResolve := *typedInput.TimeToResolve + configuration.TimeToResolve = &timeToResolve + } + + // No error + return nil +} + +// AssignProperties_From_RuleResolveConfiguration_STATUS populates our RuleResolveConfiguration_STATUS from the provided source RuleResolveConfiguration_STATUS +func (configuration *RuleResolveConfiguration_STATUS) AssignProperties_From_RuleResolveConfiguration_STATUS(source *storage.RuleResolveConfiguration_STATUS) error { + + // AutoResolved + if source.AutoResolved != nil { + autoResolved := *source.AutoResolved + configuration.AutoResolved = &autoResolved + } else { + configuration.AutoResolved = nil + } + + // TimeToResolve + configuration.TimeToResolve = genruntime.ClonePointerToString(source.TimeToResolve) + + // No error + return nil +} + +// AssignProperties_To_RuleResolveConfiguration_STATUS populates the provided destination RuleResolveConfiguration_STATUS from our RuleResolveConfiguration_STATUS +func (configuration *RuleResolveConfiguration_STATUS) AssignProperties_To_RuleResolveConfiguration_STATUS(destination *storage.RuleResolveConfiguration_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoResolved + if configuration.AutoResolved != nil { + autoResolved := *configuration.AutoResolved + destination.AutoResolved = &autoResolved + } else { + destination.AutoResolved = nil + } + + // TimeToResolve + destination.TimeToResolve = genruntime.ClonePointerToString(configuration.TimeToResolve) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"EventLogAlert","LogAlert","LogToMetric"} +type ScheduledQueryRule_Kind_Spec string + +const ( + ScheduledQueryRule_Kind_Spec_EventLogAlert = ScheduledQueryRule_Kind_Spec("EventLogAlert") + ScheduledQueryRule_Kind_Spec_LogAlert = ScheduledQueryRule_Kind_Spec("LogAlert") + ScheduledQueryRule_Kind_Spec_LogToMetric = ScheduledQueryRule_Kind_Spec("LogToMetric") +) + +// Mapping from string to ScheduledQueryRule_Kind_Spec +var scheduledQueryRule_Kind_Spec_Values = map[string]ScheduledQueryRule_Kind_Spec{ + "eventlogalert": ScheduledQueryRule_Kind_Spec_EventLogAlert, + "logalert": ScheduledQueryRule_Kind_Spec_LogAlert, + "logtometric": ScheduledQueryRule_Kind_Spec_LogToMetric, +} + +type ScheduledQueryRule_Kind_STATUS string + +const ( + ScheduledQueryRule_Kind_STATUS_EventLogAlert = ScheduledQueryRule_Kind_STATUS("EventLogAlert") + ScheduledQueryRule_Kind_STATUS_LogAlert = ScheduledQueryRule_Kind_STATUS("LogAlert") + ScheduledQueryRule_Kind_STATUS_LogToMetric = ScheduledQueryRule_Kind_STATUS("LogToMetric") +) + +// Mapping from string to ScheduledQueryRule_Kind_STATUS +var scheduledQueryRule_Kind_STATUS_Values = map[string]ScheduledQueryRule_Kind_STATUS{ + "eventlogalert": ScheduledQueryRule_Kind_STATUS_EventLogAlert, + "logalert": ScheduledQueryRule_Kind_STATUS_LogAlert, + "logtometric": ScheduledQueryRule_Kind_STATUS_LogToMetric, +} + +// The rule criteria that defines the conditions of the scheduled query rule. +type ScheduledQueryRuleCriteria struct { + // AllOf: A list of conditions to evaluate against the specified scopes + AllOf []Condition `json:"allOf,omitempty"` +} + +var _ genruntime.ARMTransformer = &ScheduledQueryRuleCriteria{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (criteria *ScheduledQueryRuleCriteria) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if criteria == nil { + return nil, nil + } + result := &arm.ScheduledQueryRuleCriteria{} + + // Set property "AllOf": + for _, item := range criteria.AllOf { + item_ARM, err := item.ConvertToARM(resolved) + if err != nil { + return nil, err + } + result.AllOf = append(result.AllOf, *item_ARM.(*arm.Condition)) + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (criteria *ScheduledQueryRuleCriteria) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.ScheduledQueryRuleCriteria{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (criteria *ScheduledQueryRuleCriteria) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.ScheduledQueryRuleCriteria) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.ScheduledQueryRuleCriteria, got %T", armInput) + } + + // Set property "AllOf": + for _, item := range typedInput.AllOf { + var item1 Condition + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + criteria.AllOf = append(criteria.AllOf, item1) + } + + // No error + return nil +} + +// AssignProperties_From_ScheduledQueryRuleCriteria populates our ScheduledQueryRuleCriteria from the provided source ScheduledQueryRuleCriteria +func (criteria *ScheduledQueryRuleCriteria) AssignProperties_From_ScheduledQueryRuleCriteria(source *storage.ScheduledQueryRuleCriteria) error { + + // AllOf + if source.AllOf != nil { + allOfList := make([]Condition, len(source.AllOf)) + for allOfIndex, allOfItem := range source.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf Condition + err := allOf.AssignProperties_From_Condition(&allOfItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + criteria.AllOf = allOfList + } else { + criteria.AllOf = nil + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRuleCriteria populates the provided destination ScheduledQueryRuleCriteria from our ScheduledQueryRuleCriteria +func (criteria *ScheduledQueryRuleCriteria) AssignProperties_To_ScheduledQueryRuleCriteria(destination *storage.ScheduledQueryRuleCriteria) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AllOf + if criteria.AllOf != nil { + allOfList := make([]storage.Condition, len(criteria.AllOf)) + for allOfIndex, allOfItem := range criteria.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf storage.Condition + err := allOfItem.AssignProperties_To_Condition(&allOf) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + destination.AllOf = allOfList + } else { + destination.AllOf = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// The rule criteria that defines the conditions of the scheduled query rule. +type ScheduledQueryRuleCriteria_STATUS struct { + // AllOf: A list of conditions to evaluate against the specified scopes + AllOf []Condition_STATUS `json:"allOf,omitempty"` +} + +var _ genruntime.FromARMConverter = &ScheduledQueryRuleCriteria_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (criteria *ScheduledQueryRuleCriteria_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.ScheduledQueryRuleCriteria_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (criteria *ScheduledQueryRuleCriteria_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.ScheduledQueryRuleCriteria_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.ScheduledQueryRuleCriteria_STATUS, got %T", armInput) + } + + // Set property "AllOf": + for _, item := range typedInput.AllOf { + var item1 Condition_STATUS + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + criteria.AllOf = append(criteria.AllOf, item1) + } + + // No error + return nil +} + +// AssignProperties_From_ScheduledQueryRuleCriteria_STATUS populates our ScheduledQueryRuleCriteria_STATUS from the provided source ScheduledQueryRuleCriteria_STATUS +func (criteria *ScheduledQueryRuleCriteria_STATUS) AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(source *storage.ScheduledQueryRuleCriteria_STATUS) error { + + // AllOf + if source.AllOf != nil { + allOfList := make([]Condition_STATUS, len(source.AllOf)) + for allOfIndex, allOfItem := range source.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf Condition_STATUS + err := allOf.AssignProperties_From_Condition_STATUS(&allOfItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition_STATUS() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + criteria.AllOf = allOfList + } else { + criteria.AllOf = nil + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRuleCriteria_STATUS populates the provided destination ScheduledQueryRuleCriteria_STATUS from our ScheduledQueryRuleCriteria_STATUS +func (criteria *ScheduledQueryRuleCriteria_STATUS) AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(destination *storage.ScheduledQueryRuleCriteria_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AllOf + if criteria.AllOf != nil { + allOfList := make([]storage.Condition_STATUS, len(criteria.AllOf)) + for allOfIndex, allOfItem := range criteria.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf storage.Condition_STATUS + err := allOfItem.AssignProperties_To_Condition_STATUS(&allOf) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition_STATUS() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + destination.AllOf = allOfList + } else { + destination.AllOf = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type ScheduledQueryRuleOperatorSpec struct { + // ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions). + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + + // SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions). + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// AssignProperties_From_ScheduledQueryRuleOperatorSpec populates our ScheduledQueryRuleOperatorSpec from the provided source ScheduledQueryRuleOperatorSpec +func (operator *ScheduledQueryRuleOperatorSpec) AssignProperties_From_ScheduledQueryRuleOperatorSpec(source *storage.ScheduledQueryRuleOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRuleOperatorSpec populates the provided destination ScheduledQueryRuleOperatorSpec from our ScheduledQueryRuleOperatorSpec +func (operator *ScheduledQueryRuleOperatorSpec) AssignProperties_To_ScheduledQueryRuleOperatorSpec(destination *storage.ScheduledQueryRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={0,1,2,3,4} +type ScheduledQueryRuleProperties_Severity int + +const ( + ScheduledQueryRuleProperties_Severity_0 = ScheduledQueryRuleProperties_Severity(0) + ScheduledQueryRuleProperties_Severity_1 = ScheduledQueryRuleProperties_Severity(1) + ScheduledQueryRuleProperties_Severity_2 = ScheduledQueryRuleProperties_Severity(2) + ScheduledQueryRuleProperties_Severity_3 = ScheduledQueryRuleProperties_Severity(3) + ScheduledQueryRuleProperties_Severity_4 = ScheduledQueryRuleProperties_Severity(4) +) + +type ScheduledQueryRuleProperties_Severity_STATUS int + +const ( + ScheduledQueryRuleProperties_Severity_STATUS_0 = ScheduledQueryRuleProperties_Severity_STATUS(0) + ScheduledQueryRuleProperties_Severity_STATUS_1 = ScheduledQueryRuleProperties_Severity_STATUS(1) + ScheduledQueryRuleProperties_Severity_STATUS_2 = ScheduledQueryRuleProperties_Severity_STATUS(2) + ScheduledQueryRuleProperties_Severity_STATUS_3 = ScheduledQueryRuleProperties_Severity_STATUS(3) + ScheduledQueryRuleProperties_Severity_STATUS_4 = ScheduledQueryRuleProperties_Severity_STATUS(4) +) + +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + // CreatedAt: The timestamp of resource creation (UTC). + CreatedAt *string `json:"createdAt,omitempty"` + + // CreatedBy: The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // CreatedByType: The type of identity that created the resource. + CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"` + + // LastModifiedAt: The timestamp of resource last modification (UTC) + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + + // LastModifiedBy: The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // LastModifiedByType: The type of identity that last modified the resource. + LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"` +} + +var _ genruntime.FromARMConverter = &SystemData_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (data *SystemData_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.SystemData_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (data *SystemData_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.SystemData_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SystemData_STATUS, got %T", armInput) + } + + // Set property "CreatedAt": + if typedInput.CreatedAt != nil { + createdAt := *typedInput.CreatedAt + data.CreatedAt = &createdAt + } + + // Set property "CreatedBy": + if typedInput.CreatedBy != nil { + createdBy := *typedInput.CreatedBy + data.CreatedBy = &createdBy + } + + // Set property "CreatedByType": + if typedInput.CreatedByType != nil { + var temp string + temp = string(*typedInput.CreatedByType) + createdByType := SystemData_CreatedByType_STATUS(temp) + data.CreatedByType = &createdByType + } + + // Set property "LastModifiedAt": + if typedInput.LastModifiedAt != nil { + lastModifiedAt := *typedInput.LastModifiedAt + data.LastModifiedAt = &lastModifiedAt + } + + // Set property "LastModifiedBy": + if typedInput.LastModifiedBy != nil { + lastModifiedBy := *typedInput.LastModifiedBy + data.LastModifiedBy = &lastModifiedBy + } + + // Set property "LastModifiedByType": + if typedInput.LastModifiedByType != nil { + var temp string + temp = string(*typedInput.LastModifiedByType) + lastModifiedByType := SystemData_LastModifiedByType_STATUS(temp) + data.LastModifiedByType = &lastModifiedByType + } + + // No error + return nil +} + +// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *storage.SystemData_STATUS) error { + + // CreatedAt + data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + if source.CreatedByType != nil { + createdByType := *source.CreatedByType + createdByTypeTemp := genruntime.ToEnum(createdByType, systemData_CreatedByType_STATUS_Values) + data.CreatedByType = &createdByTypeTemp + } else { + data.CreatedByType = nil + } + + // LastModifiedAt + data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt) + + // LastModifiedBy + data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) + + // LastModifiedByType + if source.LastModifiedByType != nil { + lastModifiedByType := *source.LastModifiedByType + lastModifiedByTypeTemp := genruntime.ToEnum(lastModifiedByType, systemData_LastModifiedByType_STATUS_Values) + data.LastModifiedByType = &lastModifiedByTypeTemp + } else { + data.LastModifiedByType = nil + } + + // No error + return nil +} + +// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *storage.SystemData_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt) + + // CreatedBy + destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy) + + // CreatedByType + if data.CreatedByType != nil { + createdByType := string(*data.CreatedByType) + destination.CreatedByType = &createdByType + } else { + destination.CreatedByType = nil + } + + // LastModifiedAt + destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt) + + // LastModifiedBy + destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy) + + // LastModifiedByType + if data.LastModifiedByType != nil { + lastModifiedByType := string(*data.LastModifiedByType) + destination.LastModifiedByType = &lastModifiedByType + } else { + destination.LastModifiedByType = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// A condition of the scheduled query rule. +type Condition struct { + // AlertSensitivity: The extent of deviation required to trigger an alert. Allowed values are 'Low', 'Medium' and 'High'. + // This will affect how tight the threshold is to the metric series pattern. Relevant and required only for dynamic + // threshold rules of the kind LogAlert. + AlertSensitivity *string `json:"alertSensitivity,omitempty"` + + // CriterionType: Specifies the type of threshold criteria + CriterionType *Condition_CriterionType `json:"criterionType,omitempty"` + + // Dimensions: List of Dimensions conditions + Dimensions []Dimension `json:"dimensions,omitempty"` + + // FailingPeriods: The minimum number of violations required within the selected lookback time window required to raise an + // alert. Relevant only for rules of the kind LogAlert. + FailingPeriods *Condition_FailingPeriods `json:"failingPeriods,omitempty"` + + // IgnoreDataBefore: Use this option to set the date from which to start learning the metric historical data and calculate + // the dynamic thresholds (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert. + IgnoreDataBefore *string `json:"ignoreDataBefore,omitempty"` + + // MetricMeasureColumn: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. + MetricMeasureColumn *string `json:"metricMeasureColumn,omitempty"` + + // MetricName: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. + MetricName *string `json:"metricName,omitempty"` + + // Operator: The criteria operator. Relevant and required only for rules of the kind LogAlert. + Operator *Condition_Operator `json:"operator,omitempty"` + + // Query: Log query alert + Query *string `json:"query,omitempty"` + + // ResourceIdColumnReference: The column containing the resource id. The content of the column must be a uri formatted as + // resource id. Relevant only for rules of the kind LogAlert. + ResourceIdColumnReference *genruntime.ResourceReference `armReference:"ResourceIdColumn" json:"resourceIdColumnReference,omitempty"` + + // Threshold: the criteria threshold value that activates the alert. Relevant and required only for static threshold rules + // of the kind LogAlert. + Threshold *float64 `json:"threshold,omitempty"` + + // TimeAggregation: Aggregation type. Relevant and required only for rules of the kind LogAlert. + TimeAggregation *Condition_TimeAggregation `json:"timeAggregation,omitempty"` +} + +var _ genruntime.ARMTransformer = &Condition{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (condition *Condition) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if condition == nil { + return nil, nil + } + result := &arm.Condition{} + + // Set property "AlertSensitivity": + if condition.AlertSensitivity != nil { + alertSensitivity := *condition.AlertSensitivity + result.AlertSensitivity = &alertSensitivity + } + + // Set property "CriterionType": + if condition.CriterionType != nil { + var temp string + temp = string(*condition.CriterionType) + criterionType := arm.Condition_CriterionType(temp) + result.CriterionType = &criterionType + } + + // Set property "Dimensions": + for _, item := range condition.Dimensions { + item_ARM, err := item.ConvertToARM(resolved) + if err != nil { + return nil, err + } + result.Dimensions = append(result.Dimensions, *item_ARM.(*arm.Dimension)) + } + + // Set property "FailingPeriods": + if condition.FailingPeriods != nil { + failingPeriods_ARM, err := (*condition.FailingPeriods).ConvertToARM(resolved) + if err != nil { + return nil, err + } + failingPeriods := *failingPeriods_ARM.(*arm.Condition_FailingPeriods) + result.FailingPeriods = &failingPeriods + } + + // Set property "IgnoreDataBefore": + if condition.IgnoreDataBefore != nil { + ignoreDataBefore := *condition.IgnoreDataBefore + result.IgnoreDataBefore = &ignoreDataBefore + } + + // Set property "MetricMeasureColumn": + if condition.MetricMeasureColumn != nil { + metricMeasureColumn := *condition.MetricMeasureColumn + result.MetricMeasureColumn = &metricMeasureColumn + } + + // Set property "MetricName": + if condition.MetricName != nil { + metricName := *condition.MetricName + result.MetricName = &metricName + } + + // Set property "Operator": + if condition.Operator != nil { + var temp string + temp = string(*condition.Operator) + operator := arm.Condition_Operator(temp) + result.Operator = &operator + } + + // Set property "Query": + if condition.Query != nil { + query := *condition.Query + result.Query = &query + } + + // Set property "ResourceIdColumn": + if condition.ResourceIdColumnReference != nil { + resourceIdColumnReferenceARMID, err := resolved.ResolvedReferences.Lookup(*condition.ResourceIdColumnReference) + if err != nil { + return nil, err + } + resourceIdColumnReference := resourceIdColumnReferenceARMID + result.ResourceIdColumn = &resourceIdColumnReference + } + + // Set property "Threshold": + if condition.Threshold != nil { + threshold := *condition.Threshold + result.Threshold = &threshold + } + + // Set property "TimeAggregation": + if condition.TimeAggregation != nil { + var temp string + temp = string(*condition.TimeAggregation) + timeAggregation := arm.Condition_TimeAggregation(temp) + result.TimeAggregation = &timeAggregation + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (condition *Condition) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Condition{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (condition *Condition) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Condition) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Condition, got %T", armInput) + } + + // Set property "AlertSensitivity": + if typedInput.AlertSensitivity != nil { + alertSensitivity := *typedInput.AlertSensitivity + condition.AlertSensitivity = &alertSensitivity + } + + // Set property "CriterionType": + if typedInput.CriterionType != nil { + var temp string + temp = string(*typedInput.CriterionType) + criterionType := Condition_CriterionType(temp) + condition.CriterionType = &criterionType + } + + // Set property "Dimensions": + for _, item := range typedInput.Dimensions { + var item1 Dimension + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + condition.Dimensions = append(condition.Dimensions, item1) + } + + // Set property "FailingPeriods": + if typedInput.FailingPeriods != nil { + var failingPeriods1 Condition_FailingPeriods + err := failingPeriods1.PopulateFromARM(owner, *typedInput.FailingPeriods) + if err != nil { + return err + } + failingPeriods := failingPeriods1 + condition.FailingPeriods = &failingPeriods + } + + // Set property "IgnoreDataBefore": + if typedInput.IgnoreDataBefore != nil { + ignoreDataBefore := *typedInput.IgnoreDataBefore + condition.IgnoreDataBefore = &ignoreDataBefore + } + + // Set property "MetricMeasureColumn": + if typedInput.MetricMeasureColumn != nil { + metricMeasureColumn := *typedInput.MetricMeasureColumn + condition.MetricMeasureColumn = &metricMeasureColumn + } + + // Set property "MetricName": + if typedInput.MetricName != nil { + metricName := *typedInput.MetricName + condition.MetricName = &metricName + } + + // Set property "Operator": + if typedInput.Operator != nil { + var temp string + temp = string(*typedInput.Operator) + operator := Condition_Operator(temp) + condition.Operator = &operator + } + + // Set property "Query": + if typedInput.Query != nil { + query := *typedInput.Query + condition.Query = &query + } + + // no assignment for property "ResourceIdColumnReference" + + // Set property "Threshold": + if typedInput.Threshold != nil { + threshold := *typedInput.Threshold + condition.Threshold = &threshold + } + + // Set property "TimeAggregation": + if typedInput.TimeAggregation != nil { + var temp string + temp = string(*typedInput.TimeAggregation) + timeAggregation := Condition_TimeAggregation(temp) + condition.TimeAggregation = &timeAggregation + } + + // No error + return nil +} + +// AssignProperties_From_Condition populates our Condition from the provided source Condition +func (condition *Condition) AssignProperties_From_Condition(source *storage.Condition) error { + + // AlertSensitivity + condition.AlertSensitivity = genruntime.ClonePointerToString(source.AlertSensitivity) + + // CriterionType + if source.CriterionType != nil { + criterionType := *source.CriterionType + criterionTypeTemp := genruntime.ToEnum(criterionType, condition_CriterionType_Values) + condition.CriterionType = &criterionTypeTemp + } else { + condition.CriterionType = nil + } + + // Dimensions + if source.Dimensions != nil { + dimensionList := make([]Dimension, len(source.Dimensions)) + for dimensionIndex, dimensionItem := range source.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension Dimension + err := dimension.AssignProperties_From_Dimension(&dimensionItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Dimension() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + condition.Dimensions = dimensionList + } else { + condition.Dimensions = nil + } + + // FailingPeriods + if source.FailingPeriods != nil { + var failingPeriod Condition_FailingPeriods + err := failingPeriod.AssignProperties_From_Condition_FailingPeriods(source.FailingPeriods) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition_FailingPeriods() to populate field FailingPeriods") + } + condition.FailingPeriods = &failingPeriod + } else { + condition.FailingPeriods = nil + } + + // IgnoreDataBefore + condition.IgnoreDataBefore = genruntime.ClonePointerToString(source.IgnoreDataBefore) + + // MetricMeasureColumn + condition.MetricMeasureColumn = genruntime.ClonePointerToString(source.MetricMeasureColumn) + + // MetricName + condition.MetricName = genruntime.ClonePointerToString(source.MetricName) + + // Operator + if source.Operator != nil { + operator := *source.Operator + operatorTemp := genruntime.ToEnum(operator, condition_Operator_Values) + condition.Operator = &operatorTemp + } else { + condition.Operator = nil + } + + // Query + condition.Query = genruntime.ClonePointerToString(source.Query) + + // ResourceIdColumnReference + if source.ResourceIdColumnReference != nil { + resourceIdColumnReference := source.ResourceIdColumnReference.Copy() + condition.ResourceIdColumnReference = &resourceIdColumnReference + } else { + condition.ResourceIdColumnReference = nil + } + + // Threshold + if source.Threshold != nil { + threshold := *source.Threshold + condition.Threshold = &threshold + } else { + condition.Threshold = nil + } + + // TimeAggregation + if source.TimeAggregation != nil { + timeAggregation := *source.TimeAggregation + timeAggregationTemp := genruntime.ToEnum(timeAggregation, condition_TimeAggregation_Values) + condition.TimeAggregation = &timeAggregationTemp + } else { + condition.TimeAggregation = nil + } + + // No error + return nil +} + +// AssignProperties_To_Condition populates the provided destination Condition from our Condition +func (condition *Condition) AssignProperties_To_Condition(destination *storage.Condition) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlertSensitivity + destination.AlertSensitivity = genruntime.ClonePointerToString(condition.AlertSensitivity) + + // CriterionType + if condition.CriterionType != nil { + criterionType := string(*condition.CriterionType) + destination.CriterionType = &criterionType + } else { + destination.CriterionType = nil + } + + // Dimensions + if condition.Dimensions != nil { + dimensionList := make([]storage.Dimension, len(condition.Dimensions)) + for dimensionIndex, dimensionItem := range condition.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension storage.Dimension + err := dimensionItem.AssignProperties_To_Dimension(&dimension) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Dimension() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + destination.Dimensions = dimensionList + } else { + destination.Dimensions = nil + } + + // FailingPeriods + if condition.FailingPeriods != nil { + var failingPeriod storage.Condition_FailingPeriods + err := condition.FailingPeriods.AssignProperties_To_Condition_FailingPeriods(&failingPeriod) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition_FailingPeriods() to populate field FailingPeriods") + } + destination.FailingPeriods = &failingPeriod + } else { + destination.FailingPeriods = nil + } + + // IgnoreDataBefore + destination.IgnoreDataBefore = genruntime.ClonePointerToString(condition.IgnoreDataBefore) + + // MetricMeasureColumn + destination.MetricMeasureColumn = genruntime.ClonePointerToString(condition.MetricMeasureColumn) + + // MetricName + destination.MetricName = genruntime.ClonePointerToString(condition.MetricName) + + // Operator + if condition.Operator != nil { + operator := string(*condition.Operator) + destination.Operator = &operator + } else { + destination.Operator = nil + } + + // Query + destination.Query = genruntime.ClonePointerToString(condition.Query) + + // ResourceIdColumnReference + if condition.ResourceIdColumnReference != nil { + resourceIdColumnReference := condition.ResourceIdColumnReference.Copy() + destination.ResourceIdColumnReference = &resourceIdColumnReference + } else { + destination.ResourceIdColumnReference = nil + } + + // Threshold + if condition.Threshold != nil { + threshold := *condition.Threshold + destination.Threshold = &threshold + } else { + destination.Threshold = nil + } + + // TimeAggregation + if condition.TimeAggregation != nil { + timeAggregation := string(*condition.TimeAggregation) + destination.TimeAggregation = &timeAggregation + } else { + destination.TimeAggregation = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// A condition of the scheduled query rule. +type Condition_STATUS struct { + // AlertSensitivity: The extent of deviation required to trigger an alert. Allowed values are 'Low', 'Medium' and 'High'. + // This will affect how tight the threshold is to the metric series pattern. Relevant and required only for dynamic + // threshold rules of the kind LogAlert. + AlertSensitivity *string `json:"alertSensitivity,omitempty"` + + // CriterionType: Specifies the type of threshold criteria + CriterionType *Condition_CriterionType_STATUS `json:"criterionType,omitempty"` + + // Dimensions: List of Dimensions conditions + Dimensions []Dimension_STATUS `json:"dimensions,omitempty"` + + // FailingPeriods: The minimum number of violations required within the selected lookback time window required to raise an + // alert. Relevant only for rules of the kind LogAlert. + FailingPeriods *Condition_FailingPeriods_STATUS `json:"failingPeriods,omitempty"` + + // IgnoreDataBefore: Use this option to set the date from which to start learning the metric historical data and calculate + // the dynamic thresholds (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert. + IgnoreDataBefore *string `json:"ignoreDataBefore,omitempty"` + + // MetricMeasureColumn: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. + MetricMeasureColumn *string `json:"metricMeasureColumn,omitempty"` + + // MetricName: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. + MetricName *string `json:"metricName,omitempty"` + + // Operator: The criteria operator. Relevant and required only for rules of the kind LogAlert. + Operator *Condition_Operator_STATUS `json:"operator,omitempty"` + + // Query: Log query alert + Query *string `json:"query,omitempty"` + + // ResourceIdColumn: The column containing the resource id. The content of the column must be a uri formatted as resource + // id. Relevant only for rules of the kind LogAlert. + ResourceIdColumn *string `json:"resourceIdColumn,omitempty"` + + // Threshold: the criteria threshold value that activates the alert. Relevant and required only for static threshold rules + // of the kind LogAlert. + Threshold *float64 `json:"threshold,omitempty"` + + // TimeAggregation: Aggregation type. Relevant and required only for rules of the kind LogAlert. + TimeAggregation *Condition_TimeAggregation_STATUS `json:"timeAggregation,omitempty"` +} + +var _ genruntime.FromARMConverter = &Condition_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (condition *Condition_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Condition_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (condition *Condition_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Condition_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Condition_STATUS, got %T", armInput) + } + + // Set property "AlertSensitivity": + if typedInput.AlertSensitivity != nil { + alertSensitivity := *typedInput.AlertSensitivity + condition.AlertSensitivity = &alertSensitivity + } + + // Set property "CriterionType": + if typedInput.CriterionType != nil { + var temp string + temp = string(*typedInput.CriterionType) + criterionType := Condition_CriterionType_STATUS(temp) + condition.CriterionType = &criterionType + } + + // Set property "Dimensions": + for _, item := range typedInput.Dimensions { + var item1 Dimension_STATUS + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + condition.Dimensions = append(condition.Dimensions, item1) + } + + // Set property "FailingPeriods": + if typedInput.FailingPeriods != nil { + var failingPeriods1 Condition_FailingPeriods_STATUS + err := failingPeriods1.PopulateFromARM(owner, *typedInput.FailingPeriods) + if err != nil { + return err + } + failingPeriods := failingPeriods1 + condition.FailingPeriods = &failingPeriods + } + + // Set property "IgnoreDataBefore": + if typedInput.IgnoreDataBefore != nil { + ignoreDataBefore := *typedInput.IgnoreDataBefore + condition.IgnoreDataBefore = &ignoreDataBefore + } + + // Set property "MetricMeasureColumn": + if typedInput.MetricMeasureColumn != nil { + metricMeasureColumn := *typedInput.MetricMeasureColumn + condition.MetricMeasureColumn = &metricMeasureColumn + } + + // Set property "MetricName": + if typedInput.MetricName != nil { + metricName := *typedInput.MetricName + condition.MetricName = &metricName + } + + // Set property "Operator": + if typedInput.Operator != nil { + var temp string + temp = string(*typedInput.Operator) + operator := Condition_Operator_STATUS(temp) + condition.Operator = &operator + } + + // Set property "Query": + if typedInput.Query != nil { + query := *typedInput.Query + condition.Query = &query + } + + // Set property "ResourceIdColumn": + if typedInput.ResourceIdColumn != nil { + resourceIdColumn := *typedInput.ResourceIdColumn + condition.ResourceIdColumn = &resourceIdColumn + } + + // Set property "Threshold": + if typedInput.Threshold != nil { + threshold := *typedInput.Threshold + condition.Threshold = &threshold + } + + // Set property "TimeAggregation": + if typedInput.TimeAggregation != nil { + var temp string + temp = string(*typedInput.TimeAggregation) + timeAggregation := Condition_TimeAggregation_STATUS(temp) + condition.TimeAggregation = &timeAggregation + } + + // No error + return nil +} + +// AssignProperties_From_Condition_STATUS populates our Condition_STATUS from the provided source Condition_STATUS +func (condition *Condition_STATUS) AssignProperties_From_Condition_STATUS(source *storage.Condition_STATUS) error { + + // AlertSensitivity + condition.AlertSensitivity = genruntime.ClonePointerToString(source.AlertSensitivity) + + // CriterionType + if source.CriterionType != nil { + criterionType := *source.CriterionType + criterionTypeTemp := genruntime.ToEnum(criterionType, condition_CriterionType_STATUS_Values) + condition.CriterionType = &criterionTypeTemp + } else { + condition.CriterionType = nil + } + + // Dimensions + if source.Dimensions != nil { + dimensionList := make([]Dimension_STATUS, len(source.Dimensions)) + for dimensionIndex, dimensionItem := range source.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension Dimension_STATUS + err := dimension.AssignProperties_From_Dimension_STATUS(&dimensionItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Dimension_STATUS() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + condition.Dimensions = dimensionList + } else { + condition.Dimensions = nil + } + + // FailingPeriods + if source.FailingPeriods != nil { + var failingPeriod Condition_FailingPeriods_STATUS + err := failingPeriod.AssignProperties_From_Condition_FailingPeriods_STATUS(source.FailingPeriods) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition_FailingPeriods_STATUS() to populate field FailingPeriods") + } + condition.FailingPeriods = &failingPeriod + } else { + condition.FailingPeriods = nil + } + + // IgnoreDataBefore + condition.IgnoreDataBefore = genruntime.ClonePointerToString(source.IgnoreDataBefore) + + // MetricMeasureColumn + condition.MetricMeasureColumn = genruntime.ClonePointerToString(source.MetricMeasureColumn) + + // MetricName + condition.MetricName = genruntime.ClonePointerToString(source.MetricName) + + // Operator + if source.Operator != nil { + operator := *source.Operator + operatorTemp := genruntime.ToEnum(operator, condition_Operator_STATUS_Values) + condition.Operator = &operatorTemp + } else { + condition.Operator = nil + } + + // Query + condition.Query = genruntime.ClonePointerToString(source.Query) + + // ResourceIdColumn + condition.ResourceIdColumn = genruntime.ClonePointerToString(source.ResourceIdColumn) + + // Threshold + if source.Threshold != nil { + threshold := *source.Threshold + condition.Threshold = &threshold + } else { + condition.Threshold = nil + } + + // TimeAggregation + if source.TimeAggregation != nil { + timeAggregation := *source.TimeAggregation + timeAggregationTemp := genruntime.ToEnum(timeAggregation, condition_TimeAggregation_STATUS_Values) + condition.TimeAggregation = &timeAggregationTemp + } else { + condition.TimeAggregation = nil + } + + // No error + return nil +} + +// AssignProperties_To_Condition_STATUS populates the provided destination Condition_STATUS from our Condition_STATUS +func (condition *Condition_STATUS) AssignProperties_To_Condition_STATUS(destination *storage.Condition_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlertSensitivity + destination.AlertSensitivity = genruntime.ClonePointerToString(condition.AlertSensitivity) + + // CriterionType + if condition.CriterionType != nil { + criterionType := string(*condition.CriterionType) + destination.CriterionType = &criterionType + } else { + destination.CriterionType = nil + } + + // Dimensions + if condition.Dimensions != nil { + dimensionList := make([]storage.Dimension_STATUS, len(condition.Dimensions)) + for dimensionIndex, dimensionItem := range condition.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension storage.Dimension_STATUS + err := dimensionItem.AssignProperties_To_Dimension_STATUS(&dimension) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Dimension_STATUS() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + destination.Dimensions = dimensionList + } else { + destination.Dimensions = nil + } + + // FailingPeriods + if condition.FailingPeriods != nil { + var failingPeriod storage.Condition_FailingPeriods_STATUS + err := condition.FailingPeriods.AssignProperties_To_Condition_FailingPeriods_STATUS(&failingPeriod) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition_FailingPeriods_STATUS() to populate field FailingPeriods") + } + destination.FailingPeriods = &failingPeriod + } else { + destination.FailingPeriods = nil + } + + // IgnoreDataBefore + destination.IgnoreDataBefore = genruntime.ClonePointerToString(condition.IgnoreDataBefore) + + // MetricMeasureColumn + destination.MetricMeasureColumn = genruntime.ClonePointerToString(condition.MetricMeasureColumn) + + // MetricName + destination.MetricName = genruntime.ClonePointerToString(condition.MetricName) + + // Operator + if condition.Operator != nil { + operator := string(*condition.Operator) + destination.Operator = &operator + } else { + destination.Operator = nil + } + + // Query + destination.Query = genruntime.ClonePointerToString(condition.Query) + + // ResourceIdColumn + destination.ResourceIdColumn = genruntime.ClonePointerToString(condition.ResourceIdColumn) + + // Threshold + if condition.Threshold != nil { + threshold := *condition.Threshold + destination.Threshold = &threshold + } else { + destination.Threshold = nil + } + + // TimeAggregation + if condition.TimeAggregation != nil { + timeAggregation := string(*condition.TimeAggregation) + destination.TimeAggregation = &timeAggregation + } else { + destination.TimeAggregation = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"None","SystemAssigned","UserAssigned"} +type Identity_Type string + +const ( + Identity_Type_None = Identity_Type("None") + Identity_Type_SystemAssigned = Identity_Type("SystemAssigned") + Identity_Type_UserAssigned = Identity_Type("UserAssigned") +) + +// Mapping from string to Identity_Type +var identity_Type_Values = map[string]Identity_Type{ + "none": Identity_Type_None, + "systemassigned": Identity_Type_SystemAssigned, + "userassigned": Identity_Type_UserAssigned, +} + +type Identity_Type_STATUS string + +const ( + Identity_Type_STATUS_None = Identity_Type_STATUS("None") + Identity_Type_STATUS_SystemAssigned = Identity_Type_STATUS("SystemAssigned") + Identity_Type_STATUS_UserAssigned = Identity_Type_STATUS("UserAssigned") +) + +// Mapping from string to Identity_Type_STATUS +var identity_Type_STATUS_Values = map[string]Identity_Type_STATUS{ + "none": Identity_Type_STATUS_None, + "systemassigned": Identity_Type_STATUS_SystemAssigned, + "userassigned": Identity_Type_STATUS_UserAssigned, +} + +type SystemData_CreatedByType_STATUS string + +const ( + SystemData_CreatedByType_STATUS_Application = SystemData_CreatedByType_STATUS("Application") + SystemData_CreatedByType_STATUS_Key = SystemData_CreatedByType_STATUS("Key") + SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity") + SystemData_CreatedByType_STATUS_User = SystemData_CreatedByType_STATUS("User") +) + +// Mapping from string to SystemData_CreatedByType_STATUS +var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{ + "application": SystemData_CreatedByType_STATUS_Application, + "key": SystemData_CreatedByType_STATUS_Key, + "managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity, + "user": SystemData_CreatedByType_STATUS_User, +} + +type SystemData_LastModifiedByType_STATUS string + +const ( + SystemData_LastModifiedByType_STATUS_Application = SystemData_LastModifiedByType_STATUS("Application") + SystemData_LastModifiedByType_STATUS_Key = SystemData_LastModifiedByType_STATUS("Key") + SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity") + SystemData_LastModifiedByType_STATUS_User = SystemData_LastModifiedByType_STATUS("User") +) + +// Mapping from string to SystemData_LastModifiedByType_STATUS +var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{ + "application": SystemData_LastModifiedByType_STATUS_Application, + "key": SystemData_LastModifiedByType_STATUS_Key, + "managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity, + "user": SystemData_LastModifiedByType_STATUS_User, +} + +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { + Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` +} + +// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails +func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *storage.UserAssignedIdentityDetails) error { + + // Reference + details.Reference = source.Reference.Copy() + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityDetails populates the provided destination UserAssignedIdentityDetails from our UserAssignedIdentityDetails +func (details *UserAssignedIdentityDetails) AssignProperties_To_UserAssignedIdentityDetails(destination *storage.UserAssignedIdentityDetails) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Reference + destination.Reference = details.Reference.Copy() + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// User assigned identity properties. +type UserIdentityProperties_STATUS struct { + // ClientId: The client id of user assigned identity. + ClientId *string `json:"clientId,omitempty"` + + // PrincipalId: The principal id of user assigned identity. + PrincipalId *string `json:"principalId,omitempty"` +} + +var _ genruntime.FromARMConverter = &UserIdentityProperties_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *UserIdentityProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.UserIdentityProperties_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *UserIdentityProperties_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.UserIdentityProperties_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.UserIdentityProperties_STATUS, got %T", armInput) + } + + // Set property "ClientId": + if typedInput.ClientId != nil { + clientId := *typedInput.ClientId + properties.ClientId = &clientId + } + + // Set property "PrincipalId": + if typedInput.PrincipalId != nil { + principalId := *typedInput.PrincipalId + properties.PrincipalId = &principalId + } + + // No error + return nil +} + +// AssignProperties_From_UserIdentityProperties_STATUS populates our UserIdentityProperties_STATUS from the provided source UserIdentityProperties_STATUS +func (properties *UserIdentityProperties_STATUS) AssignProperties_From_UserIdentityProperties_STATUS(source *storage.UserIdentityProperties_STATUS) error { + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // PrincipalId + properties.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // No error + return nil +} + +// AssignProperties_To_UserIdentityProperties_STATUS populates the provided destination UserIdentityProperties_STATUS from our UserIdentityProperties_STATUS +func (properties *UserIdentityProperties_STATUS) AssignProperties_To_UserIdentityProperties_STATUS(destination *storage.UserIdentityProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(properties.ClientId) + + // PrincipalId + destination.PrincipalId = genruntime.ClonePointerToString(properties.PrincipalId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"DynamicThresholdCriterion","StaticThresholdCriterion"} +type Condition_CriterionType string + +const ( + Condition_CriterionType_DynamicThresholdCriterion = Condition_CriterionType("DynamicThresholdCriterion") + Condition_CriterionType_StaticThresholdCriterion = Condition_CriterionType("StaticThresholdCriterion") +) + +// Mapping from string to Condition_CriterionType +var condition_CriterionType_Values = map[string]Condition_CriterionType{ + "dynamicthresholdcriterion": Condition_CriterionType_DynamicThresholdCriterion, + "staticthresholdcriterion": Condition_CriterionType_StaticThresholdCriterion, +} + +type Condition_CriterionType_STATUS string + +const ( + Condition_CriterionType_STATUS_DynamicThresholdCriterion = Condition_CriterionType_STATUS("DynamicThresholdCriterion") + Condition_CriterionType_STATUS_StaticThresholdCriterion = Condition_CriterionType_STATUS("StaticThresholdCriterion") +) + +// Mapping from string to Condition_CriterionType_STATUS +var condition_CriterionType_STATUS_Values = map[string]Condition_CriterionType_STATUS{ + "dynamicthresholdcriterion": Condition_CriterionType_STATUS_DynamicThresholdCriterion, + "staticthresholdcriterion": Condition_CriterionType_STATUS_StaticThresholdCriterion, +} + +type Condition_FailingPeriods struct { + // MinFailingPeriodsToAlert: The number of violations to trigger an alert. Should be smaller or equal to + // numberOfEvaluationPeriods. Default value is 1 + MinFailingPeriodsToAlert *int `json:"minFailingPeriodsToAlert,omitempty"` + + // NumberOfEvaluationPeriods: The number of aggregated lookback points. The lookback time window is calculated based on the + // aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 + NumberOfEvaluationPeriods *int `json:"numberOfEvaluationPeriods,omitempty"` +} + +var _ genruntime.ARMTransformer = &Condition_FailingPeriods{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (periods *Condition_FailingPeriods) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if periods == nil { + return nil, nil + } + result := &arm.Condition_FailingPeriods{} + + // Set property "MinFailingPeriodsToAlert": + if periods.MinFailingPeriodsToAlert != nil { + minFailingPeriodsToAlert := *periods.MinFailingPeriodsToAlert + result.MinFailingPeriodsToAlert = &minFailingPeriodsToAlert + } + + // Set property "NumberOfEvaluationPeriods": + if periods.NumberOfEvaluationPeriods != nil { + numberOfEvaluationPeriods := *periods.NumberOfEvaluationPeriods + result.NumberOfEvaluationPeriods = &numberOfEvaluationPeriods + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (periods *Condition_FailingPeriods) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Condition_FailingPeriods{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (periods *Condition_FailingPeriods) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Condition_FailingPeriods) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Condition_FailingPeriods, got %T", armInput) + } + + // Set property "MinFailingPeriodsToAlert": + if typedInput.MinFailingPeriodsToAlert != nil { + minFailingPeriodsToAlert := *typedInput.MinFailingPeriodsToAlert + periods.MinFailingPeriodsToAlert = &minFailingPeriodsToAlert + } + + // Set property "NumberOfEvaluationPeriods": + if typedInput.NumberOfEvaluationPeriods != nil { + numberOfEvaluationPeriods := *typedInput.NumberOfEvaluationPeriods + periods.NumberOfEvaluationPeriods = &numberOfEvaluationPeriods + } + + // No error + return nil +} + +// AssignProperties_From_Condition_FailingPeriods populates our Condition_FailingPeriods from the provided source Condition_FailingPeriods +func (periods *Condition_FailingPeriods) AssignProperties_From_Condition_FailingPeriods(source *storage.Condition_FailingPeriods) error { + + // MinFailingPeriodsToAlert + periods.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(source.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + periods.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(source.NumberOfEvaluationPeriods) + + // No error + return nil +} + +// AssignProperties_To_Condition_FailingPeriods populates the provided destination Condition_FailingPeriods from our Condition_FailingPeriods +func (periods *Condition_FailingPeriods) AssignProperties_To_Condition_FailingPeriods(destination *storage.Condition_FailingPeriods) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // MinFailingPeriodsToAlert + destination.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(periods.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + destination.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(periods.NumberOfEvaluationPeriods) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Condition_FailingPeriods_STATUS struct { + // MinFailingPeriodsToAlert: The number of violations to trigger an alert. Should be smaller or equal to + // numberOfEvaluationPeriods. Default value is 1 + MinFailingPeriodsToAlert *int `json:"minFailingPeriodsToAlert,omitempty"` + + // NumberOfEvaluationPeriods: The number of aggregated lookback points. The lookback time window is calculated based on the + // aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 + NumberOfEvaluationPeriods *int `json:"numberOfEvaluationPeriods,omitempty"` +} + +var _ genruntime.FromARMConverter = &Condition_FailingPeriods_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (periods *Condition_FailingPeriods_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Condition_FailingPeriods_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (periods *Condition_FailingPeriods_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Condition_FailingPeriods_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Condition_FailingPeriods_STATUS, got %T", armInput) + } + + // Set property "MinFailingPeriodsToAlert": + if typedInput.MinFailingPeriodsToAlert != nil { + minFailingPeriodsToAlert := *typedInput.MinFailingPeriodsToAlert + periods.MinFailingPeriodsToAlert = &minFailingPeriodsToAlert + } + + // Set property "NumberOfEvaluationPeriods": + if typedInput.NumberOfEvaluationPeriods != nil { + numberOfEvaluationPeriods := *typedInput.NumberOfEvaluationPeriods + periods.NumberOfEvaluationPeriods = &numberOfEvaluationPeriods + } + + // No error + return nil +} + +// AssignProperties_From_Condition_FailingPeriods_STATUS populates our Condition_FailingPeriods_STATUS from the provided source Condition_FailingPeriods_STATUS +func (periods *Condition_FailingPeriods_STATUS) AssignProperties_From_Condition_FailingPeriods_STATUS(source *storage.Condition_FailingPeriods_STATUS) error { + + // MinFailingPeriodsToAlert + periods.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(source.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + periods.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(source.NumberOfEvaluationPeriods) + + // No error + return nil +} + +// AssignProperties_To_Condition_FailingPeriods_STATUS populates the provided destination Condition_FailingPeriods_STATUS from our Condition_FailingPeriods_STATUS +func (periods *Condition_FailingPeriods_STATUS) AssignProperties_To_Condition_FailingPeriods_STATUS(destination *storage.Condition_FailingPeriods_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // MinFailingPeriodsToAlert + destination.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(periods.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + destination.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(periods.NumberOfEvaluationPeriods) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Equals","GreaterOrLessThan","GreaterThan","GreaterThanOrEqual","LessThan","LessThanOrEqual"} +type Condition_Operator string + +const ( + Condition_Operator_Equals = Condition_Operator("Equals") + Condition_Operator_GreaterOrLessThan = Condition_Operator("GreaterOrLessThan") + Condition_Operator_GreaterThan = Condition_Operator("GreaterThan") + Condition_Operator_GreaterThanOrEqual = Condition_Operator("GreaterThanOrEqual") + Condition_Operator_LessThan = Condition_Operator("LessThan") + Condition_Operator_LessThanOrEqual = Condition_Operator("LessThanOrEqual") +) + +// Mapping from string to Condition_Operator +var condition_Operator_Values = map[string]Condition_Operator{ + "equals": Condition_Operator_Equals, + "greaterorlessthan": Condition_Operator_GreaterOrLessThan, + "greaterthan": Condition_Operator_GreaterThan, + "greaterthanorequal": Condition_Operator_GreaterThanOrEqual, + "lessthan": Condition_Operator_LessThan, + "lessthanorequal": Condition_Operator_LessThanOrEqual, +} + +type Condition_Operator_STATUS string + +const ( + Condition_Operator_STATUS_Equals = Condition_Operator_STATUS("Equals") + Condition_Operator_STATUS_GreaterOrLessThan = Condition_Operator_STATUS("GreaterOrLessThan") + Condition_Operator_STATUS_GreaterThan = Condition_Operator_STATUS("GreaterThan") + Condition_Operator_STATUS_GreaterThanOrEqual = Condition_Operator_STATUS("GreaterThanOrEqual") + Condition_Operator_STATUS_LessThan = Condition_Operator_STATUS("LessThan") + Condition_Operator_STATUS_LessThanOrEqual = Condition_Operator_STATUS("LessThanOrEqual") +) + +// Mapping from string to Condition_Operator_STATUS +var condition_Operator_STATUS_Values = map[string]Condition_Operator_STATUS{ + "equals": Condition_Operator_STATUS_Equals, + "greaterorlessthan": Condition_Operator_STATUS_GreaterOrLessThan, + "greaterthan": Condition_Operator_STATUS_GreaterThan, + "greaterthanorequal": Condition_Operator_STATUS_GreaterThanOrEqual, + "lessthan": Condition_Operator_STATUS_LessThan, + "lessthanorequal": Condition_Operator_STATUS_LessThanOrEqual, +} + +// +kubebuilder:validation:Enum={"Average","Count","Maximum","Minimum","Total"} +type Condition_TimeAggregation string + +const ( + Condition_TimeAggregation_Average = Condition_TimeAggregation("Average") + Condition_TimeAggregation_Count = Condition_TimeAggregation("Count") + Condition_TimeAggregation_Maximum = Condition_TimeAggregation("Maximum") + Condition_TimeAggregation_Minimum = Condition_TimeAggregation("Minimum") + Condition_TimeAggregation_Total = Condition_TimeAggregation("Total") +) + +// Mapping from string to Condition_TimeAggregation +var condition_TimeAggregation_Values = map[string]Condition_TimeAggregation{ + "average": Condition_TimeAggregation_Average, + "count": Condition_TimeAggregation_Count, + "maximum": Condition_TimeAggregation_Maximum, + "minimum": Condition_TimeAggregation_Minimum, + "total": Condition_TimeAggregation_Total, +} + +type Condition_TimeAggregation_STATUS string + +const ( + Condition_TimeAggregation_STATUS_Average = Condition_TimeAggregation_STATUS("Average") + Condition_TimeAggregation_STATUS_Count = Condition_TimeAggregation_STATUS("Count") + Condition_TimeAggregation_STATUS_Maximum = Condition_TimeAggregation_STATUS("Maximum") + Condition_TimeAggregation_STATUS_Minimum = Condition_TimeAggregation_STATUS("Minimum") + Condition_TimeAggregation_STATUS_Total = Condition_TimeAggregation_STATUS("Total") +) + +// Mapping from string to Condition_TimeAggregation_STATUS +var condition_TimeAggregation_STATUS_Values = map[string]Condition_TimeAggregation_STATUS{ + "average": Condition_TimeAggregation_STATUS_Average, + "count": Condition_TimeAggregation_STATUS_Count, + "maximum": Condition_TimeAggregation_STATUS_Maximum, + "minimum": Condition_TimeAggregation_STATUS_Minimum, + "total": Condition_TimeAggregation_STATUS_Total, +} + +// Dimension splitting and filtering definition +type Dimension struct { + // +kubebuilder:validation:Required + // Name: Name of the dimension + Name *string `json:"name,omitempty"` + + // +kubebuilder:validation:Required + // Operator: Operator for dimension values + Operator *Dimension_Operator `json:"operator,omitempty"` + + // +kubebuilder:validation:Required + // Values: List of dimension values + Values []string `json:"values,omitempty"` +} + +var _ genruntime.ARMTransformer = &Dimension{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (dimension *Dimension) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if dimension == nil { + return nil, nil + } + result := &arm.Dimension{} + + // Set property "Name": + if dimension.Name != nil { + name := *dimension.Name + result.Name = &name + } + + // Set property "Operator": + if dimension.Operator != nil { + var temp string + temp = string(*dimension.Operator) + operator := arm.Dimension_Operator(temp) + result.Operator = &operator + } + + // Set property "Values": + for _, item := range dimension.Values { + result.Values = append(result.Values, item) + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (dimension *Dimension) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Dimension{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (dimension *Dimension) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Dimension) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Dimension, got %T", armInput) + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + dimension.Name = &name + } + + // Set property "Operator": + if typedInput.Operator != nil { + var temp string + temp = string(*typedInput.Operator) + operator := Dimension_Operator(temp) + dimension.Operator = &operator + } + + // Set property "Values": + for _, item := range typedInput.Values { + dimension.Values = append(dimension.Values, item) + } + + // No error + return nil +} + +// AssignProperties_From_Dimension populates our Dimension from the provided source Dimension +func (dimension *Dimension) AssignProperties_From_Dimension(source *storage.Dimension) error { + + // Name + dimension.Name = genruntime.ClonePointerToString(source.Name) + + // Operator + if source.Operator != nil { + operator := *source.Operator + operatorTemp := genruntime.ToEnum(operator, dimension_Operator_Values) + dimension.Operator = &operatorTemp + } else { + dimension.Operator = nil + } + + // Values + dimension.Values = genruntime.CloneSliceOfString(source.Values) + + // No error + return nil +} + +// AssignProperties_To_Dimension populates the provided destination Dimension from our Dimension +func (dimension *Dimension) AssignProperties_To_Dimension(destination *storage.Dimension) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Name + destination.Name = genruntime.ClonePointerToString(dimension.Name) + + // Operator + if dimension.Operator != nil { + operator := string(*dimension.Operator) + destination.Operator = &operator + } else { + destination.Operator = nil + } + + // Values + destination.Values = genruntime.CloneSliceOfString(dimension.Values) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Dimension splitting and filtering definition +type Dimension_STATUS struct { + // Name: Name of the dimension + Name *string `json:"name,omitempty"` + + // Operator: Operator for dimension values + Operator *Dimension_Operator_STATUS `json:"operator,omitempty"` + + // Values: List of dimension values + Values []string `json:"values,omitempty"` +} + +var _ genruntime.FromARMConverter = &Dimension_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (dimension *Dimension_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Dimension_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (dimension *Dimension_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Dimension_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Dimension_STATUS, got %T", armInput) + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + dimension.Name = &name + } + + // Set property "Operator": + if typedInput.Operator != nil { + var temp string + temp = string(*typedInput.Operator) + operator := Dimension_Operator_STATUS(temp) + dimension.Operator = &operator + } + + // Set property "Values": + for _, item := range typedInput.Values { + dimension.Values = append(dimension.Values, item) + } + + // No error + return nil +} + +// AssignProperties_From_Dimension_STATUS populates our Dimension_STATUS from the provided source Dimension_STATUS +func (dimension *Dimension_STATUS) AssignProperties_From_Dimension_STATUS(source *storage.Dimension_STATUS) error { + + // Name + dimension.Name = genruntime.ClonePointerToString(source.Name) + + // Operator + if source.Operator != nil { + operator := *source.Operator + operatorTemp := genruntime.ToEnum(operator, dimension_Operator_STATUS_Values) + dimension.Operator = &operatorTemp + } else { + dimension.Operator = nil + } + + // Values + dimension.Values = genruntime.CloneSliceOfString(source.Values) + + // No error + return nil +} + +// AssignProperties_To_Dimension_STATUS populates the provided destination Dimension_STATUS from our Dimension_STATUS +func (dimension *Dimension_STATUS) AssignProperties_To_Dimension_STATUS(destination *storage.Dimension_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Name + destination.Name = genruntime.ClonePointerToString(dimension.Name) + + // Operator + if dimension.Operator != nil { + operator := string(*dimension.Operator) + destination.Operator = &operator + } else { + destination.Operator = nil + } + + // Values + destination.Values = genruntime.CloneSliceOfString(dimension.Values) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Exclude","Include"} +type Dimension_Operator string + +const ( + Dimension_Operator_Exclude = Dimension_Operator("Exclude") + Dimension_Operator_Include = Dimension_Operator("Include") +) + +// Mapping from string to Dimension_Operator +var dimension_Operator_Values = map[string]Dimension_Operator{ + "exclude": Dimension_Operator_Exclude, + "include": Dimension_Operator_Include, +} + +type Dimension_Operator_STATUS string + +const ( + Dimension_Operator_STATUS_Exclude = Dimension_Operator_STATUS("Exclude") + Dimension_Operator_STATUS_Include = Dimension_Operator_STATUS("Include") +) + +// Mapping from string to Dimension_Operator_STATUS +var dimension_Operator_STATUS_Values = map[string]Dimension_Operator_STATUS{ + "exclude": Dimension_Operator_STATUS_Exclude, + "include": Dimension_Operator_STATUS_Include, +} + +func init() { + SchemeBuilder.Register(&ScheduledQueryRule{}, &ScheduledQueryRuleList{}) +} diff --git a/v2/api/insights/v1api20240101preview/scheduled_query_rule_types_gen_test.go b/v2/api/insights/v1api20240101preview/scheduled_query_rule_types_gen_test.go new file mode 100644 index 00000000000..62cf1655b8c --- /dev/null +++ b/v2/api/insights/v1api20240101preview/scheduled_query_rule_types_gen_test.go @@ -0,0 +1,2426 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101preview + +import ( + "encoding/json" + v20220615s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615/storage" + v20240101ps "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_Actions_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Actions to Actions via AssignProperties_To_Actions & AssignProperties_From_Actions returns original", + prop.ForAll(RunPropertyAssignmentTestForActions, ActionsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForActions tests if a specific instance of Actions can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForActions(subject Actions) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Actions + err := copied.AssignProperties_To_Actions(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Actions + err = actual.AssignProperties_From_Actions(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Actions_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Actions via JSON returns original", + prop.ForAll(RunJSONSerializationTestForActions, ActionsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForActions runs a test to see if a specific instance of Actions round trips to JSON and back losslessly +func RunJSONSerializationTestForActions(subject Actions) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Actions + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Actions instances for property testing - lazily instantiated by ActionsGenerator() +var actionsGenerator gopter.Gen + +// ActionsGenerator returns a generator of Actions instances for property testing. +func ActionsGenerator() gopter.Gen { + if actionsGenerator != nil { + return actionsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForActions(generators) + actionsGenerator = gen.Struct(reflect.TypeOf(Actions{}), generators) + + return actionsGenerator +} + +// AddIndependentPropertyGeneratorsForActions is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForActions(gens map[string]gopter.Gen) { + gens["ActionProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["CustomProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +func Test_Actions_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Actions_STATUS to Actions_STATUS via AssignProperties_To_Actions_STATUS & AssignProperties_From_Actions_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForActions_STATUS, Actions_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForActions_STATUS tests if a specific instance of Actions_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForActions_STATUS(subject Actions_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Actions_STATUS + err := copied.AssignProperties_To_Actions_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Actions_STATUS + err = actual.AssignProperties_From_Actions_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Actions_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Actions_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForActions_STATUS, Actions_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForActions_STATUS runs a test to see if a specific instance of Actions_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForActions_STATUS(subject Actions_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Actions_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Actions_STATUS instances for property testing - lazily instantiated by Actions_STATUSGenerator() +var actions_STATUSGenerator gopter.Gen + +// Actions_STATUSGenerator returns a generator of Actions_STATUS instances for property testing. +func Actions_STATUSGenerator() gopter.Gen { + if actions_STATUSGenerator != nil { + return actions_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForActions_STATUS(generators) + actions_STATUSGenerator = gen.Struct(reflect.TypeOf(Actions_STATUS{}), generators) + + return actions_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForActions_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForActions_STATUS(gens map[string]gopter.Gen) { + gens["ActionGroups"] = gen.SliceOf(gen.AlphaString()) + gens["ActionProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["CustomProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +func Test_Condition_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition to Condition via AssignProperties_To_Condition & AssignProperties_From_Condition returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition, ConditionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition tests if a specific instance of Condition can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition(subject Condition) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Condition + err := copied.AssignProperties_To_Condition(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition + err = actual.AssignProperties_From_Condition(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition, ConditionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition runs a test to see if a specific instance of Condition round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition(subject Condition) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition instances for property testing - lazily instantiated by ConditionGenerator() +var conditionGenerator gopter.Gen + +// ConditionGenerator returns a generator of Condition instances for property testing. +// We first initialize conditionGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ConditionGenerator() gopter.Gen { + if conditionGenerator != nil { + return conditionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition(generators) + conditionGenerator = gen.Struct(reflect.TypeOf(Condition{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition(generators) + AddRelatedPropertyGeneratorsForCondition(generators) + conditionGenerator = gen.Struct(reflect.TypeOf(Condition{}), generators) + + return conditionGenerator +} + +// AddIndependentPropertyGeneratorsForCondition is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition(gens map[string]gopter.Gen) { + gens["AlertSensitivity"] = gen.PtrOf(gen.AlphaString()) + gens["CriterionType"] = gen.PtrOf(gen.OneConstOf(Condition_CriterionType_DynamicThresholdCriterion, Condition_CriterionType_StaticThresholdCriterion)) + gens["IgnoreDataBefore"] = gen.PtrOf(gen.AlphaString()) + gens["MetricMeasureColumn"] = gen.PtrOf(gen.AlphaString()) + gens["MetricName"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf( + Condition_Operator_Equals, + Condition_Operator_GreaterOrLessThan, + Condition_Operator_GreaterThan, + Condition_Operator_GreaterThanOrEqual, + Condition_Operator_LessThan, + Condition_Operator_LessThanOrEqual)) + gens["Query"] = gen.PtrOf(gen.AlphaString()) + gens["Threshold"] = gen.PtrOf(gen.Float64()) + gens["TimeAggregation"] = gen.PtrOf(gen.OneConstOf( + Condition_TimeAggregation_Average, + Condition_TimeAggregation_Count, + Condition_TimeAggregation_Maximum, + Condition_TimeAggregation_Minimum, + Condition_TimeAggregation_Total)) +} + +// AddRelatedPropertyGeneratorsForCondition is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCondition(gens map[string]gopter.Gen) { + gens["Dimensions"] = gen.SliceOf(DimensionGenerator()) + gens["FailingPeriods"] = gen.PtrOf(Condition_FailingPeriodsGenerator()) +} + +func Test_Condition_FailingPeriods_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition_FailingPeriods to Condition_FailingPeriods via AssignProperties_To_Condition_FailingPeriods & AssignProperties_From_Condition_FailingPeriods returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition_FailingPeriods, Condition_FailingPeriodsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition_FailingPeriods tests if a specific instance of Condition_FailingPeriods can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition_FailingPeriods(subject Condition_FailingPeriods) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Condition_FailingPeriods + err := copied.AssignProperties_To_Condition_FailingPeriods(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition_FailingPeriods + err = actual.AssignProperties_From_Condition_FailingPeriods(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_FailingPeriods_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_FailingPeriods via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_FailingPeriods, Condition_FailingPeriodsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_FailingPeriods runs a test to see if a specific instance of Condition_FailingPeriods round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_FailingPeriods(subject Condition_FailingPeriods) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_FailingPeriods + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_FailingPeriods instances for property testing - lazily instantiated by +// Condition_FailingPeriodsGenerator() +var condition_FailingPeriodsGenerator gopter.Gen + +// Condition_FailingPeriodsGenerator returns a generator of Condition_FailingPeriods instances for property testing. +func Condition_FailingPeriodsGenerator() gopter.Gen { + if condition_FailingPeriodsGenerator != nil { + return condition_FailingPeriodsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_FailingPeriods(generators) + condition_FailingPeriodsGenerator = gen.Struct(reflect.TypeOf(Condition_FailingPeriods{}), generators) + + return condition_FailingPeriodsGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_FailingPeriods is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_FailingPeriods(gens map[string]gopter.Gen) { + gens["MinFailingPeriodsToAlert"] = gen.PtrOf(gen.Int()) + gens["NumberOfEvaluationPeriods"] = gen.PtrOf(gen.Int()) +} + +func Test_Condition_FailingPeriods_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition_FailingPeriods_STATUS to Condition_FailingPeriods_STATUS via AssignProperties_To_Condition_FailingPeriods_STATUS & AssignProperties_From_Condition_FailingPeriods_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition_FailingPeriods_STATUS, Condition_FailingPeriods_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition_FailingPeriods_STATUS tests if a specific instance of Condition_FailingPeriods_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition_FailingPeriods_STATUS(subject Condition_FailingPeriods_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Condition_FailingPeriods_STATUS + err := copied.AssignProperties_To_Condition_FailingPeriods_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition_FailingPeriods_STATUS + err = actual.AssignProperties_From_Condition_FailingPeriods_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_FailingPeriods_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_FailingPeriods_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_FailingPeriods_STATUS, Condition_FailingPeriods_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_FailingPeriods_STATUS runs a test to see if a specific instance of Condition_FailingPeriods_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_FailingPeriods_STATUS(subject Condition_FailingPeriods_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_FailingPeriods_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_FailingPeriods_STATUS instances for property testing - lazily instantiated by +// Condition_FailingPeriods_STATUSGenerator() +var condition_FailingPeriods_STATUSGenerator gopter.Gen + +// Condition_FailingPeriods_STATUSGenerator returns a generator of Condition_FailingPeriods_STATUS instances for property testing. +func Condition_FailingPeriods_STATUSGenerator() gopter.Gen { + if condition_FailingPeriods_STATUSGenerator != nil { + return condition_FailingPeriods_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS(generators) + condition_FailingPeriods_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_FailingPeriods_STATUS{}), generators) + + return condition_FailingPeriods_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS(gens map[string]gopter.Gen) { + gens["MinFailingPeriodsToAlert"] = gen.PtrOf(gen.Int()) + gens["NumberOfEvaluationPeriods"] = gen.PtrOf(gen.Int()) +} + +func Test_Condition_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition_STATUS to Condition_STATUS via AssignProperties_To_Condition_STATUS & AssignProperties_From_Condition_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition_STATUS, Condition_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition_STATUS tests if a specific instance of Condition_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition_STATUS(subject Condition_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Condition_STATUS + err := copied.AssignProperties_To_Condition_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition_STATUS + err = actual.AssignProperties_From_Condition_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_STATUS, Condition_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_STATUS runs a test to see if a specific instance of Condition_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_STATUS(subject Condition_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_STATUS instances for property testing - lazily instantiated by Condition_STATUSGenerator() +var condition_STATUSGenerator gopter.Gen + +// Condition_STATUSGenerator returns a generator of Condition_STATUS instances for property testing. +// We first initialize condition_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Condition_STATUSGenerator() gopter.Gen { + if condition_STATUSGenerator != nil { + return condition_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_STATUS(generators) + condition_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_STATUS(generators) + AddRelatedPropertyGeneratorsForCondition_STATUS(generators) + condition_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_STATUS{}), generators) + + return condition_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_STATUS(gens map[string]gopter.Gen) { + gens["AlertSensitivity"] = gen.PtrOf(gen.AlphaString()) + gens["CriterionType"] = gen.PtrOf(gen.OneConstOf(Condition_CriterionType_STATUS_DynamicThresholdCriterion, Condition_CriterionType_STATUS_StaticThresholdCriterion)) + gens["IgnoreDataBefore"] = gen.PtrOf(gen.AlphaString()) + gens["MetricMeasureColumn"] = gen.PtrOf(gen.AlphaString()) + gens["MetricName"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf( + Condition_Operator_STATUS_Equals, + Condition_Operator_STATUS_GreaterOrLessThan, + Condition_Operator_STATUS_GreaterThan, + Condition_Operator_STATUS_GreaterThanOrEqual, + Condition_Operator_STATUS_LessThan, + Condition_Operator_STATUS_LessThanOrEqual)) + gens["Query"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceIdColumn"] = gen.PtrOf(gen.AlphaString()) + gens["Threshold"] = gen.PtrOf(gen.Float64()) + gens["TimeAggregation"] = gen.PtrOf(gen.OneConstOf( + Condition_TimeAggregation_STATUS_Average, + Condition_TimeAggregation_STATUS_Count, + Condition_TimeAggregation_STATUS_Maximum, + Condition_TimeAggregation_STATUS_Minimum, + Condition_TimeAggregation_STATUS_Total)) +} + +// AddRelatedPropertyGeneratorsForCondition_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCondition_STATUS(gens map[string]gopter.Gen) { + gens["Dimensions"] = gen.SliceOf(Dimension_STATUSGenerator()) + gens["FailingPeriods"] = gen.PtrOf(Condition_FailingPeriods_STATUSGenerator()) +} + +func Test_Dimension_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Dimension to Dimension via AssignProperties_To_Dimension & AssignProperties_From_Dimension returns original", + prop.ForAll(RunPropertyAssignmentTestForDimension, DimensionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDimension tests if a specific instance of Dimension can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDimension(subject Dimension) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Dimension + err := copied.AssignProperties_To_Dimension(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Dimension + err = actual.AssignProperties_From_Dimension(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Dimension_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Dimension via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDimension, DimensionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDimension runs a test to see if a specific instance of Dimension round trips to JSON and back losslessly +func RunJSONSerializationTestForDimension(subject Dimension) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Dimension + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Dimension instances for property testing - lazily instantiated by DimensionGenerator() +var dimensionGenerator gopter.Gen + +// DimensionGenerator returns a generator of Dimension instances for property testing. +func DimensionGenerator() gopter.Gen { + if dimensionGenerator != nil { + return dimensionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDimension(generators) + dimensionGenerator = gen.Struct(reflect.TypeOf(Dimension{}), generators) + + return dimensionGenerator +} + +// AddIndependentPropertyGeneratorsForDimension is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDimension(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf(Dimension_Operator_Exclude, Dimension_Operator_Include)) + gens["Values"] = gen.SliceOf(gen.AlphaString()) +} + +func Test_Dimension_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Dimension_STATUS to Dimension_STATUS via AssignProperties_To_Dimension_STATUS & AssignProperties_From_Dimension_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForDimension_STATUS, Dimension_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDimension_STATUS tests if a specific instance of Dimension_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDimension_STATUS(subject Dimension_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Dimension_STATUS + err := copied.AssignProperties_To_Dimension_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Dimension_STATUS + err = actual.AssignProperties_From_Dimension_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Dimension_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Dimension_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDimension_STATUS, Dimension_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDimension_STATUS runs a test to see if a specific instance of Dimension_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForDimension_STATUS(subject Dimension_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Dimension_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Dimension_STATUS instances for property testing - lazily instantiated by Dimension_STATUSGenerator() +var dimension_STATUSGenerator gopter.Gen + +// Dimension_STATUSGenerator returns a generator of Dimension_STATUS instances for property testing. +func Dimension_STATUSGenerator() gopter.Gen { + if dimension_STATUSGenerator != nil { + return dimension_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDimension_STATUS(generators) + dimension_STATUSGenerator = gen.Struct(reflect.TypeOf(Dimension_STATUS{}), generators) + + return dimension_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForDimension_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDimension_STATUS(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.OneConstOf(Dimension_Operator_STATUS_Exclude, Dimension_Operator_STATUS_Include)) + gens["Values"] = gen.SliceOf(gen.AlphaString()) +} + +func Test_Identity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity to Identity via AssignProperties_To_Identity & AssignProperties_From_Identity returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity tests if a specific instance of Identity can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity(subject Identity) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Identity + err := copied.AssignProperties_To_Identity(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity + err = actual.AssignProperties_From_Identity(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity(subject Identity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() +var identityGenerator gopter.Gen + +// IdentityGenerator returns a generator of Identity instances for property testing. +// We first initialize identityGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + AddRelatedPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + return identityGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf(Identity_Type_None, Identity_Type_SystemAssigned, Identity_Type_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) +} + +func Test_Identity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity_STATUS to Identity_STATUS via AssignProperties_To_Identity_STATUS & AssignProperties_From_Identity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity_STATUS tests if a specific instance of Identity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.Identity_STATUS + err := copied.AssignProperties_To_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity_STATUS + err = actual.AssignProperties_From_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() +var identity_STATUSGenerator gopter.Gen + +// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. +// We first initialize identity_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_STATUSGenerator() gopter.Gen { + if identity_STATUSGenerator != nil { + return identity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + return identity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.OneConstOf(Identity_Type_STATUS_None, Identity_Type_STATUS_SystemAssigned, Identity_Type_STATUS_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf( + gen.AlphaString(), + UserIdentityProperties_STATUSGenerator()) +} + +func Test_RuleResolveConfiguration_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from RuleResolveConfiguration to RuleResolveConfiguration via AssignProperties_To_RuleResolveConfiguration & AssignProperties_From_RuleResolveConfiguration returns original", + prop.ForAll(RunPropertyAssignmentTestForRuleResolveConfiguration, RuleResolveConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForRuleResolveConfiguration tests if a specific instance of RuleResolveConfiguration can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForRuleResolveConfiguration(subject RuleResolveConfiguration) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.RuleResolveConfiguration + err := copied.AssignProperties_To_RuleResolveConfiguration(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual RuleResolveConfiguration + err = actual.AssignProperties_From_RuleResolveConfiguration(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_RuleResolveConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RuleResolveConfiguration via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleResolveConfiguration, RuleResolveConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleResolveConfiguration runs a test to see if a specific instance of RuleResolveConfiguration round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleResolveConfiguration(subject RuleResolveConfiguration) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RuleResolveConfiguration + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RuleResolveConfiguration instances for property testing - lazily instantiated by +// RuleResolveConfigurationGenerator() +var ruleResolveConfigurationGenerator gopter.Gen + +// RuleResolveConfigurationGenerator returns a generator of RuleResolveConfiguration instances for property testing. +func RuleResolveConfigurationGenerator() gopter.Gen { + if ruleResolveConfigurationGenerator != nil { + return ruleResolveConfigurationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleResolveConfiguration(generators) + ruleResolveConfigurationGenerator = gen.Struct(reflect.TypeOf(RuleResolveConfiguration{}), generators) + + return ruleResolveConfigurationGenerator +} + +// AddIndependentPropertyGeneratorsForRuleResolveConfiguration is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleResolveConfiguration(gens map[string]gopter.Gen) { + gens["AutoResolved"] = gen.PtrOf(gen.Bool()) + gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_RuleResolveConfiguration_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from RuleResolveConfiguration_STATUS to RuleResolveConfiguration_STATUS via AssignProperties_To_RuleResolveConfiguration_STATUS & AssignProperties_From_RuleResolveConfiguration_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForRuleResolveConfiguration_STATUS, RuleResolveConfiguration_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForRuleResolveConfiguration_STATUS tests if a specific instance of RuleResolveConfiguration_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForRuleResolveConfiguration_STATUS(subject RuleResolveConfiguration_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.RuleResolveConfiguration_STATUS + err := copied.AssignProperties_To_RuleResolveConfiguration_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual RuleResolveConfiguration_STATUS + err = actual.AssignProperties_From_RuleResolveConfiguration_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_RuleResolveConfiguration_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RuleResolveConfiguration_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleResolveConfiguration_STATUS, RuleResolveConfiguration_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleResolveConfiguration_STATUS runs a test to see if a specific instance of RuleResolveConfiguration_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleResolveConfiguration_STATUS(subject RuleResolveConfiguration_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RuleResolveConfiguration_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RuleResolveConfiguration_STATUS instances for property testing - lazily instantiated by +// RuleResolveConfiguration_STATUSGenerator() +var ruleResolveConfiguration_STATUSGenerator gopter.Gen + +// RuleResolveConfiguration_STATUSGenerator returns a generator of RuleResolveConfiguration_STATUS instances for property testing. +func RuleResolveConfiguration_STATUSGenerator() gopter.Gen { + if ruleResolveConfiguration_STATUSGenerator != nil { + return ruleResolveConfiguration_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS(generators) + ruleResolveConfiguration_STATUSGenerator = gen.Struct(reflect.TypeOf(RuleResolveConfiguration_STATUS{}), generators) + + return ruleResolveConfiguration_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS(gens map[string]gopter.Gen) { + gens["AutoResolved"] = gen.PtrOf(gen.Bool()) + gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScheduledQueryRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule to hub returns original", + prop.ForAll(RunResourceConversionTestForScheduledQueryRule, ScheduledQueryRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForScheduledQueryRule tests if a specific instance of ScheduledQueryRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForScheduledQueryRule(subject ScheduledQueryRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20220615s.ScheduledQueryRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual ScheduledQueryRule + err = actual.ConvertFrom(&hub) + if err != nil { + return err.Error() + } + + // Compare actual with what we started with + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule to ScheduledQueryRule via AssignProperties_To_ScheduledQueryRule & AssignProperties_From_ScheduledQueryRule returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRule, ScheduledQueryRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRule tests if a specific instance of ScheduledQueryRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRule(subject ScheduledQueryRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.ScheduledQueryRule + err := copied.AssignProperties_To_ScheduledQueryRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRule + err = actual.AssignProperties_From_ScheduledQueryRule(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule, ScheduledQueryRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule runs a test to see if a specific instance of ScheduledQueryRule round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule(subject ScheduledQueryRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule instances for property testing - lazily instantiated by ScheduledQueryRuleGenerator() +var scheduledQueryRuleGenerator gopter.Gen + +// ScheduledQueryRuleGenerator returns a generator of ScheduledQueryRule instances for property testing. +func ScheduledQueryRuleGenerator() gopter.Gen { + if scheduledQueryRuleGenerator != nil { + return scheduledQueryRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRule(generators) + scheduledQueryRuleGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule{}), generators) + + return scheduledQueryRuleGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule(gens map[string]gopter.Gen) { + gens["Spec"] = ScheduledQueryRule_SpecGenerator() + gens["Status"] = ScheduledQueryRule_STATUSGenerator() +} + +func Test_ScheduledQueryRuleCriteria_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRuleCriteria to ScheduledQueryRuleCriteria via AssignProperties_To_ScheduledQueryRuleCriteria & AssignProperties_From_ScheduledQueryRuleCriteria returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRuleCriteria, ScheduledQueryRuleCriteriaGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRuleCriteria tests if a specific instance of ScheduledQueryRuleCriteria can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRuleCriteria(subject ScheduledQueryRuleCriteria) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.ScheduledQueryRuleCriteria + err := copied.AssignProperties_To_ScheduledQueryRuleCriteria(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRuleCriteria + err = actual.AssignProperties_From_ScheduledQueryRuleCriteria(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRuleCriteria_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleCriteria via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleCriteria, ScheduledQueryRuleCriteriaGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleCriteria runs a test to see if a specific instance of ScheduledQueryRuleCriteria round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleCriteria(subject ScheduledQueryRuleCriteria) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleCriteria + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleCriteria instances for property testing - lazily instantiated by +// ScheduledQueryRuleCriteriaGenerator() +var scheduledQueryRuleCriteriaGenerator gopter.Gen + +// ScheduledQueryRuleCriteriaGenerator returns a generator of ScheduledQueryRuleCriteria instances for property testing. +func ScheduledQueryRuleCriteriaGenerator() gopter.Gen { + if scheduledQueryRuleCriteriaGenerator != nil { + return scheduledQueryRuleCriteriaGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria(generators) + scheduledQueryRuleCriteriaGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleCriteria{}), generators) + + return scheduledQueryRuleCriteriaGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria(gens map[string]gopter.Gen) { + gens["AllOf"] = gen.SliceOf(ConditionGenerator()) +} + +func Test_ScheduledQueryRuleCriteria_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRuleCriteria_STATUS to ScheduledQueryRuleCriteria_STATUS via AssignProperties_To_ScheduledQueryRuleCriteria_STATUS & AssignProperties_From_ScheduledQueryRuleCriteria_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRuleCriteria_STATUS, ScheduledQueryRuleCriteria_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRuleCriteria_STATUS tests if a specific instance of ScheduledQueryRuleCriteria_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRuleCriteria_STATUS(subject ScheduledQueryRuleCriteria_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.ScheduledQueryRuleCriteria_STATUS + err := copied.AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRuleCriteria_STATUS + err = actual.AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRuleCriteria_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleCriteria_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS, ScheduledQueryRuleCriteria_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS runs a test to see if a specific instance of ScheduledQueryRuleCriteria_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS(subject ScheduledQueryRuleCriteria_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleCriteria_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleCriteria_STATUS instances for property testing - lazily instantiated by +// ScheduledQueryRuleCriteria_STATUSGenerator() +var scheduledQueryRuleCriteria_STATUSGenerator gopter.Gen + +// ScheduledQueryRuleCriteria_STATUSGenerator returns a generator of ScheduledQueryRuleCriteria_STATUS instances for property testing. +func ScheduledQueryRuleCriteria_STATUSGenerator() gopter.Gen { + if scheduledQueryRuleCriteria_STATUSGenerator != nil { + return scheduledQueryRuleCriteria_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS(generators) + scheduledQueryRuleCriteria_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleCriteria_STATUS{}), generators) + + return scheduledQueryRuleCriteria_STATUSGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS(gens map[string]gopter.Gen) { + gens["AllOf"] = gen.SliceOf(Condition_STATUSGenerator()) +} + +func Test_ScheduledQueryRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRuleOperatorSpec to ScheduledQueryRuleOperatorSpec via AssignProperties_To_ScheduledQueryRuleOperatorSpec & AssignProperties_From_ScheduledQueryRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRuleOperatorSpec, ScheduledQueryRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRuleOperatorSpec tests if a specific instance of ScheduledQueryRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRuleOperatorSpec(subject ScheduledQueryRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.ScheduledQueryRuleOperatorSpec + err := copied.AssignProperties_To_ScheduledQueryRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRuleOperatorSpec + err = actual.AssignProperties_From_ScheduledQueryRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleOperatorSpec, ScheduledQueryRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleOperatorSpec runs a test to see if a specific instance of ScheduledQueryRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleOperatorSpec(subject ScheduledQueryRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleOperatorSpec instances for property testing - lazily instantiated by +// ScheduledQueryRuleOperatorSpecGenerator() +var scheduledQueryRuleOperatorSpecGenerator gopter.Gen + +// ScheduledQueryRuleOperatorSpecGenerator returns a generator of ScheduledQueryRuleOperatorSpec instances for property testing. +func ScheduledQueryRuleOperatorSpecGenerator() gopter.Gen { + if scheduledQueryRuleOperatorSpecGenerator != nil { + return scheduledQueryRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + scheduledQueryRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleOperatorSpec{}), generators) + + return scheduledQueryRuleOperatorSpecGenerator +} + +func Test_ScheduledQueryRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule_STATUS to ScheduledQueryRule_STATUS via AssignProperties_To_ScheduledQueryRule_STATUS & AssignProperties_From_ScheduledQueryRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRule_STATUS, ScheduledQueryRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRule_STATUS tests if a specific instance of ScheduledQueryRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRule_STATUS(subject ScheduledQueryRule_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.ScheduledQueryRule_STATUS + err := copied.AssignProperties_To_ScheduledQueryRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRule_STATUS + err = actual.AssignProperties_From_ScheduledQueryRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule_STATUS, ScheduledQueryRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule_STATUS runs a test to see if a specific instance of ScheduledQueryRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule_STATUS(subject ScheduledQueryRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule_STATUS instances for property testing - lazily instantiated by +// ScheduledQueryRule_STATUSGenerator() +var scheduledQueryRule_STATUSGenerator gopter.Gen + +// ScheduledQueryRule_STATUSGenerator returns a generator of ScheduledQueryRule_STATUS instances for property testing. +// We first initialize scheduledQueryRule_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRule_STATUSGenerator() gopter.Gen { + if scheduledQueryRule_STATUSGenerator != nil { + return scheduledQueryRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + scheduledQueryRule_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + scheduledQueryRule_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_STATUS{}), generators) + + return scheduledQueryRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(gens map[string]gopter.Gen) { + gens["AutoMitigate"] = gen.PtrOf(gen.Bool()) + gens["CheckWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["CreatedWithApiVersion"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["EvaluationFrequency"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsLegacyLogAnalyticsRule"] = gen.PtrOf(gen.Bool()) + gens["IsWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["Kind"] = gen.PtrOf(gen.OneConstOf(ScheduledQueryRule_Kind_STATUS_EventLogAlert, ScheduledQueryRule_Kind_STATUS_LogAlert, ScheduledQueryRule_Kind_STATUS_LogToMetric)) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MuteActionsDuration"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["OverrideQueryTimeRange"] = gen.PtrOf(gen.AlphaString()) + gens["Scopes"] = gen.SliceOf(gen.AlphaString()) + gens["Severity"] = gen.PtrOf(gen.OneConstOf( + ScheduledQueryRuleProperties_Severity_STATUS_0, + ScheduledQueryRuleProperties_Severity_STATUS_1, + ScheduledQueryRuleProperties_Severity_STATUS_2, + ScheduledQueryRuleProperties_Severity_STATUS_3, + ScheduledQueryRuleProperties_Severity_STATUS_4)) + gens["SkipQueryValidation"] = gen.PtrOf(gen.Bool()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["TargetResourceTypes"] = gen.SliceOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["WindowSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS(gens map[string]gopter.Gen) { + gens["Actions"] = gen.PtrOf(Actions_STATUSGenerator()) + gens["Criteria"] = gen.PtrOf(ScheduledQueryRuleCriteria_STATUSGenerator()) + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["ResolveConfiguration"] = gen.PtrOf(RuleResolveConfiguration_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_ScheduledQueryRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule_Spec to ScheduledQueryRule_Spec via AssignProperties_To_ScheduledQueryRule_Spec & AssignProperties_From_ScheduledQueryRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRule_Spec, ScheduledQueryRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRule_Spec tests if a specific instance of ScheduledQueryRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRule_Spec(subject ScheduledQueryRule_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.ScheduledQueryRule_Spec + err := copied.AssignProperties_To_ScheduledQueryRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRule_Spec + err = actual.AssignProperties_From_ScheduledQueryRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule_Spec, ScheduledQueryRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule_Spec runs a test to see if a specific instance of ScheduledQueryRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule_Spec(subject ScheduledQueryRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule_Spec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule_Spec instances for property testing - lazily instantiated by +// ScheduledQueryRule_SpecGenerator() +var scheduledQueryRule_SpecGenerator gopter.Gen + +// ScheduledQueryRule_SpecGenerator returns a generator of ScheduledQueryRule_Spec instances for property testing. +// We first initialize scheduledQueryRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRule_SpecGenerator() gopter.Gen { + if scheduledQueryRule_SpecGenerator != nil { + return scheduledQueryRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(generators) + scheduledQueryRule_SpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec(generators) + scheduledQueryRule_SpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_Spec{}), generators) + + return scheduledQueryRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(gens map[string]gopter.Gen) { + gens["AutoMitigate"] = gen.PtrOf(gen.Bool()) + gens["AzureName"] = gen.AlphaString() + gens["CheckWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["EvaluationFrequency"] = gen.PtrOf(gen.AlphaString()) + gens["Kind"] = gen.PtrOf(gen.OneConstOf(ScheduledQueryRule_Kind_Spec_EventLogAlert, ScheduledQueryRule_Kind_Spec_LogAlert, ScheduledQueryRule_Kind_Spec_LogToMetric)) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MuteActionsDuration"] = gen.PtrOf(gen.AlphaString()) + gens["OverrideQueryTimeRange"] = gen.PtrOf(gen.AlphaString()) + gens["Severity"] = gen.PtrOf(gen.OneConstOf( + ScheduledQueryRuleProperties_Severity_0, + ScheduledQueryRuleProperties_Severity_1, + ScheduledQueryRuleProperties_Severity_2, + ScheduledQueryRuleProperties_Severity_3, + ScheduledQueryRuleProperties_Severity_4)) + gens["SkipQueryValidation"] = gen.PtrOf(gen.Bool()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["TargetResourceTypes"] = gen.SliceOf(gen.AlphaString()) + gens["WindowSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec(gens map[string]gopter.Gen) { + gens["Actions"] = gen.PtrOf(ActionsGenerator()) + gens["Criteria"] = gen.PtrOf(ScheduledQueryRuleCriteriaGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(ScheduledQueryRuleOperatorSpecGenerator()) + gens["ResolveConfiguration"] = gen.PtrOf(RuleResolveConfigurationGenerator()) +} + +func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.SystemData_STATUS + err := copied.AssignProperties_To_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_STATUS + err = actual.AssignProperties_From_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() +var systemData_STATUSGenerator gopter.Gen + +// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. +func SystemData_STATUSGenerator() gopter.Gen { + if systemData_STATUSGenerator != nil { + return systemData_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) + systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) + + return systemData_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_CreatedByType_STATUS_Application, + SystemData_CreatedByType_STATUS_Key, + SystemData_CreatedByType_STATUS_ManagedIdentity, + SystemData_CreatedByType_STATUS_User)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_LastModifiedByType_STATUS_Application, + SystemData_LastModifiedByType_STATUS_Key, + SystemData_LastModifiedByType_STATUS_ManagedIdentity, + SystemData_LastModifiedByType_STATUS_User)) +} + +func Test_UserAssignedIdentityDetails_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityDetails to UserAssignedIdentityDetails via AssignProperties_To_UserAssignedIdentityDetails & AssignProperties_From_UserAssignedIdentityDetails returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityDetails tests if a specific instance of UserAssignedIdentityDetails can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.UserAssignedIdentityDetails + err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityDetails + err = actual.AssignProperties_From_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityDetails via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityDetails + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by +// UserAssignedIdentityDetailsGenerator() +var userAssignedIdentityDetailsGenerator gopter.Gen + +// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. +func UserAssignedIdentityDetailsGenerator() gopter.Gen { + if userAssignedIdentityDetailsGenerator != nil { + return userAssignedIdentityDetailsGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) + + return userAssignedIdentityDetailsGenerator +} + +func Test_UserIdentityProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserIdentityProperties_STATUS to UserIdentityProperties_STATUS via AssignProperties_To_UserIdentityProperties_STATUS & AssignProperties_From_UserIdentityProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserIdentityProperties_STATUS, UserIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserIdentityProperties_STATUS tests if a specific instance of UserIdentityProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserIdentityProperties_STATUS(subject UserIdentityProperties_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101ps.UserIdentityProperties_STATUS + err := copied.AssignProperties_To_UserIdentityProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserIdentityProperties_STATUS + err = actual.AssignProperties_From_UserIdentityProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserIdentityProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserIdentityProperties_STATUS, UserIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserIdentityProperties_STATUS runs a test to see if a specific instance of UserIdentityProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForUserIdentityProperties_STATUS(subject UserIdentityProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserIdentityProperties_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserIdentityProperties_STATUS instances for property testing - lazily instantiated by +// UserIdentityProperties_STATUSGenerator() +var userIdentityProperties_STATUSGenerator gopter.Gen + +// UserIdentityProperties_STATUSGenerator returns a generator of UserIdentityProperties_STATUS instances for property testing. +func UserIdentityProperties_STATUSGenerator() gopter.Gen { + if userIdentityProperties_STATUSGenerator != nil { + return userIdentityProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS(generators) + userIdentityProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(UserIdentityProperties_STATUS{}), generators) + + return userIdentityProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/insights/v1api20240101preview/storage/groupversion_info_gen.go b/v2/api/insights/v1api20240101preview/storage/groupversion_info_gen.go new file mode 100644 index 00000000000..cd24e1d39db --- /dev/null +++ b/v2/api/insights/v1api20240101preview/storage/groupversion_info_gen.go @@ -0,0 +1,32 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package storage contains API Schema definitions for the insights storage API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=insights.azure.com +// +versionName=v1api20240101previewstorage +package storage + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "insights.azure.com", Version: "v1api20240101previewstorage"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder +) diff --git a/v2/api/insights/v1api20240101preview/storage/scheduled_query_rule_types_gen.go b/v2/api/insights/v1api20240101preview/storage/scheduled_query_rule_types_gen.go new file mode 100644 index 00000000000..76f2d7f8c22 --- /dev/null +++ b/v2/api/insights/v1api20240101preview/storage/scheduled_query_rule_types_gen.go @@ -0,0 +1,2683 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "fmt" + v20220615s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615/storage" + v20221001s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20221001/storage" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Storage version of v1api20240101preview.ScheduledQueryRule +// Generator information: +// - Generated from: /monitor/resource-manager/Microsoft.Insights/preview/2024-01-01-preview/scheduledQueryRule_API.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName} +type ScheduledQueryRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ScheduledQueryRule_Spec `json:"spec,omitempty"` + Status ScheduledQueryRule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &ScheduledQueryRule{} + +// GetConditions returns the conditions of the resource +func (rule *ScheduledQueryRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *ScheduledQueryRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ conversion.Convertible = &ScheduledQueryRule{} + +// ConvertFrom populates our ScheduledQueryRule from the provided hub ScheduledQueryRule +func (rule *ScheduledQueryRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20220615s.ScheduledQueryRule) + if !ok { + return fmt.Errorf("expected insights/v1api20220615/storage/ScheduledQueryRule but received %T instead", hub) + } + + return rule.AssignProperties_From_ScheduledQueryRule(source) +} + +// ConvertTo populates the provided hub ScheduledQueryRule from our ScheduledQueryRule +func (rule *ScheduledQueryRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20220615s.ScheduledQueryRule) + if !ok { + return fmt.Errorf("expected insights/v1api20220615/storage/ScheduledQueryRule but received %T instead", hub) + } + + return rule.AssignProperties_To_ScheduledQueryRule(destination) +} + +var _ configmaps.Exporter = &ScheduledQueryRule{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (rule *ScheduledQueryRule) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &ScheduledQueryRule{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (rule *ScheduledQueryRule) SecretDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.SecretExpressions +} + +var _ genruntime.KubernetesResource = &ScheduledQueryRule{} + +// AzureName returns the Azure name of the resource +func (rule *ScheduledQueryRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01-preview" +func (rule ScheduledQueryRule) GetAPIVersion() string { + return "2024-01-01-preview" +} + +// GetResourceScope returns the scope of the resource +func (rule *ScheduledQueryRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *ScheduledQueryRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *ScheduledQueryRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *ScheduledQueryRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.Insights/scheduledQueryRules" +func (rule *ScheduledQueryRule) GetType() string { + return "Microsoft.Insights/scheduledQueryRules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *ScheduledQueryRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &ScheduledQueryRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *ScheduledQueryRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *ScheduledQueryRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*ScheduledQueryRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st ScheduledQueryRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// AssignProperties_From_ScheduledQueryRule populates our ScheduledQueryRule from the provided source ScheduledQueryRule +func (rule *ScheduledQueryRule) AssignProperties_From_ScheduledQueryRule(source *v20220615s.ScheduledQueryRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec ScheduledQueryRule_Spec + err := spec.AssignProperties_From_ScheduledQueryRule_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status ScheduledQueryRule_STATUS + err = status.AssignProperties_From_ScheduledQueryRule_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRule_STATUS() to populate field Status") + } + rule.Status = status + + // Invoke the augmentConversionForScheduledQueryRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForScheduledQueryRule); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRule populates the provided destination ScheduledQueryRule from our ScheduledQueryRule +func (rule *ScheduledQueryRule) AssignProperties_To_ScheduledQueryRule(destination *v20220615s.ScheduledQueryRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20220615s.ScheduledQueryRule_Spec + err := rule.Spec.AssignProperties_To_ScheduledQueryRule_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20220615s.ScheduledQueryRule_STATUS + err = rule.Status.AssignProperties_To_ScheduledQueryRule_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRule_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForScheduledQueryRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForScheduledQueryRule); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *ScheduledQueryRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion, + Kind: "ScheduledQueryRule", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101preview.ScheduledQueryRule +// Generator information: +// - Generated from: /monitor/resource-manager/Microsoft.Insights/preview/2024-01-01-preview/scheduledQueryRule_API.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName} +type ScheduledQueryRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ScheduledQueryRule `json:"items"` +} + +// Storage version of v1api20240101preview.APIVersion +// +kubebuilder:validation:Enum={"2024-01-01-preview"} +type APIVersion string + +const APIVersion_Value = APIVersion("2024-01-01-preview") + +type augmentConversionForScheduledQueryRule interface { + AssignPropertiesFrom(src *v20220615s.ScheduledQueryRule) error + AssignPropertiesTo(dst *v20220615s.ScheduledQueryRule) error +} + +// Storage version of v1api20240101preview.ScheduledQueryRule_Spec +type ScheduledQueryRule_Spec struct { + Actions *Actions `json:"actions,omitempty"` + AutoMitigate *bool `json:"autoMitigate,omitempty"` + + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + CheckWorkspaceAlertsStorageConfigured *bool `json:"checkWorkspaceAlertsStorageConfigured,omitempty"` + Criteria *ScheduledQueryRuleCriteria `json:"criteria,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` + Identity *Identity `json:"identity,omitempty"` + Kind *string `json:"kind,omitempty"` + Location *string `json:"location,omitempty"` + MuteActionsDuration *string `json:"muteActionsDuration,omitempty"` + OperatorSpec *ScheduledQueryRuleOperatorSpec `json:"operatorSpec,omitempty"` + OriginalVersion string `json:"originalVersion,omitempty"` + OverrideQueryTimeRange *string `json:"overrideQueryTimeRange,omitempty"` + + // +kubebuilder:validation:Required + // Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also + // controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a + // reference to a resources.azure.com/ResourceGroup resource + Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ResolveConfiguration *RuleResolveConfiguration `json:"resolveConfiguration,omitempty"` + ScopesReferences []genruntime.ResourceReference `armReference:"Scopes" json:"scopesReferences,omitempty"` + Severity *int `json:"severity,omitempty"` + SkipQueryValidation *bool `json:"skipQueryValidation,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + TargetResourceTypes []string `json:"targetResourceTypes,omitempty"` + WindowSize *string `json:"windowSize,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &ScheduledQueryRule_Spec{} + +// ConvertSpecFrom populates our ScheduledQueryRule_Spec from the provided source +func (rule *ScheduledQueryRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20220615s.ScheduledQueryRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_ScheduledQueryRule_Spec(src) + } + + // Convert to an intermediate form + src = &v20220615s.ScheduledQueryRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_ScheduledQueryRule_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our ScheduledQueryRule_Spec +func (rule *ScheduledQueryRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20220615s.ScheduledQueryRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_ScheduledQueryRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20220615s.ScheduledQueryRule_Spec{} + err := rule.AssignProperties_To_ScheduledQueryRule_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_ScheduledQueryRule_Spec populates our ScheduledQueryRule_Spec from the provided source ScheduledQueryRule_Spec +func (rule *ScheduledQueryRule_Spec) AssignProperties_From_ScheduledQueryRule_Spec(source *v20220615s.ScheduledQueryRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Actions + if source.Actions != nil { + var action Actions + err := action.AssignProperties_From_Actions(source.Actions) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Actions() to populate field Actions") + } + rule.Actions = &action + } else { + rule.Actions = nil + } + + // AutoMitigate + if source.AutoMitigate != nil { + autoMitigate := *source.AutoMitigate + rule.AutoMitigate = &autoMitigate + } else { + rule.AutoMitigate = nil + } + + // AzureName + rule.AzureName = source.AzureName + + // CheckWorkspaceAlertsStorageConfigured + if source.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *source.CheckWorkspaceAlertsStorageConfigured + rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + rule.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Criteria + if source.Criteria != nil { + var criterion ScheduledQueryRuleCriteria + err := criterion.AssignProperties_From_ScheduledQueryRuleCriteria(source.Criteria) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleCriteria() to populate field Criteria") + } + rule.Criteria = &criterion + } else { + rule.Criteria = nil + } + + // Description + rule.Description = genruntime.ClonePointerToString(source.Description) + + // DisplayName + rule.DisplayName = genruntime.ClonePointerToString(source.DisplayName) + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + rule.Enabled = &enabled + } else { + rule.Enabled = nil + } + + // EvaluationFrequency + rule.EvaluationFrequency = genruntime.ClonePointerToString(source.EvaluationFrequency) + + // Identity + if propertyBag.Contains("Identity") { + var identity Identity + err := propertyBag.Pull("Identity", &identity) + if err != nil { + return eris.Wrap(err, "pulling 'Identity' from propertyBag") + } + + rule.Identity = &identity + } else { + rule.Identity = nil + } + + // Kind + rule.Kind = genruntime.ClonePointerToString(source.Kind) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // MuteActionsDuration + rule.MuteActionsDuration = genruntime.ClonePointerToString(source.MuteActionsDuration) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec ScheduledQueryRuleOperatorSpec + err := operatorSpec.AssignProperties_From_ScheduledQueryRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + + // OriginalVersion + rule.OriginalVersion = source.OriginalVersion + + // OverrideQueryTimeRange + rule.OverrideQueryTimeRange = genruntime.ClonePointerToString(source.OverrideQueryTimeRange) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // ResolveConfiguration + if propertyBag.Contains("ResolveConfiguration") { + var resolveConfiguration RuleResolveConfiguration + err := propertyBag.Pull("ResolveConfiguration", &resolveConfiguration) + if err != nil { + return eris.Wrap(err, "pulling 'ResolveConfiguration' from propertyBag") + } + + rule.ResolveConfiguration = &resolveConfiguration + } else { + rule.ResolveConfiguration = nil + } + + // ScopesReferences + if source.ScopesReferences != nil { + scopesReferenceList := make([]genruntime.ResourceReference, len(source.ScopesReferences)) + for scopesReferenceIndex, scopesReferenceItem := range source.ScopesReferences { + // Shadow the loop variable to avoid aliasing + scopesReferenceItem := scopesReferenceItem + scopesReferenceList[scopesReferenceIndex] = scopesReferenceItem.Copy() + } + rule.ScopesReferences = scopesReferenceList + } else { + rule.ScopesReferences = nil + } + + // Severity + rule.Severity = genruntime.ClonePointerToInt(source.Severity) + + // SkipQueryValidation + if source.SkipQueryValidation != nil { + skipQueryValidation := *source.SkipQueryValidation + rule.SkipQueryValidation = &skipQueryValidation + } else { + rule.SkipQueryValidation = nil + } + + // Tags + rule.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // TargetResourceTypes + rule.TargetResourceTypes = genruntime.CloneSliceOfString(source.TargetResourceTypes) + + // WindowSize + rule.WindowSize = genruntime.ClonePointerToString(source.WindowSize) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForScheduledQueryRule_Spec); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRule_Spec populates the provided destination ScheduledQueryRule_Spec from our ScheduledQueryRule_Spec +func (rule *ScheduledQueryRule_Spec) AssignProperties_To_ScheduledQueryRule_Spec(destination *v20220615s.ScheduledQueryRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Actions + if rule.Actions != nil { + var action v20220615s.Actions + err := rule.Actions.AssignProperties_To_Actions(&action) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Actions() to populate field Actions") + } + destination.Actions = &action + } else { + destination.Actions = nil + } + + // AutoMitigate + if rule.AutoMitigate != nil { + autoMitigate := *rule.AutoMitigate + destination.AutoMitigate = &autoMitigate + } else { + destination.AutoMitigate = nil + } + + // AzureName + destination.AzureName = rule.AzureName + + // CheckWorkspaceAlertsStorageConfigured + if rule.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *rule.CheckWorkspaceAlertsStorageConfigured + destination.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + destination.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Criteria + if rule.Criteria != nil { + var criterion v20220615s.ScheduledQueryRuleCriteria + err := rule.Criteria.AssignProperties_To_ScheduledQueryRuleCriteria(&criterion) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleCriteria() to populate field Criteria") + } + destination.Criteria = &criterion + } else { + destination.Criteria = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(rule.Description) + + // DisplayName + destination.DisplayName = genruntime.ClonePointerToString(rule.DisplayName) + + // Enabled + if rule.Enabled != nil { + enabled := *rule.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // EvaluationFrequency + destination.EvaluationFrequency = genruntime.ClonePointerToString(rule.EvaluationFrequency) + + // Identity + if rule.Identity != nil { + propertyBag.Add("Identity", *rule.Identity) + } else { + propertyBag.Remove("Identity") + } + + // Kind + destination.Kind = genruntime.ClonePointerToString(rule.Kind) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // MuteActionsDuration + destination.MuteActionsDuration = genruntime.ClonePointerToString(rule.MuteActionsDuration) + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20220615s.ScheduledQueryRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_ScheduledQueryRuleOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion + + // OverrideQueryTimeRange + destination.OverrideQueryTimeRange = genruntime.ClonePointerToString(rule.OverrideQueryTimeRange) + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // ResolveConfiguration + if rule.ResolveConfiguration != nil { + propertyBag.Add("ResolveConfiguration", *rule.ResolveConfiguration) + } else { + propertyBag.Remove("ResolveConfiguration") + } + + // ScopesReferences + if rule.ScopesReferences != nil { + scopesReferenceList := make([]genruntime.ResourceReference, len(rule.ScopesReferences)) + for scopesReferenceIndex, scopesReferenceItem := range rule.ScopesReferences { + // Shadow the loop variable to avoid aliasing + scopesReferenceItem := scopesReferenceItem + scopesReferenceList[scopesReferenceIndex] = scopesReferenceItem.Copy() + } + destination.ScopesReferences = scopesReferenceList + } else { + destination.ScopesReferences = nil + } + + // Severity + destination.Severity = genruntime.ClonePointerToInt(rule.Severity) + + // SkipQueryValidation + if rule.SkipQueryValidation != nil { + skipQueryValidation := *rule.SkipQueryValidation + destination.SkipQueryValidation = &skipQueryValidation + } else { + destination.SkipQueryValidation = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(rule.Tags) + + // TargetResourceTypes + destination.TargetResourceTypes = genruntime.CloneSliceOfString(rule.TargetResourceTypes) + + // WindowSize + destination.WindowSize = genruntime.ClonePointerToString(rule.WindowSize) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForScheduledQueryRule_Spec); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.ScheduledQueryRule_STATUS +type ScheduledQueryRule_STATUS struct { + Actions *Actions_STATUS `json:"actions,omitempty"` + AutoMitigate *bool `json:"autoMitigate,omitempty"` + CheckWorkspaceAlertsStorageConfigured *bool `json:"checkWorkspaceAlertsStorageConfigured,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CreatedWithApiVersion *string `json:"createdWithApiVersion,omitempty"` + Criteria *ScheduledQueryRuleCriteria_STATUS `json:"criteria,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Etag *string `json:"etag,omitempty"` + EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` + Id *string `json:"id,omitempty"` + Identity *Identity_STATUS `json:"identity,omitempty"` + IsLegacyLogAnalyticsRule *bool `json:"isLegacyLogAnalyticsRule,omitempty"` + IsWorkspaceAlertsStorageConfigured *bool `json:"isWorkspaceAlertsStorageConfigured,omitempty"` + Kind *string `json:"kind,omitempty"` + Location *string `json:"location,omitempty"` + MuteActionsDuration *string `json:"muteActionsDuration,omitempty"` + Name *string `json:"name,omitempty"` + OverrideQueryTimeRange *string `json:"overrideQueryTimeRange,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ResolveConfiguration *RuleResolveConfiguration_STATUS `json:"resolveConfiguration,omitempty"` + Scopes []string `json:"scopes,omitempty"` + Severity *int `json:"severity,omitempty"` + SkipQueryValidation *bool `json:"skipQueryValidation,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + TargetResourceTypes []string `json:"targetResourceTypes,omitempty"` + Type *string `json:"type,omitempty"` + WindowSize *string `json:"windowSize,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &ScheduledQueryRule_STATUS{} + +// ConvertStatusFrom populates our ScheduledQueryRule_STATUS from the provided source +func (rule *ScheduledQueryRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20220615s.ScheduledQueryRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_ScheduledQueryRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20220615s.ScheduledQueryRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_ScheduledQueryRule_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our ScheduledQueryRule_STATUS +func (rule *ScheduledQueryRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20220615s.ScheduledQueryRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_ScheduledQueryRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20220615s.ScheduledQueryRule_STATUS{} + err := rule.AssignProperties_To_ScheduledQueryRule_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_ScheduledQueryRule_STATUS populates our ScheduledQueryRule_STATUS from the provided source ScheduledQueryRule_STATUS +func (rule *ScheduledQueryRule_STATUS) AssignProperties_From_ScheduledQueryRule_STATUS(source *v20220615s.ScheduledQueryRule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Actions + if source.Actions != nil { + var action Actions_STATUS + err := action.AssignProperties_From_Actions_STATUS(source.Actions) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Actions_STATUS() to populate field Actions") + } + rule.Actions = &action + } else { + rule.Actions = nil + } + + // AutoMitigate + if source.AutoMitigate != nil { + autoMitigate := *source.AutoMitigate + rule.AutoMitigate = &autoMitigate + } else { + rule.AutoMitigate = nil + } + + // CheckWorkspaceAlertsStorageConfigured + if source.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *source.CheckWorkspaceAlertsStorageConfigured + rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + rule.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedWithApiVersion + rule.CreatedWithApiVersion = genruntime.ClonePointerToString(source.CreatedWithApiVersion) + + // Criteria + if source.Criteria != nil { + var criterion ScheduledQueryRuleCriteria_STATUS + err := criterion.AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(source.Criteria) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleCriteria_STATUS() to populate field Criteria") + } + rule.Criteria = &criterion + } else { + rule.Criteria = nil + } + + // Description + rule.Description = genruntime.ClonePointerToString(source.Description) + + // DisplayName + rule.DisplayName = genruntime.ClonePointerToString(source.DisplayName) + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + rule.Enabled = &enabled + } else { + rule.Enabled = nil + } + + // Etag + rule.Etag = genruntime.ClonePointerToString(source.Etag) + + // EvaluationFrequency + rule.EvaluationFrequency = genruntime.ClonePointerToString(source.EvaluationFrequency) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Identity + if propertyBag.Contains("Identity") { + var identity Identity_STATUS + err := propertyBag.Pull("Identity", &identity) + if err != nil { + return eris.Wrap(err, "pulling 'Identity' from propertyBag") + } + + rule.Identity = &identity + } else { + rule.Identity = nil + } + + // IsLegacyLogAnalyticsRule + if source.IsLegacyLogAnalyticsRule != nil { + isLegacyLogAnalyticsRule := *source.IsLegacyLogAnalyticsRule + rule.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule + } else { + rule.IsLegacyLogAnalyticsRule = nil + } + + // IsWorkspaceAlertsStorageConfigured + if source.IsWorkspaceAlertsStorageConfigured != nil { + isWorkspaceAlertsStorageConfigured := *source.IsWorkspaceAlertsStorageConfigured + rule.IsWorkspaceAlertsStorageConfigured = &isWorkspaceAlertsStorageConfigured + } else { + rule.IsWorkspaceAlertsStorageConfigured = nil + } + + // Kind + rule.Kind = genruntime.ClonePointerToString(source.Kind) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // MuteActionsDuration + rule.MuteActionsDuration = genruntime.ClonePointerToString(source.MuteActionsDuration) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // OverrideQueryTimeRange + rule.OverrideQueryTimeRange = genruntime.ClonePointerToString(source.OverrideQueryTimeRange) + + // ResolveConfiguration + if propertyBag.Contains("ResolveConfiguration") { + var resolveConfiguration RuleResolveConfiguration_STATUS + err := propertyBag.Pull("ResolveConfiguration", &resolveConfiguration) + if err != nil { + return eris.Wrap(err, "pulling 'ResolveConfiguration' from propertyBag") + } + + rule.ResolveConfiguration = &resolveConfiguration + } else { + rule.ResolveConfiguration = nil + } + + // Scopes + rule.Scopes = genruntime.CloneSliceOfString(source.Scopes) + + // Severity + rule.Severity = genruntime.ClonePointerToInt(source.Severity) + + // SkipQueryValidation + if source.SkipQueryValidation != nil { + skipQueryValidation := *source.SkipQueryValidation + rule.SkipQueryValidation = &skipQueryValidation + } else { + rule.SkipQueryValidation = nil + } + + // SystemData + if source.SystemData != nil { + var systemDataSTATUSPivot v20221001s.SystemData_STATUS + err := source.SystemData.AssignProperties_To_SystemData_STATUS(&systemDataSTATUSPivot) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData_STATUSPivot from SystemData") + } + var systemDatum SystemData_STATUS + err = systemDatum.AssignProperties_From_SystemData_STATUS(&systemDataSTATUSPivot) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData from SystemData_STATUSPivot") + } + rule.SystemData = &systemDatum + } else { + rule.SystemData = nil + } + + // Tags + rule.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // TargetResourceTypes + rule.TargetResourceTypes = genruntime.CloneSliceOfString(source.TargetResourceTypes) + + // Type + rule.Type = genruntime.ClonePointerToString(source.Type) + + // WindowSize + rule.WindowSize = genruntime.ClonePointerToString(source.WindowSize) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForScheduledQueryRule_STATUS); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRule_STATUS populates the provided destination ScheduledQueryRule_STATUS from our ScheduledQueryRule_STATUS +func (rule *ScheduledQueryRule_STATUS) AssignProperties_To_ScheduledQueryRule_STATUS(destination *v20220615s.ScheduledQueryRule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Actions + if rule.Actions != nil { + var action v20220615s.Actions_STATUS + err := rule.Actions.AssignProperties_To_Actions_STATUS(&action) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Actions_STATUS() to populate field Actions") + } + destination.Actions = &action + } else { + destination.Actions = nil + } + + // AutoMitigate + if rule.AutoMitigate != nil { + autoMitigate := *rule.AutoMitigate + destination.AutoMitigate = &autoMitigate + } else { + destination.AutoMitigate = nil + } + + // CheckWorkspaceAlertsStorageConfigured + if rule.CheckWorkspaceAlertsStorageConfigured != nil { + checkWorkspaceAlertsStorageConfigured := *rule.CheckWorkspaceAlertsStorageConfigured + destination.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured + } else { + destination.CheckWorkspaceAlertsStorageConfigured = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // CreatedWithApiVersion + destination.CreatedWithApiVersion = genruntime.ClonePointerToString(rule.CreatedWithApiVersion) + + // Criteria + if rule.Criteria != nil { + var criterion v20220615s.ScheduledQueryRuleCriteria_STATUS + err := rule.Criteria.AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(&criterion) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleCriteria_STATUS() to populate field Criteria") + } + destination.Criteria = &criterion + } else { + destination.Criteria = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(rule.Description) + + // DisplayName + destination.DisplayName = genruntime.ClonePointerToString(rule.DisplayName) + + // Enabled + if rule.Enabled != nil { + enabled := *rule.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Etag + destination.Etag = genruntime.ClonePointerToString(rule.Etag) + + // EvaluationFrequency + destination.EvaluationFrequency = genruntime.ClonePointerToString(rule.EvaluationFrequency) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Identity + if rule.Identity != nil { + propertyBag.Add("Identity", *rule.Identity) + } else { + propertyBag.Remove("Identity") + } + + // IsLegacyLogAnalyticsRule + if rule.IsLegacyLogAnalyticsRule != nil { + isLegacyLogAnalyticsRule := *rule.IsLegacyLogAnalyticsRule + destination.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule + } else { + destination.IsLegacyLogAnalyticsRule = nil + } + + // IsWorkspaceAlertsStorageConfigured + if rule.IsWorkspaceAlertsStorageConfigured != nil { + isWorkspaceAlertsStorageConfigured := *rule.IsWorkspaceAlertsStorageConfigured + destination.IsWorkspaceAlertsStorageConfigured = &isWorkspaceAlertsStorageConfigured + } else { + destination.IsWorkspaceAlertsStorageConfigured = nil + } + + // Kind + destination.Kind = genruntime.ClonePointerToString(rule.Kind) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // MuteActionsDuration + destination.MuteActionsDuration = genruntime.ClonePointerToString(rule.MuteActionsDuration) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // OverrideQueryTimeRange + destination.OverrideQueryTimeRange = genruntime.ClonePointerToString(rule.OverrideQueryTimeRange) + + // ResolveConfiguration + if rule.ResolveConfiguration != nil { + propertyBag.Add("ResolveConfiguration", *rule.ResolveConfiguration) + } else { + propertyBag.Remove("ResolveConfiguration") + } + + // Scopes + destination.Scopes = genruntime.CloneSliceOfString(rule.Scopes) + + // Severity + destination.Severity = genruntime.ClonePointerToInt(rule.Severity) + + // SkipQueryValidation + if rule.SkipQueryValidation != nil { + skipQueryValidation := *rule.SkipQueryValidation + destination.SkipQueryValidation = &skipQueryValidation + } else { + destination.SkipQueryValidation = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDataSTATUSPivot v20221001s.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDataSTATUSPivot) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData_STATUSPivot from SystemData") + } + var systemDatum v20220615s.SystemData_STATUS + err = systemDatum.AssignProperties_From_SystemData_STATUS(&systemDataSTATUSPivot) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData from SystemData_STATUSPivot") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(rule.Tags) + + // TargetResourceTypes + destination.TargetResourceTypes = genruntime.CloneSliceOfString(rule.TargetResourceTypes) + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // WindowSize + destination.WindowSize = genruntime.ClonePointerToString(rule.WindowSize) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForScheduledQueryRule_STATUS); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.Actions +// Actions to invoke when the alert fires. +type Actions struct { + ActionGroupsReferences []genruntime.ResourceReference `armReference:"ActionGroups" json:"actionGroupsReferences,omitempty"` + ActionProperties map[string]string `json:"actionProperties,omitempty"` + CustomProperties map[string]string `json:"customProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_Actions populates our Actions from the provided source Actions +func (actions *Actions) AssignProperties_From_Actions(source *v20220615s.Actions) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ActionGroupsReferences + if source.ActionGroupsReferences != nil { + actionGroupsReferenceList := make([]genruntime.ResourceReference, len(source.ActionGroupsReferences)) + for actionGroupsReferenceIndex, actionGroupsReferenceItem := range source.ActionGroupsReferences { + // Shadow the loop variable to avoid aliasing + actionGroupsReferenceItem := actionGroupsReferenceItem + actionGroupsReferenceList[actionGroupsReferenceIndex] = actionGroupsReferenceItem.Copy() + } + actions.ActionGroupsReferences = actionGroupsReferenceList + } else { + actions.ActionGroupsReferences = nil + } + + // ActionProperties + if propertyBag.Contains("ActionProperties") { + var actionProperty map[string]string + err := propertyBag.Pull("ActionProperties", &actionProperty) + if err != nil { + return eris.Wrap(err, "pulling 'ActionProperties' from propertyBag") + } + + actions.ActionProperties = actionProperty + } else { + actions.ActionProperties = nil + } + + // CustomProperties + actions.CustomProperties = genruntime.CloneMapOfStringToString(source.CustomProperties) + + // Update the property bag + if len(propertyBag) > 0 { + actions.PropertyBag = propertyBag + } else { + actions.PropertyBag = nil + } + + // Invoke the augmentConversionForActions interface (if implemented) to customize the conversion + var actionsAsAny any = actions + if augmentedActions, ok := actionsAsAny.(augmentConversionForActions); ok { + err := augmentedActions.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Actions populates the provided destination Actions from our Actions +func (actions *Actions) AssignProperties_To_Actions(destination *v20220615s.Actions) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(actions.PropertyBag) + + // ActionGroupsReferences + if actions.ActionGroupsReferences != nil { + actionGroupsReferenceList := make([]genruntime.ResourceReference, len(actions.ActionGroupsReferences)) + for actionGroupsReferenceIndex, actionGroupsReferenceItem := range actions.ActionGroupsReferences { + // Shadow the loop variable to avoid aliasing + actionGroupsReferenceItem := actionGroupsReferenceItem + actionGroupsReferenceList[actionGroupsReferenceIndex] = actionGroupsReferenceItem.Copy() + } + destination.ActionGroupsReferences = actionGroupsReferenceList + } else { + destination.ActionGroupsReferences = nil + } + + // ActionProperties + if len(actions.ActionProperties) > 0 { + propertyBag.Add("ActionProperties", actions.ActionProperties) + } else { + propertyBag.Remove("ActionProperties") + } + + // CustomProperties + destination.CustomProperties = genruntime.CloneMapOfStringToString(actions.CustomProperties) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForActions interface (if implemented) to customize the conversion + var actionsAsAny any = actions + if augmentedActions, ok := actionsAsAny.(augmentConversionForActions); ok { + err := augmentedActions.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.Actions_STATUS +// Actions to invoke when the alert fires. +type Actions_STATUS struct { + ActionGroups []string `json:"actionGroups,omitempty"` + ActionProperties map[string]string `json:"actionProperties,omitempty"` + CustomProperties map[string]string `json:"customProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_Actions_STATUS populates our Actions_STATUS from the provided source Actions_STATUS +func (actions *Actions_STATUS) AssignProperties_From_Actions_STATUS(source *v20220615s.Actions_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ActionGroups + actions.ActionGroups = genruntime.CloneSliceOfString(source.ActionGroups) + + // ActionProperties + if propertyBag.Contains("ActionProperties") { + var actionProperty map[string]string + err := propertyBag.Pull("ActionProperties", &actionProperty) + if err != nil { + return eris.Wrap(err, "pulling 'ActionProperties' from propertyBag") + } + + actions.ActionProperties = actionProperty + } else { + actions.ActionProperties = nil + } + + // CustomProperties + actions.CustomProperties = genruntime.CloneMapOfStringToString(source.CustomProperties) + + // Update the property bag + if len(propertyBag) > 0 { + actions.PropertyBag = propertyBag + } else { + actions.PropertyBag = nil + } + + // Invoke the augmentConversionForActions_STATUS interface (if implemented) to customize the conversion + var actionsAsAny any = actions + if augmentedActions, ok := actionsAsAny.(augmentConversionForActions_STATUS); ok { + err := augmentedActions.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Actions_STATUS populates the provided destination Actions_STATUS from our Actions_STATUS +func (actions *Actions_STATUS) AssignProperties_To_Actions_STATUS(destination *v20220615s.Actions_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(actions.PropertyBag) + + // ActionGroups + destination.ActionGroups = genruntime.CloneSliceOfString(actions.ActionGroups) + + // ActionProperties + if len(actions.ActionProperties) > 0 { + propertyBag.Add("ActionProperties", actions.ActionProperties) + } else { + propertyBag.Remove("ActionProperties") + } + + // CustomProperties + destination.CustomProperties = genruntime.CloneMapOfStringToString(actions.CustomProperties) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForActions_STATUS interface (if implemented) to customize the conversion + var actionsAsAny any = actions + if augmentedActions, ok := actionsAsAny.(augmentConversionForActions_STATUS); ok { + err := augmentedActions.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForScheduledQueryRule_Spec interface { + AssignPropertiesFrom(src *v20220615s.ScheduledQueryRule_Spec) error + AssignPropertiesTo(dst *v20220615s.ScheduledQueryRule_Spec) error +} + +type augmentConversionForScheduledQueryRule_STATUS interface { + AssignPropertiesFrom(src *v20220615s.ScheduledQueryRule_STATUS) error + AssignPropertiesTo(dst *v20220615s.ScheduledQueryRule_STATUS) error +} + +// Storage version of v1api20240101preview.Identity +// Identity for the resource. +type Identity struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` + UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} + +// Storage version of v1api20240101preview.Identity_STATUS +// Identity for the resource. +type Identity_STATUS struct { + PrincipalId *string `json:"principalId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + Type *string `json:"type,omitempty"` + UserAssignedIdentities map[string]UserIdentityProperties_STATUS `json:"userAssignedIdentities,omitempty"` +} + +// Storage version of v1api20240101preview.RuleResolveConfiguration +// TBD. Relevant only for rules of the kind LogAlert. +type RuleResolveConfiguration struct { + AutoResolved *bool `json:"autoResolved,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + TimeToResolve *string `json:"timeToResolve,omitempty"` +} + +// Storage version of v1api20240101preview.RuleResolveConfiguration_STATUS +// TBD. Relevant only for rules of the kind LogAlert. +type RuleResolveConfiguration_STATUS struct { + AutoResolved *bool `json:"autoResolved,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + TimeToResolve *string `json:"timeToResolve,omitempty"` +} + +// Storage version of v1api20240101preview.ScheduledQueryRuleCriteria +// The rule criteria that defines the conditions of the scheduled query rule. +type ScheduledQueryRuleCriteria struct { + AllOf []Condition `json:"allOf,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_ScheduledQueryRuleCriteria populates our ScheduledQueryRuleCriteria from the provided source ScheduledQueryRuleCriteria +func (criteria *ScheduledQueryRuleCriteria) AssignProperties_From_ScheduledQueryRuleCriteria(source *v20220615s.ScheduledQueryRuleCriteria) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AllOf + if source.AllOf != nil { + allOfList := make([]Condition, len(source.AllOf)) + for allOfIndex, allOfItem := range source.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf Condition + err := allOf.AssignProperties_From_Condition(&allOfItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + criteria.AllOf = allOfList + } else { + criteria.AllOf = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + criteria.PropertyBag = propertyBag + } else { + criteria.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRuleCriteria interface (if implemented) to customize the conversion + var criteriaAsAny any = criteria + if augmentedCriteria, ok := criteriaAsAny.(augmentConversionForScheduledQueryRuleCriteria); ok { + err := augmentedCriteria.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRuleCriteria populates the provided destination ScheduledQueryRuleCriteria from our ScheduledQueryRuleCriteria +func (criteria *ScheduledQueryRuleCriteria) AssignProperties_To_ScheduledQueryRuleCriteria(destination *v20220615s.ScheduledQueryRuleCriteria) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(criteria.PropertyBag) + + // AllOf + if criteria.AllOf != nil { + allOfList := make([]v20220615s.Condition, len(criteria.AllOf)) + for allOfIndex, allOfItem := range criteria.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf v20220615s.Condition + err := allOfItem.AssignProperties_To_Condition(&allOf) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + destination.AllOf = allOfList + } else { + destination.AllOf = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRuleCriteria interface (if implemented) to customize the conversion + var criteriaAsAny any = criteria + if augmentedCriteria, ok := criteriaAsAny.(augmentConversionForScheduledQueryRuleCriteria); ok { + err := augmentedCriteria.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.ScheduledQueryRuleCriteria_STATUS +// The rule criteria that defines the conditions of the scheduled query rule. +type ScheduledQueryRuleCriteria_STATUS struct { + AllOf []Condition_STATUS `json:"allOf,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_ScheduledQueryRuleCriteria_STATUS populates our ScheduledQueryRuleCriteria_STATUS from the provided source ScheduledQueryRuleCriteria_STATUS +func (criteria *ScheduledQueryRuleCriteria_STATUS) AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(source *v20220615s.ScheduledQueryRuleCriteria_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AllOf + if source.AllOf != nil { + allOfList := make([]Condition_STATUS, len(source.AllOf)) + for allOfIndex, allOfItem := range source.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf Condition_STATUS + err := allOf.AssignProperties_From_Condition_STATUS(&allOfItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition_STATUS() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + criteria.AllOf = allOfList + } else { + criteria.AllOf = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + criteria.PropertyBag = propertyBag + } else { + criteria.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRuleCriteria_STATUS interface (if implemented) to customize the conversion + var criteriaAsAny any = criteria + if augmentedCriteria, ok := criteriaAsAny.(augmentConversionForScheduledQueryRuleCriteria_STATUS); ok { + err := augmentedCriteria.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRuleCriteria_STATUS populates the provided destination ScheduledQueryRuleCriteria_STATUS from our ScheduledQueryRuleCriteria_STATUS +func (criteria *ScheduledQueryRuleCriteria_STATUS) AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(destination *v20220615s.ScheduledQueryRuleCriteria_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(criteria.PropertyBag) + + // AllOf + if criteria.AllOf != nil { + allOfList := make([]v20220615s.Condition_STATUS, len(criteria.AllOf)) + for allOfIndex, allOfItem := range criteria.AllOf { + // Shadow the loop variable to avoid aliasing + allOfItem := allOfItem + var allOf v20220615s.Condition_STATUS + err := allOfItem.AssignProperties_To_Condition_STATUS(&allOf) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition_STATUS() to populate field AllOf") + } + allOfList[allOfIndex] = allOf + } + destination.AllOf = allOfList + } else { + destination.AllOf = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRuleCriteria_STATUS interface (if implemented) to customize the conversion + var criteriaAsAny any = criteria + if augmentedCriteria, ok := criteriaAsAny.(augmentConversionForScheduledQueryRuleCriteria_STATUS); ok { + err := augmentedCriteria.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.ScheduledQueryRuleOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type ScheduledQueryRuleOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// AssignProperties_From_ScheduledQueryRuleOperatorSpec populates our ScheduledQueryRuleOperatorSpec from the provided source ScheduledQueryRuleOperatorSpec +func (operator *ScheduledQueryRuleOperatorSpec) AssignProperties_From_ScheduledQueryRuleOperatorSpec(source *v20220615s.ScheduledQueryRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForScheduledQueryRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_ScheduledQueryRuleOperatorSpec populates the provided destination ScheduledQueryRuleOperatorSpec from our ScheduledQueryRuleOperatorSpec +func (operator *ScheduledQueryRuleOperatorSpec) AssignProperties_To_ScheduledQueryRuleOperatorSpec(destination *v20220615s.ScheduledQueryRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForScheduledQueryRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForScheduledQueryRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.SystemData_STATUS +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByType *string `json:"createdByType,omitempty"` + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedByType *string `json:"lastModifiedByType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *v20221001s.SystemData_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CreatedAt + data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + data.CreatedByType = genruntime.ClonePointerToString(source.CreatedByType) + + // LastModifiedAt + data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt) + + // LastModifiedBy + data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) + + // LastModifiedByType + data.LastModifiedByType = genruntime.ClonePointerToString(source.LastModifiedByType) + + // Update the property bag + if len(propertyBag) > 0 { + data.PropertyBag = propertyBag + } else { + data.PropertyBag = nil + } + + // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion + var dataAsAny any = data + if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { + err := augmentedData.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *v20221001s.SystemData_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(data.PropertyBag) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt) + + // CreatedBy + destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy) + + // CreatedByType + destination.CreatedByType = genruntime.ClonePointerToString(data.CreatedByType) + + // LastModifiedAt + destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt) + + // LastModifiedBy + destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy) + + // LastModifiedByType + destination.LastModifiedByType = genruntime.ClonePointerToString(data.LastModifiedByType) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion + var dataAsAny any = data + if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { + err := augmentedData.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForActions interface { + AssignPropertiesFrom(src *v20220615s.Actions) error + AssignPropertiesTo(dst *v20220615s.Actions) error +} + +type augmentConversionForActions_STATUS interface { + AssignPropertiesFrom(src *v20220615s.Actions_STATUS) error + AssignPropertiesTo(dst *v20220615s.Actions_STATUS) error +} + +type augmentConversionForScheduledQueryRuleCriteria interface { + AssignPropertiesFrom(src *v20220615s.ScheduledQueryRuleCriteria) error + AssignPropertiesTo(dst *v20220615s.ScheduledQueryRuleCriteria) error +} + +type augmentConversionForScheduledQueryRuleCriteria_STATUS interface { + AssignPropertiesFrom(src *v20220615s.ScheduledQueryRuleCriteria_STATUS) error + AssignPropertiesTo(dst *v20220615s.ScheduledQueryRuleCriteria_STATUS) error +} + +type augmentConversionForScheduledQueryRuleOperatorSpec interface { + AssignPropertiesFrom(src *v20220615s.ScheduledQueryRuleOperatorSpec) error + AssignPropertiesTo(dst *v20220615s.ScheduledQueryRuleOperatorSpec) error +} + +type augmentConversionForSystemData_STATUS interface { + AssignPropertiesFrom(src *v20221001s.SystemData_STATUS) error + AssignPropertiesTo(dst *v20221001s.SystemData_STATUS) error +} + +// Storage version of v1api20240101preview.Condition +// A condition of the scheduled query rule. +type Condition struct { + AlertSensitivity *string `json:"alertSensitivity,omitempty"` + CriterionType *string `json:"criterionType,omitempty"` + Dimensions []Dimension `json:"dimensions,omitempty"` + FailingPeriods *Condition_FailingPeriods `json:"failingPeriods,omitempty"` + IgnoreDataBefore *string `json:"ignoreDataBefore,omitempty"` + MetricMeasureColumn *string `json:"metricMeasureColumn,omitempty"` + MetricName *string `json:"metricName,omitempty"` + Operator *string `json:"operator,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Query *string `json:"query,omitempty"` + + // ResourceIdColumnReference: The column containing the resource id. The content of the column must be a uri formatted as + // resource id. Relevant only for rules of the kind LogAlert. + ResourceIdColumnReference *genruntime.ResourceReference `armReference:"ResourceIdColumn" json:"resourceIdColumnReference,omitempty"` + Threshold *float64 `json:"threshold,omitempty"` + TimeAggregation *string `json:"timeAggregation,omitempty"` +} + +// AssignProperties_From_Condition populates our Condition from the provided source Condition +func (condition *Condition) AssignProperties_From_Condition(source *v20220615s.Condition) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AlertSensitivity + if propertyBag.Contains("AlertSensitivity") { + var alertSensitivity string + err := propertyBag.Pull("AlertSensitivity", &alertSensitivity) + if err != nil { + return eris.Wrap(err, "pulling 'AlertSensitivity' from propertyBag") + } + + condition.AlertSensitivity = &alertSensitivity + } else { + condition.AlertSensitivity = nil + } + + // CriterionType + if propertyBag.Contains("CriterionType") { + var criterionType string + err := propertyBag.Pull("CriterionType", &criterionType) + if err != nil { + return eris.Wrap(err, "pulling 'CriterionType' from propertyBag") + } + + condition.CriterionType = &criterionType + } else { + condition.CriterionType = nil + } + + // Dimensions + if source.Dimensions != nil { + dimensionList := make([]Dimension, len(source.Dimensions)) + for dimensionIndex, dimensionItem := range source.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension Dimension + err := dimension.AssignProperties_From_Dimension(&dimensionItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Dimension() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + condition.Dimensions = dimensionList + } else { + condition.Dimensions = nil + } + + // FailingPeriods + if source.FailingPeriods != nil { + var failingPeriod Condition_FailingPeriods + err := failingPeriod.AssignProperties_From_Condition_FailingPeriods(source.FailingPeriods) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition_FailingPeriods() to populate field FailingPeriods") + } + condition.FailingPeriods = &failingPeriod + } else { + condition.FailingPeriods = nil + } + + // IgnoreDataBefore + if propertyBag.Contains("IgnoreDataBefore") { + var ignoreDataBefore string + err := propertyBag.Pull("IgnoreDataBefore", &ignoreDataBefore) + if err != nil { + return eris.Wrap(err, "pulling 'IgnoreDataBefore' from propertyBag") + } + + condition.IgnoreDataBefore = &ignoreDataBefore + } else { + condition.IgnoreDataBefore = nil + } + + // MetricMeasureColumn + condition.MetricMeasureColumn = genruntime.ClonePointerToString(source.MetricMeasureColumn) + + // MetricName + condition.MetricName = genruntime.ClonePointerToString(source.MetricName) + + // Operator + condition.Operator = genruntime.ClonePointerToString(source.Operator) + + // Query + condition.Query = genruntime.ClonePointerToString(source.Query) + + // ResourceIdColumnReference + if source.ResourceIdColumnReference != nil { + resourceIdColumnReference := source.ResourceIdColumnReference.Copy() + condition.ResourceIdColumnReference = &resourceIdColumnReference + } else { + condition.ResourceIdColumnReference = nil + } + + // Threshold + if source.Threshold != nil { + threshold := *source.Threshold + condition.Threshold = &threshold + } else { + condition.Threshold = nil + } + + // TimeAggregation + condition.TimeAggregation = genruntime.ClonePointerToString(source.TimeAggregation) + + // Update the property bag + if len(propertyBag) > 0 { + condition.PropertyBag = propertyBag + } else { + condition.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition interface (if implemented) to customize the conversion + var conditionAsAny any = condition + if augmentedCondition, ok := conditionAsAny.(augmentConversionForCondition); ok { + err := augmentedCondition.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Condition populates the provided destination Condition from our Condition +func (condition *Condition) AssignProperties_To_Condition(destination *v20220615s.Condition) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(condition.PropertyBag) + + // AlertSensitivity + if condition.AlertSensitivity != nil { + propertyBag.Add("AlertSensitivity", *condition.AlertSensitivity) + } else { + propertyBag.Remove("AlertSensitivity") + } + + // CriterionType + if condition.CriterionType != nil { + propertyBag.Add("CriterionType", *condition.CriterionType) + } else { + propertyBag.Remove("CriterionType") + } + + // Dimensions + if condition.Dimensions != nil { + dimensionList := make([]v20220615s.Dimension, len(condition.Dimensions)) + for dimensionIndex, dimensionItem := range condition.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension v20220615s.Dimension + err := dimensionItem.AssignProperties_To_Dimension(&dimension) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Dimension() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + destination.Dimensions = dimensionList + } else { + destination.Dimensions = nil + } + + // FailingPeriods + if condition.FailingPeriods != nil { + var failingPeriod v20220615s.Condition_FailingPeriods + err := condition.FailingPeriods.AssignProperties_To_Condition_FailingPeriods(&failingPeriod) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition_FailingPeriods() to populate field FailingPeriods") + } + destination.FailingPeriods = &failingPeriod + } else { + destination.FailingPeriods = nil + } + + // IgnoreDataBefore + if condition.IgnoreDataBefore != nil { + propertyBag.Add("IgnoreDataBefore", *condition.IgnoreDataBefore) + } else { + propertyBag.Remove("IgnoreDataBefore") + } + + // MetricMeasureColumn + destination.MetricMeasureColumn = genruntime.ClonePointerToString(condition.MetricMeasureColumn) + + // MetricName + destination.MetricName = genruntime.ClonePointerToString(condition.MetricName) + + // Operator + destination.Operator = genruntime.ClonePointerToString(condition.Operator) + + // Query + destination.Query = genruntime.ClonePointerToString(condition.Query) + + // ResourceIdColumnReference + if condition.ResourceIdColumnReference != nil { + resourceIdColumnReference := condition.ResourceIdColumnReference.Copy() + destination.ResourceIdColumnReference = &resourceIdColumnReference + } else { + destination.ResourceIdColumnReference = nil + } + + // Threshold + if condition.Threshold != nil { + threshold := *condition.Threshold + destination.Threshold = &threshold + } else { + destination.Threshold = nil + } + + // TimeAggregation + destination.TimeAggregation = genruntime.ClonePointerToString(condition.TimeAggregation) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition interface (if implemented) to customize the conversion + var conditionAsAny any = condition + if augmentedCondition, ok := conditionAsAny.(augmentConversionForCondition); ok { + err := augmentedCondition.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.Condition_STATUS +// A condition of the scheduled query rule. +type Condition_STATUS struct { + AlertSensitivity *string `json:"alertSensitivity,omitempty"` + CriterionType *string `json:"criterionType,omitempty"` + Dimensions []Dimension_STATUS `json:"dimensions,omitempty"` + FailingPeriods *Condition_FailingPeriods_STATUS `json:"failingPeriods,omitempty"` + IgnoreDataBefore *string `json:"ignoreDataBefore,omitempty"` + MetricMeasureColumn *string `json:"metricMeasureColumn,omitempty"` + MetricName *string `json:"metricName,omitempty"` + Operator *string `json:"operator,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Query *string `json:"query,omitempty"` + ResourceIdColumn *string `json:"resourceIdColumn,omitempty"` + Threshold *float64 `json:"threshold,omitempty"` + TimeAggregation *string `json:"timeAggregation,omitempty"` +} + +// AssignProperties_From_Condition_STATUS populates our Condition_STATUS from the provided source Condition_STATUS +func (condition *Condition_STATUS) AssignProperties_From_Condition_STATUS(source *v20220615s.Condition_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AlertSensitivity + if propertyBag.Contains("AlertSensitivity") { + var alertSensitivity string + err := propertyBag.Pull("AlertSensitivity", &alertSensitivity) + if err != nil { + return eris.Wrap(err, "pulling 'AlertSensitivity' from propertyBag") + } + + condition.AlertSensitivity = &alertSensitivity + } else { + condition.AlertSensitivity = nil + } + + // CriterionType + if propertyBag.Contains("CriterionType") { + var criterionType string + err := propertyBag.Pull("CriterionType", &criterionType) + if err != nil { + return eris.Wrap(err, "pulling 'CriterionType' from propertyBag") + } + + condition.CriterionType = &criterionType + } else { + condition.CriterionType = nil + } + + // Dimensions + if source.Dimensions != nil { + dimensionList := make([]Dimension_STATUS, len(source.Dimensions)) + for dimensionIndex, dimensionItem := range source.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension Dimension_STATUS + err := dimension.AssignProperties_From_Dimension_STATUS(&dimensionItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Dimension_STATUS() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + condition.Dimensions = dimensionList + } else { + condition.Dimensions = nil + } + + // FailingPeriods + if source.FailingPeriods != nil { + var failingPeriod Condition_FailingPeriods_STATUS + err := failingPeriod.AssignProperties_From_Condition_FailingPeriods_STATUS(source.FailingPeriods) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Condition_FailingPeriods_STATUS() to populate field FailingPeriods") + } + condition.FailingPeriods = &failingPeriod + } else { + condition.FailingPeriods = nil + } + + // IgnoreDataBefore + if propertyBag.Contains("IgnoreDataBefore") { + var ignoreDataBefore string + err := propertyBag.Pull("IgnoreDataBefore", &ignoreDataBefore) + if err != nil { + return eris.Wrap(err, "pulling 'IgnoreDataBefore' from propertyBag") + } + + condition.IgnoreDataBefore = &ignoreDataBefore + } else { + condition.IgnoreDataBefore = nil + } + + // MetricMeasureColumn + condition.MetricMeasureColumn = genruntime.ClonePointerToString(source.MetricMeasureColumn) + + // MetricName + condition.MetricName = genruntime.ClonePointerToString(source.MetricName) + + // Operator + condition.Operator = genruntime.ClonePointerToString(source.Operator) + + // Query + condition.Query = genruntime.ClonePointerToString(source.Query) + + // ResourceIdColumn + condition.ResourceIdColumn = genruntime.ClonePointerToString(source.ResourceIdColumn) + + // Threshold + if source.Threshold != nil { + threshold := *source.Threshold + condition.Threshold = &threshold + } else { + condition.Threshold = nil + } + + // TimeAggregation + condition.TimeAggregation = genruntime.ClonePointerToString(source.TimeAggregation) + + // Update the property bag + if len(propertyBag) > 0 { + condition.PropertyBag = propertyBag + } else { + condition.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition_STATUS interface (if implemented) to customize the conversion + var conditionAsAny any = condition + if augmentedCondition, ok := conditionAsAny.(augmentConversionForCondition_STATUS); ok { + err := augmentedCondition.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Condition_STATUS populates the provided destination Condition_STATUS from our Condition_STATUS +func (condition *Condition_STATUS) AssignProperties_To_Condition_STATUS(destination *v20220615s.Condition_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(condition.PropertyBag) + + // AlertSensitivity + if condition.AlertSensitivity != nil { + propertyBag.Add("AlertSensitivity", *condition.AlertSensitivity) + } else { + propertyBag.Remove("AlertSensitivity") + } + + // CriterionType + if condition.CriterionType != nil { + propertyBag.Add("CriterionType", *condition.CriterionType) + } else { + propertyBag.Remove("CriterionType") + } + + // Dimensions + if condition.Dimensions != nil { + dimensionList := make([]v20220615s.Dimension_STATUS, len(condition.Dimensions)) + for dimensionIndex, dimensionItem := range condition.Dimensions { + // Shadow the loop variable to avoid aliasing + dimensionItem := dimensionItem + var dimension v20220615s.Dimension_STATUS + err := dimensionItem.AssignProperties_To_Dimension_STATUS(&dimension) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Dimension_STATUS() to populate field Dimensions") + } + dimensionList[dimensionIndex] = dimension + } + destination.Dimensions = dimensionList + } else { + destination.Dimensions = nil + } + + // FailingPeriods + if condition.FailingPeriods != nil { + var failingPeriod v20220615s.Condition_FailingPeriods_STATUS + err := condition.FailingPeriods.AssignProperties_To_Condition_FailingPeriods_STATUS(&failingPeriod) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Condition_FailingPeriods_STATUS() to populate field FailingPeriods") + } + destination.FailingPeriods = &failingPeriod + } else { + destination.FailingPeriods = nil + } + + // IgnoreDataBefore + if condition.IgnoreDataBefore != nil { + propertyBag.Add("IgnoreDataBefore", *condition.IgnoreDataBefore) + } else { + propertyBag.Remove("IgnoreDataBefore") + } + + // MetricMeasureColumn + destination.MetricMeasureColumn = genruntime.ClonePointerToString(condition.MetricMeasureColumn) + + // MetricName + destination.MetricName = genruntime.ClonePointerToString(condition.MetricName) + + // Operator + destination.Operator = genruntime.ClonePointerToString(condition.Operator) + + // Query + destination.Query = genruntime.ClonePointerToString(condition.Query) + + // ResourceIdColumn + destination.ResourceIdColumn = genruntime.ClonePointerToString(condition.ResourceIdColumn) + + // Threshold + if condition.Threshold != nil { + threshold := *condition.Threshold + destination.Threshold = &threshold + } else { + destination.Threshold = nil + } + + // TimeAggregation + destination.TimeAggregation = genruntime.ClonePointerToString(condition.TimeAggregation) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition_STATUS interface (if implemented) to customize the conversion + var conditionAsAny any = condition + if augmentedCondition, ok := conditionAsAny.(augmentConversionForCondition_STATUS); ok { + err := augmentedCondition.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.UserAssignedIdentityDetails +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` +} + +// Storage version of v1api20240101preview.UserIdentityProperties_STATUS +// User assigned identity properties. +type UserIdentityProperties_STATUS struct { + ClientId *string `json:"clientId,omitempty"` + PrincipalId *string `json:"principalId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +type augmentConversionForCondition interface { + AssignPropertiesFrom(src *v20220615s.Condition) error + AssignPropertiesTo(dst *v20220615s.Condition) error +} + +type augmentConversionForCondition_STATUS interface { + AssignPropertiesFrom(src *v20220615s.Condition_STATUS) error + AssignPropertiesTo(dst *v20220615s.Condition_STATUS) error +} + +// Storage version of v1api20240101preview.Condition_FailingPeriods +type Condition_FailingPeriods struct { + MinFailingPeriodsToAlert *int `json:"minFailingPeriodsToAlert,omitempty"` + NumberOfEvaluationPeriods *int `json:"numberOfEvaluationPeriods,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_Condition_FailingPeriods populates our Condition_FailingPeriods from the provided source Condition_FailingPeriods +func (periods *Condition_FailingPeriods) AssignProperties_From_Condition_FailingPeriods(source *v20220615s.Condition_FailingPeriods) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // MinFailingPeriodsToAlert + periods.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(source.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + periods.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(source.NumberOfEvaluationPeriods) + + // Update the property bag + if len(propertyBag) > 0 { + periods.PropertyBag = propertyBag + } else { + periods.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition_FailingPeriods interface (if implemented) to customize the conversion + var periodsAsAny any = periods + if augmentedPeriods, ok := periodsAsAny.(augmentConversionForCondition_FailingPeriods); ok { + err := augmentedPeriods.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Condition_FailingPeriods populates the provided destination Condition_FailingPeriods from our Condition_FailingPeriods +func (periods *Condition_FailingPeriods) AssignProperties_To_Condition_FailingPeriods(destination *v20220615s.Condition_FailingPeriods) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(periods.PropertyBag) + + // MinFailingPeriodsToAlert + destination.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(periods.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + destination.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(periods.NumberOfEvaluationPeriods) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition_FailingPeriods interface (if implemented) to customize the conversion + var periodsAsAny any = periods + if augmentedPeriods, ok := periodsAsAny.(augmentConversionForCondition_FailingPeriods); ok { + err := augmentedPeriods.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.Condition_FailingPeriods_STATUS +type Condition_FailingPeriods_STATUS struct { + MinFailingPeriodsToAlert *int `json:"minFailingPeriodsToAlert,omitempty"` + NumberOfEvaluationPeriods *int `json:"numberOfEvaluationPeriods,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_Condition_FailingPeriods_STATUS populates our Condition_FailingPeriods_STATUS from the provided source Condition_FailingPeriods_STATUS +func (periods *Condition_FailingPeriods_STATUS) AssignProperties_From_Condition_FailingPeriods_STATUS(source *v20220615s.Condition_FailingPeriods_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // MinFailingPeriodsToAlert + periods.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(source.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + periods.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(source.NumberOfEvaluationPeriods) + + // Update the property bag + if len(propertyBag) > 0 { + periods.PropertyBag = propertyBag + } else { + periods.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition_FailingPeriods_STATUS interface (if implemented) to customize the conversion + var periodsAsAny any = periods + if augmentedPeriods, ok := periodsAsAny.(augmentConversionForCondition_FailingPeriods_STATUS); ok { + err := augmentedPeriods.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Condition_FailingPeriods_STATUS populates the provided destination Condition_FailingPeriods_STATUS from our Condition_FailingPeriods_STATUS +func (periods *Condition_FailingPeriods_STATUS) AssignProperties_To_Condition_FailingPeriods_STATUS(destination *v20220615s.Condition_FailingPeriods_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(periods.PropertyBag) + + // MinFailingPeriodsToAlert + destination.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(periods.MinFailingPeriodsToAlert) + + // NumberOfEvaluationPeriods + destination.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(periods.NumberOfEvaluationPeriods) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCondition_FailingPeriods_STATUS interface (if implemented) to customize the conversion + var periodsAsAny any = periods + if augmentedPeriods, ok := periodsAsAny.(augmentConversionForCondition_FailingPeriods_STATUS); ok { + err := augmentedPeriods.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.Dimension +// Dimension splitting and filtering definition +type Dimension struct { + Name *string `json:"name,omitempty"` + Operator *string `json:"operator,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Values []string `json:"values,omitempty"` +} + +// AssignProperties_From_Dimension populates our Dimension from the provided source Dimension +func (dimension *Dimension) AssignProperties_From_Dimension(source *v20220615s.Dimension) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Name + dimension.Name = genruntime.ClonePointerToString(source.Name) + + // Operator + dimension.Operator = genruntime.ClonePointerToString(source.Operator) + + // Values + dimension.Values = genruntime.CloneSliceOfString(source.Values) + + // Update the property bag + if len(propertyBag) > 0 { + dimension.PropertyBag = propertyBag + } else { + dimension.PropertyBag = nil + } + + // Invoke the augmentConversionForDimension interface (if implemented) to customize the conversion + var dimensionAsAny any = dimension + if augmentedDimension, ok := dimensionAsAny.(augmentConversionForDimension); ok { + err := augmentedDimension.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Dimension populates the provided destination Dimension from our Dimension +func (dimension *Dimension) AssignProperties_To_Dimension(destination *v20220615s.Dimension) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(dimension.PropertyBag) + + // Name + destination.Name = genruntime.ClonePointerToString(dimension.Name) + + // Operator + destination.Operator = genruntime.ClonePointerToString(dimension.Operator) + + // Values + destination.Values = genruntime.CloneSliceOfString(dimension.Values) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForDimension interface (if implemented) to customize the conversion + var dimensionAsAny any = dimension + if augmentedDimension, ok := dimensionAsAny.(augmentConversionForDimension); ok { + err := augmentedDimension.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20240101preview.Dimension_STATUS +// Dimension splitting and filtering definition +type Dimension_STATUS struct { + Name *string `json:"name,omitempty"` + Operator *string `json:"operator,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Values []string `json:"values,omitempty"` +} + +// AssignProperties_From_Dimension_STATUS populates our Dimension_STATUS from the provided source Dimension_STATUS +func (dimension *Dimension_STATUS) AssignProperties_From_Dimension_STATUS(source *v20220615s.Dimension_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Name + dimension.Name = genruntime.ClonePointerToString(source.Name) + + // Operator + dimension.Operator = genruntime.ClonePointerToString(source.Operator) + + // Values + dimension.Values = genruntime.CloneSliceOfString(source.Values) + + // Update the property bag + if len(propertyBag) > 0 { + dimension.PropertyBag = propertyBag + } else { + dimension.PropertyBag = nil + } + + // Invoke the augmentConversionForDimension_STATUS interface (if implemented) to customize the conversion + var dimensionAsAny any = dimension + if augmentedDimension, ok := dimensionAsAny.(augmentConversionForDimension_STATUS); ok { + err := augmentedDimension.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Dimension_STATUS populates the provided destination Dimension_STATUS from our Dimension_STATUS +func (dimension *Dimension_STATUS) AssignProperties_To_Dimension_STATUS(destination *v20220615s.Dimension_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(dimension.PropertyBag) + + // Name + destination.Name = genruntime.ClonePointerToString(dimension.Name) + + // Operator + destination.Operator = genruntime.ClonePointerToString(dimension.Operator) + + // Values + destination.Values = genruntime.CloneSliceOfString(dimension.Values) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForDimension_STATUS interface (if implemented) to customize the conversion + var dimensionAsAny any = dimension + if augmentedDimension, ok := dimensionAsAny.(augmentConversionForDimension_STATUS); ok { + err := augmentedDimension.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForCondition_FailingPeriods interface { + AssignPropertiesFrom(src *v20220615s.Condition_FailingPeriods) error + AssignPropertiesTo(dst *v20220615s.Condition_FailingPeriods) error +} + +type augmentConversionForCondition_FailingPeriods_STATUS interface { + AssignPropertiesFrom(src *v20220615s.Condition_FailingPeriods_STATUS) error + AssignPropertiesTo(dst *v20220615s.Condition_FailingPeriods_STATUS) error +} + +type augmentConversionForDimension interface { + AssignPropertiesFrom(src *v20220615s.Dimension) error + AssignPropertiesTo(dst *v20220615s.Dimension) error +} + +type augmentConversionForDimension_STATUS interface { + AssignPropertiesFrom(src *v20220615s.Dimension_STATUS) error + AssignPropertiesTo(dst *v20220615s.Dimension_STATUS) error +} + +func init() { + SchemeBuilder.Register(&ScheduledQueryRule{}, &ScheduledQueryRuleList{}) +} diff --git a/v2/api/insights/v1api20240101preview/storage/scheduled_query_rule_types_gen_test.go b/v2/api/insights/v1api20240101preview/storage/scheduled_query_rule_types_gen_test.go new file mode 100644 index 00000000000..4d3ddf83ad2 --- /dev/null +++ b/v2/api/insights/v1api20240101preview/storage/scheduled_query_rule_types_gen_test.go @@ -0,0 +1,2135 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + v20220615s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615/storage" + v20221001s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20221001/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_Actions_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Actions to Actions via AssignProperties_To_Actions & AssignProperties_From_Actions returns original", + prop.ForAll(RunPropertyAssignmentTestForActions, ActionsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForActions tests if a specific instance of Actions can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForActions(subject Actions) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Actions + err := copied.AssignProperties_To_Actions(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Actions + err = actual.AssignProperties_From_Actions(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Actions_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Actions via JSON returns original", + prop.ForAll(RunJSONSerializationTestForActions, ActionsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForActions runs a test to see if a specific instance of Actions round trips to JSON and back losslessly +func RunJSONSerializationTestForActions(subject Actions) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Actions + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Actions instances for property testing - lazily instantiated by ActionsGenerator() +var actionsGenerator gopter.Gen + +// ActionsGenerator returns a generator of Actions instances for property testing. +func ActionsGenerator() gopter.Gen { + if actionsGenerator != nil { + return actionsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForActions(generators) + actionsGenerator = gen.Struct(reflect.TypeOf(Actions{}), generators) + + return actionsGenerator +} + +// AddIndependentPropertyGeneratorsForActions is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForActions(gens map[string]gopter.Gen) { + gens["ActionProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["CustomProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +func Test_Actions_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Actions_STATUS to Actions_STATUS via AssignProperties_To_Actions_STATUS & AssignProperties_From_Actions_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForActions_STATUS, Actions_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForActions_STATUS tests if a specific instance of Actions_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForActions_STATUS(subject Actions_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Actions_STATUS + err := copied.AssignProperties_To_Actions_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Actions_STATUS + err = actual.AssignProperties_From_Actions_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Actions_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Actions_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForActions_STATUS, Actions_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForActions_STATUS runs a test to see if a specific instance of Actions_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForActions_STATUS(subject Actions_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Actions_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Actions_STATUS instances for property testing - lazily instantiated by Actions_STATUSGenerator() +var actions_STATUSGenerator gopter.Gen + +// Actions_STATUSGenerator returns a generator of Actions_STATUS instances for property testing. +func Actions_STATUSGenerator() gopter.Gen { + if actions_STATUSGenerator != nil { + return actions_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForActions_STATUS(generators) + actions_STATUSGenerator = gen.Struct(reflect.TypeOf(Actions_STATUS{}), generators) + + return actions_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForActions_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForActions_STATUS(gens map[string]gopter.Gen) { + gens["ActionGroups"] = gen.SliceOf(gen.AlphaString()) + gens["ActionProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["CustomProperties"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +func Test_Condition_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition to Condition via AssignProperties_To_Condition & AssignProperties_From_Condition returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition, ConditionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition tests if a specific instance of Condition can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition(subject Condition) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Condition + err := copied.AssignProperties_To_Condition(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition + err = actual.AssignProperties_From_Condition(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition, ConditionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition runs a test to see if a specific instance of Condition round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition(subject Condition) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition instances for property testing - lazily instantiated by ConditionGenerator() +var conditionGenerator gopter.Gen + +// ConditionGenerator returns a generator of Condition instances for property testing. +// We first initialize conditionGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ConditionGenerator() gopter.Gen { + if conditionGenerator != nil { + return conditionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition(generators) + conditionGenerator = gen.Struct(reflect.TypeOf(Condition{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition(generators) + AddRelatedPropertyGeneratorsForCondition(generators) + conditionGenerator = gen.Struct(reflect.TypeOf(Condition{}), generators) + + return conditionGenerator +} + +// AddIndependentPropertyGeneratorsForCondition is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition(gens map[string]gopter.Gen) { + gens["AlertSensitivity"] = gen.PtrOf(gen.AlphaString()) + gens["CriterionType"] = gen.PtrOf(gen.AlphaString()) + gens["IgnoreDataBefore"] = gen.PtrOf(gen.AlphaString()) + gens["MetricMeasureColumn"] = gen.PtrOf(gen.AlphaString()) + gens["MetricName"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.AlphaString()) + gens["Query"] = gen.PtrOf(gen.AlphaString()) + gens["Threshold"] = gen.PtrOf(gen.Float64()) + gens["TimeAggregation"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForCondition is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCondition(gens map[string]gopter.Gen) { + gens["Dimensions"] = gen.SliceOf(DimensionGenerator()) + gens["FailingPeriods"] = gen.PtrOf(Condition_FailingPeriodsGenerator()) +} + +func Test_Condition_FailingPeriods_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition_FailingPeriods to Condition_FailingPeriods via AssignProperties_To_Condition_FailingPeriods & AssignProperties_From_Condition_FailingPeriods returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition_FailingPeriods, Condition_FailingPeriodsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition_FailingPeriods tests if a specific instance of Condition_FailingPeriods can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition_FailingPeriods(subject Condition_FailingPeriods) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Condition_FailingPeriods + err := copied.AssignProperties_To_Condition_FailingPeriods(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition_FailingPeriods + err = actual.AssignProperties_From_Condition_FailingPeriods(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_FailingPeriods_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_FailingPeriods via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_FailingPeriods, Condition_FailingPeriodsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_FailingPeriods runs a test to see if a specific instance of Condition_FailingPeriods round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_FailingPeriods(subject Condition_FailingPeriods) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_FailingPeriods + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_FailingPeriods instances for property testing - lazily instantiated by +// Condition_FailingPeriodsGenerator() +var condition_FailingPeriodsGenerator gopter.Gen + +// Condition_FailingPeriodsGenerator returns a generator of Condition_FailingPeriods instances for property testing. +func Condition_FailingPeriodsGenerator() gopter.Gen { + if condition_FailingPeriodsGenerator != nil { + return condition_FailingPeriodsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_FailingPeriods(generators) + condition_FailingPeriodsGenerator = gen.Struct(reflect.TypeOf(Condition_FailingPeriods{}), generators) + + return condition_FailingPeriodsGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_FailingPeriods is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_FailingPeriods(gens map[string]gopter.Gen) { + gens["MinFailingPeriodsToAlert"] = gen.PtrOf(gen.Int()) + gens["NumberOfEvaluationPeriods"] = gen.PtrOf(gen.Int()) +} + +func Test_Condition_FailingPeriods_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition_FailingPeriods_STATUS to Condition_FailingPeriods_STATUS via AssignProperties_To_Condition_FailingPeriods_STATUS & AssignProperties_From_Condition_FailingPeriods_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition_FailingPeriods_STATUS, Condition_FailingPeriods_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition_FailingPeriods_STATUS tests if a specific instance of Condition_FailingPeriods_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition_FailingPeriods_STATUS(subject Condition_FailingPeriods_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Condition_FailingPeriods_STATUS + err := copied.AssignProperties_To_Condition_FailingPeriods_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition_FailingPeriods_STATUS + err = actual.AssignProperties_From_Condition_FailingPeriods_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_FailingPeriods_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_FailingPeriods_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_FailingPeriods_STATUS, Condition_FailingPeriods_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_FailingPeriods_STATUS runs a test to see if a specific instance of Condition_FailingPeriods_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_FailingPeriods_STATUS(subject Condition_FailingPeriods_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_FailingPeriods_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_FailingPeriods_STATUS instances for property testing - lazily instantiated by +// Condition_FailingPeriods_STATUSGenerator() +var condition_FailingPeriods_STATUSGenerator gopter.Gen + +// Condition_FailingPeriods_STATUSGenerator returns a generator of Condition_FailingPeriods_STATUS instances for property testing. +func Condition_FailingPeriods_STATUSGenerator() gopter.Gen { + if condition_FailingPeriods_STATUSGenerator != nil { + return condition_FailingPeriods_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS(generators) + condition_FailingPeriods_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_FailingPeriods_STATUS{}), generators) + + return condition_FailingPeriods_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_FailingPeriods_STATUS(gens map[string]gopter.Gen) { + gens["MinFailingPeriodsToAlert"] = gen.PtrOf(gen.Int()) + gens["NumberOfEvaluationPeriods"] = gen.PtrOf(gen.Int()) +} + +func Test_Condition_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Condition_STATUS to Condition_STATUS via AssignProperties_To_Condition_STATUS & AssignProperties_From_Condition_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCondition_STATUS, Condition_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCondition_STATUS tests if a specific instance of Condition_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCondition_STATUS(subject Condition_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Condition_STATUS + err := copied.AssignProperties_To_Condition_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Condition_STATUS + err = actual.AssignProperties_From_Condition_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Condition_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Condition_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCondition_STATUS, Condition_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCondition_STATUS runs a test to see if a specific instance of Condition_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCondition_STATUS(subject Condition_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Condition_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Condition_STATUS instances for property testing - lazily instantiated by Condition_STATUSGenerator() +var condition_STATUSGenerator gopter.Gen + +// Condition_STATUSGenerator returns a generator of Condition_STATUS instances for property testing. +// We first initialize condition_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Condition_STATUSGenerator() gopter.Gen { + if condition_STATUSGenerator != nil { + return condition_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_STATUS(generators) + condition_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCondition_STATUS(generators) + AddRelatedPropertyGeneratorsForCondition_STATUS(generators) + condition_STATUSGenerator = gen.Struct(reflect.TypeOf(Condition_STATUS{}), generators) + + return condition_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCondition_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCondition_STATUS(gens map[string]gopter.Gen) { + gens["AlertSensitivity"] = gen.PtrOf(gen.AlphaString()) + gens["CriterionType"] = gen.PtrOf(gen.AlphaString()) + gens["IgnoreDataBefore"] = gen.PtrOf(gen.AlphaString()) + gens["MetricMeasureColumn"] = gen.PtrOf(gen.AlphaString()) + gens["MetricName"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.AlphaString()) + gens["Query"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceIdColumn"] = gen.PtrOf(gen.AlphaString()) + gens["Threshold"] = gen.PtrOf(gen.Float64()) + gens["TimeAggregation"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForCondition_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCondition_STATUS(gens map[string]gopter.Gen) { + gens["Dimensions"] = gen.SliceOf(Dimension_STATUSGenerator()) + gens["FailingPeriods"] = gen.PtrOf(Condition_FailingPeriods_STATUSGenerator()) +} + +func Test_Dimension_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Dimension to Dimension via AssignProperties_To_Dimension & AssignProperties_From_Dimension returns original", + prop.ForAll(RunPropertyAssignmentTestForDimension, DimensionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDimension tests if a specific instance of Dimension can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDimension(subject Dimension) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Dimension + err := copied.AssignProperties_To_Dimension(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Dimension + err = actual.AssignProperties_From_Dimension(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Dimension_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Dimension via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDimension, DimensionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDimension runs a test to see if a specific instance of Dimension round trips to JSON and back losslessly +func RunJSONSerializationTestForDimension(subject Dimension) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Dimension + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Dimension instances for property testing - lazily instantiated by DimensionGenerator() +var dimensionGenerator gopter.Gen + +// DimensionGenerator returns a generator of Dimension instances for property testing. +func DimensionGenerator() gopter.Gen { + if dimensionGenerator != nil { + return dimensionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDimension(generators) + dimensionGenerator = gen.Struct(reflect.TypeOf(Dimension{}), generators) + + return dimensionGenerator +} + +// AddIndependentPropertyGeneratorsForDimension is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDimension(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.AlphaString()) + gens["Values"] = gen.SliceOf(gen.AlphaString()) +} + +func Test_Dimension_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Dimension_STATUS to Dimension_STATUS via AssignProperties_To_Dimension_STATUS & AssignProperties_From_Dimension_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForDimension_STATUS, Dimension_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDimension_STATUS tests if a specific instance of Dimension_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDimension_STATUS(subject Dimension_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.Dimension_STATUS + err := copied.AssignProperties_To_Dimension_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Dimension_STATUS + err = actual.AssignProperties_From_Dimension_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Dimension_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Dimension_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDimension_STATUS, Dimension_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDimension_STATUS runs a test to see if a specific instance of Dimension_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForDimension_STATUS(subject Dimension_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Dimension_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Dimension_STATUS instances for property testing - lazily instantiated by Dimension_STATUSGenerator() +var dimension_STATUSGenerator gopter.Gen + +// Dimension_STATUSGenerator returns a generator of Dimension_STATUS instances for property testing. +func Dimension_STATUSGenerator() gopter.Gen { + if dimension_STATUSGenerator != nil { + return dimension_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDimension_STATUS(generators) + dimension_STATUSGenerator = gen.Struct(reflect.TypeOf(Dimension_STATUS{}), generators) + + return dimension_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForDimension_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDimension_STATUS(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Operator"] = gen.PtrOf(gen.AlphaString()) + gens["Values"] = gen.SliceOf(gen.AlphaString()) +} + +func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity(subject Identity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() +var identityGenerator gopter.Gen + +// IdentityGenerator returns a generator of Identity instances for property testing. +// We first initialize identityGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + AddRelatedPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + return identityGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) +} + +func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() +var identity_STATUSGenerator gopter.Gen + +// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. +// We first initialize identity_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_STATUSGenerator() gopter.Gen { + if identity_STATUSGenerator != nil { + return identity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + return identity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf( + gen.AlphaString(), + UserIdentityProperties_STATUSGenerator()) +} + +func Test_RuleResolveConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RuleResolveConfiguration via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleResolveConfiguration, RuleResolveConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleResolveConfiguration runs a test to see if a specific instance of RuleResolveConfiguration round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleResolveConfiguration(subject RuleResolveConfiguration) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RuleResolveConfiguration + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RuleResolveConfiguration instances for property testing - lazily instantiated by +// RuleResolveConfigurationGenerator() +var ruleResolveConfigurationGenerator gopter.Gen + +// RuleResolveConfigurationGenerator returns a generator of RuleResolveConfiguration instances for property testing. +func RuleResolveConfigurationGenerator() gopter.Gen { + if ruleResolveConfigurationGenerator != nil { + return ruleResolveConfigurationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleResolveConfiguration(generators) + ruleResolveConfigurationGenerator = gen.Struct(reflect.TypeOf(RuleResolveConfiguration{}), generators) + + return ruleResolveConfigurationGenerator +} + +// AddIndependentPropertyGeneratorsForRuleResolveConfiguration is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleResolveConfiguration(gens map[string]gopter.Gen) { + gens["AutoResolved"] = gen.PtrOf(gen.Bool()) + gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_RuleResolveConfiguration_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RuleResolveConfiguration_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleResolveConfiguration_STATUS, RuleResolveConfiguration_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleResolveConfiguration_STATUS runs a test to see if a specific instance of RuleResolveConfiguration_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleResolveConfiguration_STATUS(subject RuleResolveConfiguration_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RuleResolveConfiguration_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RuleResolveConfiguration_STATUS instances for property testing - lazily instantiated by +// RuleResolveConfiguration_STATUSGenerator() +var ruleResolveConfiguration_STATUSGenerator gopter.Gen + +// RuleResolveConfiguration_STATUSGenerator returns a generator of RuleResolveConfiguration_STATUS instances for property testing. +func RuleResolveConfiguration_STATUSGenerator() gopter.Gen { + if ruleResolveConfiguration_STATUSGenerator != nil { + return ruleResolveConfiguration_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS(generators) + ruleResolveConfiguration_STATUSGenerator = gen.Struct(reflect.TypeOf(RuleResolveConfiguration_STATUS{}), generators) + + return ruleResolveConfiguration_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleResolveConfiguration_STATUS(gens map[string]gopter.Gen) { + gens["AutoResolved"] = gen.PtrOf(gen.Bool()) + gens["TimeToResolve"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScheduledQueryRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule to hub returns original", + prop.ForAll(RunResourceConversionTestForScheduledQueryRule, ScheduledQueryRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForScheduledQueryRule tests if a specific instance of ScheduledQueryRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForScheduledQueryRule(subject ScheduledQueryRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20220615s.ScheduledQueryRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual ScheduledQueryRule + err = actual.ConvertFrom(&hub) + if err != nil { + return err.Error() + } + + // Compare actual with what we started with + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule to ScheduledQueryRule via AssignProperties_To_ScheduledQueryRule & AssignProperties_From_ScheduledQueryRule returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRule, ScheduledQueryRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRule tests if a specific instance of ScheduledQueryRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRule(subject ScheduledQueryRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.ScheduledQueryRule + err := copied.AssignProperties_To_ScheduledQueryRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRule + err = actual.AssignProperties_From_ScheduledQueryRule(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule, ScheduledQueryRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule runs a test to see if a specific instance of ScheduledQueryRule round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule(subject ScheduledQueryRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule instances for property testing - lazily instantiated by ScheduledQueryRuleGenerator() +var scheduledQueryRuleGenerator gopter.Gen + +// ScheduledQueryRuleGenerator returns a generator of ScheduledQueryRule instances for property testing. +func ScheduledQueryRuleGenerator() gopter.Gen { + if scheduledQueryRuleGenerator != nil { + return scheduledQueryRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRule(generators) + scheduledQueryRuleGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule{}), generators) + + return scheduledQueryRuleGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule(gens map[string]gopter.Gen) { + gens["Spec"] = ScheduledQueryRule_SpecGenerator() + gens["Status"] = ScheduledQueryRule_STATUSGenerator() +} + +func Test_ScheduledQueryRuleCriteria_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRuleCriteria to ScheduledQueryRuleCriteria via AssignProperties_To_ScheduledQueryRuleCriteria & AssignProperties_From_ScheduledQueryRuleCriteria returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRuleCriteria, ScheduledQueryRuleCriteriaGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRuleCriteria tests if a specific instance of ScheduledQueryRuleCriteria can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRuleCriteria(subject ScheduledQueryRuleCriteria) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.ScheduledQueryRuleCriteria + err := copied.AssignProperties_To_ScheduledQueryRuleCriteria(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRuleCriteria + err = actual.AssignProperties_From_ScheduledQueryRuleCriteria(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRuleCriteria_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleCriteria via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleCriteria, ScheduledQueryRuleCriteriaGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleCriteria runs a test to see if a specific instance of ScheduledQueryRuleCriteria round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleCriteria(subject ScheduledQueryRuleCriteria) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleCriteria + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleCriteria instances for property testing - lazily instantiated by +// ScheduledQueryRuleCriteriaGenerator() +var scheduledQueryRuleCriteriaGenerator gopter.Gen + +// ScheduledQueryRuleCriteriaGenerator returns a generator of ScheduledQueryRuleCriteria instances for property testing. +func ScheduledQueryRuleCriteriaGenerator() gopter.Gen { + if scheduledQueryRuleCriteriaGenerator != nil { + return scheduledQueryRuleCriteriaGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria(generators) + scheduledQueryRuleCriteriaGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleCriteria{}), generators) + + return scheduledQueryRuleCriteriaGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria(gens map[string]gopter.Gen) { + gens["AllOf"] = gen.SliceOf(ConditionGenerator()) +} + +func Test_ScheduledQueryRuleCriteria_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRuleCriteria_STATUS to ScheduledQueryRuleCriteria_STATUS via AssignProperties_To_ScheduledQueryRuleCriteria_STATUS & AssignProperties_From_ScheduledQueryRuleCriteria_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRuleCriteria_STATUS, ScheduledQueryRuleCriteria_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRuleCriteria_STATUS tests if a specific instance of ScheduledQueryRuleCriteria_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRuleCriteria_STATUS(subject ScheduledQueryRuleCriteria_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.ScheduledQueryRuleCriteria_STATUS + err := copied.AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRuleCriteria_STATUS + err = actual.AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRuleCriteria_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleCriteria_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS, ScheduledQueryRuleCriteria_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS runs a test to see if a specific instance of ScheduledQueryRuleCriteria_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleCriteria_STATUS(subject ScheduledQueryRuleCriteria_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleCriteria_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleCriteria_STATUS instances for property testing - lazily instantiated by +// ScheduledQueryRuleCriteria_STATUSGenerator() +var scheduledQueryRuleCriteria_STATUSGenerator gopter.Gen + +// ScheduledQueryRuleCriteria_STATUSGenerator returns a generator of ScheduledQueryRuleCriteria_STATUS instances for property testing. +func ScheduledQueryRuleCriteria_STATUSGenerator() gopter.Gen { + if scheduledQueryRuleCriteria_STATUSGenerator != nil { + return scheduledQueryRuleCriteria_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS(generators) + scheduledQueryRuleCriteria_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleCriteria_STATUS{}), generators) + + return scheduledQueryRuleCriteria_STATUSGenerator +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRuleCriteria_STATUS(gens map[string]gopter.Gen) { + gens["AllOf"] = gen.SliceOf(Condition_STATUSGenerator()) +} + +func Test_ScheduledQueryRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRuleOperatorSpec to ScheduledQueryRuleOperatorSpec via AssignProperties_To_ScheduledQueryRuleOperatorSpec & AssignProperties_From_ScheduledQueryRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRuleOperatorSpec, ScheduledQueryRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRuleOperatorSpec tests if a specific instance of ScheduledQueryRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRuleOperatorSpec(subject ScheduledQueryRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.ScheduledQueryRuleOperatorSpec + err := copied.AssignProperties_To_ScheduledQueryRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRuleOperatorSpec + err = actual.AssignProperties_From_ScheduledQueryRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRuleOperatorSpec, ScheduledQueryRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRuleOperatorSpec runs a test to see if a specific instance of ScheduledQueryRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRuleOperatorSpec(subject ScheduledQueryRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRuleOperatorSpec instances for property testing - lazily instantiated by +// ScheduledQueryRuleOperatorSpecGenerator() +var scheduledQueryRuleOperatorSpecGenerator gopter.Gen + +// ScheduledQueryRuleOperatorSpecGenerator returns a generator of ScheduledQueryRuleOperatorSpec instances for property testing. +func ScheduledQueryRuleOperatorSpecGenerator() gopter.Gen { + if scheduledQueryRuleOperatorSpecGenerator != nil { + return scheduledQueryRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + scheduledQueryRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRuleOperatorSpec{}), generators) + + return scheduledQueryRuleOperatorSpecGenerator +} + +func Test_ScheduledQueryRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule_STATUS to ScheduledQueryRule_STATUS via AssignProperties_To_ScheduledQueryRule_STATUS & AssignProperties_From_ScheduledQueryRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRule_STATUS, ScheduledQueryRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRule_STATUS tests if a specific instance of ScheduledQueryRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRule_STATUS(subject ScheduledQueryRule_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.ScheduledQueryRule_STATUS + err := copied.AssignProperties_To_ScheduledQueryRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRule_STATUS + err = actual.AssignProperties_From_ScheduledQueryRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule_STATUS, ScheduledQueryRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule_STATUS runs a test to see if a specific instance of ScheduledQueryRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule_STATUS(subject ScheduledQueryRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule_STATUS instances for property testing - lazily instantiated by +// ScheduledQueryRule_STATUSGenerator() +var scheduledQueryRule_STATUSGenerator gopter.Gen + +// ScheduledQueryRule_STATUSGenerator returns a generator of ScheduledQueryRule_STATUS instances for property testing. +// We first initialize scheduledQueryRule_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRule_STATUSGenerator() gopter.Gen { + if scheduledQueryRule_STATUSGenerator != nil { + return scheduledQueryRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + scheduledQueryRule_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS(generators) + scheduledQueryRule_STATUSGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_STATUS{}), generators) + + return scheduledQueryRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRule_STATUS(gens map[string]gopter.Gen) { + gens["AutoMitigate"] = gen.PtrOf(gen.Bool()) + gens["CheckWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["CreatedWithApiVersion"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["EvaluationFrequency"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsLegacyLogAnalyticsRule"] = gen.PtrOf(gen.Bool()) + gens["IsWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["Kind"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MuteActionsDuration"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["OverrideQueryTimeRange"] = gen.PtrOf(gen.AlphaString()) + gens["Scopes"] = gen.SliceOf(gen.AlphaString()) + gens["Severity"] = gen.PtrOf(gen.Int()) + gens["SkipQueryValidation"] = gen.PtrOf(gen.Bool()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["TargetResourceTypes"] = gen.SliceOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["WindowSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule_STATUS(gens map[string]gopter.Gen) { + gens["Actions"] = gen.PtrOf(Actions_STATUSGenerator()) + gens["Criteria"] = gen.PtrOf(ScheduledQueryRuleCriteria_STATUSGenerator()) + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["ResolveConfiguration"] = gen.PtrOf(RuleResolveConfiguration_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_ScheduledQueryRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScheduledQueryRule_Spec to ScheduledQueryRule_Spec via AssignProperties_To_ScheduledQueryRule_Spec & AssignProperties_From_ScheduledQueryRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForScheduledQueryRule_Spec, ScheduledQueryRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScheduledQueryRule_Spec tests if a specific instance of ScheduledQueryRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForScheduledQueryRule_Spec(subject ScheduledQueryRule_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20220615s.ScheduledQueryRule_Spec + err := copied.AssignProperties_To_ScheduledQueryRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScheduledQueryRule_Spec + err = actual.AssignProperties_From_ScheduledQueryRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScheduledQueryRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScheduledQueryRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScheduledQueryRule_Spec, ScheduledQueryRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScheduledQueryRule_Spec runs a test to see if a specific instance of ScheduledQueryRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForScheduledQueryRule_Spec(subject ScheduledQueryRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScheduledQueryRule_Spec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of ScheduledQueryRule_Spec instances for property testing - lazily instantiated by +// ScheduledQueryRule_SpecGenerator() +var scheduledQueryRule_SpecGenerator gopter.Gen + +// ScheduledQueryRule_SpecGenerator returns a generator of ScheduledQueryRule_Spec instances for property testing. +// We first initialize scheduledQueryRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func ScheduledQueryRule_SpecGenerator() gopter.Gen { + if scheduledQueryRule_SpecGenerator != nil { + return scheduledQueryRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(generators) + scheduledQueryRule_SpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(generators) + AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec(generators) + scheduledQueryRule_SpecGenerator = gen.Struct(reflect.TypeOf(ScheduledQueryRule_Spec{}), generators) + + return scheduledQueryRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScheduledQueryRule_Spec(gens map[string]gopter.Gen) { + gens["AutoMitigate"] = gen.PtrOf(gen.Bool()) + gens["AzureName"] = gen.AlphaString() + gens["CheckWorkspaceAlertsStorageConfigured"] = gen.PtrOf(gen.Bool()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisplayName"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["EvaluationFrequency"] = gen.PtrOf(gen.AlphaString()) + gens["Kind"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MuteActionsDuration"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() + gens["OverrideQueryTimeRange"] = gen.PtrOf(gen.AlphaString()) + gens["Severity"] = gen.PtrOf(gen.Int()) + gens["SkipQueryValidation"] = gen.PtrOf(gen.Bool()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["TargetResourceTypes"] = gen.SliceOf(gen.AlphaString()) + gens["WindowSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScheduledQueryRule_Spec(gens map[string]gopter.Gen) { + gens["Actions"] = gen.PtrOf(ActionsGenerator()) + gens["Criteria"] = gen.PtrOf(ScheduledQueryRuleCriteriaGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(ScheduledQueryRuleOperatorSpecGenerator()) + gens["ResolveConfiguration"] = gen.PtrOf(RuleResolveConfigurationGenerator()) +} + +func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001s.SystemData_STATUS + err := copied.AssignProperties_To_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_STATUS + err = actual.AssignProperties_From_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() +var systemData_STATUSGenerator gopter.Gen + +// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. +func SystemData_STATUSGenerator() gopter.Gen { + if systemData_STATUSGenerator != nil { + return systemData_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) + systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) + + return systemData_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityDetails via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityDetails + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by +// UserAssignedIdentityDetailsGenerator() +var userAssignedIdentityDetailsGenerator gopter.Gen + +// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. +func UserAssignedIdentityDetailsGenerator() gopter.Gen { + if userAssignedIdentityDetailsGenerator != nil { + return userAssignedIdentityDetailsGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) + + return userAssignedIdentityDetailsGenerator +} + +func Test_UserIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserIdentityProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserIdentityProperties_STATUS, UserIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserIdentityProperties_STATUS runs a test to see if a specific instance of UserIdentityProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForUserIdentityProperties_STATUS(subject UserIdentityProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserIdentityProperties_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserIdentityProperties_STATUS instances for property testing - lazily instantiated by +// UserIdentityProperties_STATUSGenerator() +var userIdentityProperties_STATUSGenerator gopter.Gen + +// UserIdentityProperties_STATUSGenerator returns a generator of UserIdentityProperties_STATUS instances for property testing. +func UserIdentityProperties_STATUSGenerator() gopter.Gen { + if userIdentityProperties_STATUSGenerator != nil { + return userIdentityProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS(generators) + userIdentityProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(UserIdentityProperties_STATUS{}), generators) + + return userIdentityProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserIdentityProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/insights/v1api20240101preview/storage/structure.txt b/v2/api/insights/v1api20240101preview/storage/structure.txt new file mode 100644 index 00000000000..d53f00fdcfb --- /dev/null +++ b/v2/api/insights/v1api20240101preview/storage/structure.txt @@ -0,0 +1,160 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview/storage +------------------------------------------------------------------------------------ +APIVersion: Enum (1 value) +└── "2024-01-01-preview" +ScheduledQueryRule: Resource +├── Owner: resources/v1apiv20191001.ResourceGroup +├── Spec: Object (25 properties) +│ ├── Actions: *Object (4 properties) +│ │ ├── ActionGroupsReferences: genruntime.ResourceReference[] +│ │ ├── ActionProperties: map[string]string +│ │ ├── CustomProperties: map[string]string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── AutoMitigate: *bool +│ ├── AzureName: string +│ ├── CheckWorkspaceAlertsStorageConfigured: *bool +│ ├── Criteria: *Object (2 properties) +│ │ ├── AllOf: Object (13 properties)[] +│ │ │ ├── AlertSensitivity: *string +│ │ │ ├── CriterionType: *string +│ │ │ ├── Dimensions: Object (4 properties)[] +│ │ │ │ ├── Name: *string +│ │ │ │ ├── Operator: *string +│ │ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ │ └── Values: string[] +│ │ │ ├── FailingPeriods: *Object (3 properties) +│ │ │ │ ├── MinFailingPeriodsToAlert: *int +│ │ │ │ ├── NumberOfEvaluationPeriods: *int +│ │ │ │ └── PropertyBag: genruntime.PropertyBag +│ │ │ ├── IgnoreDataBefore: *string +│ │ │ ├── MetricMeasureColumn: *string +│ │ │ ├── MetricName: *string +│ │ │ ├── Operator: *string +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── Query: *string +│ │ │ ├── ResourceIdColumnReference: *genruntime.ResourceReference +│ │ │ ├── Threshold: *float64 +│ │ │ └── TimeAggregation: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Description: *string +│ ├── DisplayName: *string +│ ├── Enabled: *bool +│ ├── EvaluationFrequency: *string +│ ├── Identity: *Object (3 properties) +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── Type: *string +│ │ └── UserAssignedIdentities: Object (2 properties)[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── Reference: genruntime.ResourceReference +│ ├── Kind: *string +│ ├── Location: *string +│ ├── MuteActionsDuration: *string +│ ├── OperatorSpec: *Object (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── OriginalVersion: string +│ ├── OverrideQueryTimeRange: *string +│ ├── Owner: *genruntime.KnownResourceReference +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── ResolveConfiguration: *Object (3 properties) +│ │ ├── AutoResolved: *bool +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── TimeToResolve: *string +│ ├── ScopesReferences: genruntime.ResourceReference[] +│ ├── Severity: *int +│ ├── SkipQueryValidation: *bool +│ ├── Tags: map[string]string +│ ├── TargetResourceTypes: string[] +│ └── WindowSize: *string +└── Status: Object (30 properties) + ├── Actions: *Object (4 properties) + │ ├── ActionGroups: string[] + │ ├── ActionProperties: map[string]string + │ ├── CustomProperties: map[string]string + │ └── PropertyBag: genruntime.PropertyBag + ├── AutoMitigate: *bool + ├── CheckWorkspaceAlertsStorageConfigured: *bool + ├── Conditions: conditions.Condition[] + ├── CreatedWithApiVersion: *string + ├── Criteria: *Object (2 properties) + │ ├── AllOf: Object (13 properties)[] + │ │ ├── AlertSensitivity: *string + │ │ ├── CriterionType: *string + │ │ ├── Dimensions: Object (4 properties)[] + │ │ │ ├── Name: *string + │ │ │ ├── Operator: *string + │ │ │ ├── PropertyBag: genruntime.PropertyBag + │ │ │ └── Values: string[] + │ │ ├── FailingPeriods: *Object (3 properties) + │ │ │ ├── MinFailingPeriodsToAlert: *int + │ │ │ ├── NumberOfEvaluationPeriods: *int + │ │ │ └── PropertyBag: genruntime.PropertyBag + │ │ ├── IgnoreDataBefore: *string + │ │ ├── MetricMeasureColumn: *string + │ │ ├── MetricName: *string + │ │ ├── Operator: *string + │ │ ├── PropertyBag: genruntime.PropertyBag + │ │ ├── Query: *string + │ │ ├── ResourceIdColumn: *string + │ │ ├── Threshold: *float64 + │ │ └── TimeAggregation: *string + │ └── PropertyBag: genruntime.PropertyBag + ├── Description: *string + ├── DisplayName: *string + ├── Enabled: *bool + ├── Etag: *string + ├── EvaluationFrequency: *string + ├── Id: *string + ├── Identity: *Object (5 properties) + │ ├── PrincipalId: *string + │ ├── PropertyBag: genruntime.PropertyBag + │ ├── TenantId: *string + │ ├── Type: *string + │ └── UserAssignedIdentities: map[string]Object (3 properties) + │ ├── ClientId: *string + │ ├── PrincipalId: *string + │ └── PropertyBag: genruntime.PropertyBag + ├── IsLegacyLogAnalyticsRule: *bool + ├── IsWorkspaceAlertsStorageConfigured: *bool + ├── Kind: *string + ├── Location: *string + ├── MuteActionsDuration: *string + ├── Name: *string + ├── OverrideQueryTimeRange: *string + ├── PropertyBag: genruntime.PropertyBag + ├── ResolveConfiguration: *Object (3 properties) + │ ├── AutoResolved: *bool + │ ├── PropertyBag: genruntime.PropertyBag + │ └── TimeToResolve: *string + ├── Scopes: string[] + ├── Severity: *int + ├── SkipQueryValidation: *bool + ├── SystemData: *Object (7 properties) + │ ├── CreatedAt: *string + │ ├── CreatedBy: *string + │ ├── CreatedByType: *string + │ ├── LastModifiedAt: *string + │ ├── LastModifiedBy: *string + │ ├── LastModifiedByType: *string + │ └── PropertyBag: genruntime.PropertyBag + ├── Tags: map[string]string + ├── TargetResourceTypes: string[] + ├── Type: *string + └── WindowSize: *string +augmentConversionForActions: Interface +augmentConversionForActions_STATUS: Interface +augmentConversionForCondition: Interface +augmentConversionForCondition_FailingPeriods: Interface +augmentConversionForCondition_FailingPeriods_STATUS: Interface +augmentConversionForCondition_STATUS: Interface +augmentConversionForDimension: Interface +augmentConversionForDimension_STATUS: Interface +augmentConversionForScheduledQueryRule: Interface +augmentConversionForScheduledQueryRuleCriteria: Interface +augmentConversionForScheduledQueryRuleCriteria_STATUS: Interface +augmentConversionForScheduledQueryRuleOperatorSpec: Interface +augmentConversionForScheduledQueryRule_STATUS: Interface +augmentConversionForScheduledQueryRule_Spec: Interface +augmentConversionForSystemData_STATUS: Interface diff --git a/v2/api/insights/v1api20240101preview/storage/zz_generated.deepcopy.go b/v2/api/insights/v1api20240101preview/storage/zz_generated.deepcopy.go new file mode 100644 index 00000000000..2c4b03000c9 --- /dev/null +++ b/v2/api/insights/v1api20240101preview/storage/zz_generated.deepcopy.go @@ -0,0 +1,1120 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Actions) DeepCopyInto(out *Actions) { + *out = *in + if in.ActionGroupsReferences != nil { + in, out := &in.ActionGroupsReferences, &out.ActionGroupsReferences + *out = make([]genruntime.ResourceReference, len(*in)) + copy(*out, *in) + } + if in.ActionProperties != nil { + in, out := &in.ActionProperties, &out.ActionProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CustomProperties != nil { + in, out := &in.CustomProperties, &out.CustomProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Actions. +func (in *Actions) DeepCopy() *Actions { + if in == nil { + return nil + } + out := new(Actions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Actions_STATUS) DeepCopyInto(out *Actions_STATUS) { + *out = *in + if in.ActionGroups != nil { + in, out := &in.ActionGroups, &out.ActionGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ActionProperties != nil { + in, out := &in.ActionProperties, &out.ActionProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CustomProperties != nil { + in, out := &in.CustomProperties, &out.CustomProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Actions_STATUS. +func (in *Actions_STATUS) DeepCopy() *Actions_STATUS { + if in == nil { + return nil + } + out := new(Actions_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + if in.AlertSensitivity != nil { + in, out := &in.AlertSensitivity, &out.AlertSensitivity + *out = new(string) + **out = **in + } + if in.CriterionType != nil { + in, out := &in.CriterionType, &out.CriterionType + *out = new(string) + **out = **in + } + if in.Dimensions != nil { + in, out := &in.Dimensions, &out.Dimensions + *out = make([]Dimension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailingPeriods != nil { + in, out := &in.FailingPeriods, &out.FailingPeriods + *out = new(Condition_FailingPeriods) + (*in).DeepCopyInto(*out) + } + if in.IgnoreDataBefore != nil { + in, out := &in.IgnoreDataBefore, &out.IgnoreDataBefore + *out = new(string) + **out = **in + } + if in.MetricMeasureColumn != nil { + in, out := &in.MetricMeasureColumn, &out.MetricMeasureColumn + *out = new(string) + **out = **in + } + if in.MetricName != nil { + in, out := &in.MetricName, &out.MetricName + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Query != nil { + in, out := &in.Query, &out.Query + *out = new(string) + **out = **in + } + if in.ResourceIdColumnReference != nil { + in, out := &in.ResourceIdColumnReference, &out.ResourceIdColumnReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.Threshold != nil { + in, out := &in.Threshold, &out.Threshold + *out = new(float64) + **out = **in + } + if in.TimeAggregation != nil { + in, out := &in.TimeAggregation, &out.TimeAggregation + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition_FailingPeriods) DeepCopyInto(out *Condition_FailingPeriods) { + *out = *in + if in.MinFailingPeriodsToAlert != nil { + in, out := &in.MinFailingPeriodsToAlert, &out.MinFailingPeriodsToAlert + *out = new(int) + **out = **in + } + if in.NumberOfEvaluationPeriods != nil { + in, out := &in.NumberOfEvaluationPeriods, &out.NumberOfEvaluationPeriods + *out = new(int) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition_FailingPeriods. +func (in *Condition_FailingPeriods) DeepCopy() *Condition_FailingPeriods { + if in == nil { + return nil + } + out := new(Condition_FailingPeriods) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition_FailingPeriods_STATUS) DeepCopyInto(out *Condition_FailingPeriods_STATUS) { + *out = *in + if in.MinFailingPeriodsToAlert != nil { + in, out := &in.MinFailingPeriodsToAlert, &out.MinFailingPeriodsToAlert + *out = new(int) + **out = **in + } + if in.NumberOfEvaluationPeriods != nil { + in, out := &in.NumberOfEvaluationPeriods, &out.NumberOfEvaluationPeriods + *out = new(int) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition_FailingPeriods_STATUS. +func (in *Condition_FailingPeriods_STATUS) DeepCopy() *Condition_FailingPeriods_STATUS { + if in == nil { + return nil + } + out := new(Condition_FailingPeriods_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition_STATUS) DeepCopyInto(out *Condition_STATUS) { + *out = *in + if in.AlertSensitivity != nil { + in, out := &in.AlertSensitivity, &out.AlertSensitivity + *out = new(string) + **out = **in + } + if in.CriterionType != nil { + in, out := &in.CriterionType, &out.CriterionType + *out = new(string) + **out = **in + } + if in.Dimensions != nil { + in, out := &in.Dimensions, &out.Dimensions + *out = make([]Dimension_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailingPeriods != nil { + in, out := &in.FailingPeriods, &out.FailingPeriods + *out = new(Condition_FailingPeriods_STATUS) + (*in).DeepCopyInto(*out) + } + if in.IgnoreDataBefore != nil { + in, out := &in.IgnoreDataBefore, &out.IgnoreDataBefore + *out = new(string) + **out = **in + } + if in.MetricMeasureColumn != nil { + in, out := &in.MetricMeasureColumn, &out.MetricMeasureColumn + *out = new(string) + **out = **in + } + if in.MetricName != nil { + in, out := &in.MetricName, &out.MetricName + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Query != nil { + in, out := &in.Query, &out.Query + *out = new(string) + **out = **in + } + if in.ResourceIdColumn != nil { + in, out := &in.ResourceIdColumn, &out.ResourceIdColumn + *out = new(string) + **out = **in + } + if in.Threshold != nil { + in, out := &in.Threshold, &out.Threshold + *out = new(float64) + **out = **in + } + if in.TimeAggregation != nil { + in, out := &in.TimeAggregation, &out.TimeAggregation + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition_STATUS. +func (in *Condition_STATUS) DeepCopy() *Condition_STATUS { + if in == nil { + return nil + } + out := new(Condition_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Dimension) DeepCopyInto(out *Dimension) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dimension. +func (in *Dimension) DeepCopy() *Dimension { + if in == nil { + return nil + } + out := new(Dimension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Dimension_STATUS) DeepCopyInto(out *Dimension_STATUS) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dimension_STATUS. +func (in *Dimension_STATUS) DeepCopy() *Dimension_STATUS { + if in == nil { + return nil + } + out := new(Dimension_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity) DeepCopyInto(out *Identity) { + *out = *in + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make([]UserAssignedIdentityDetails, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. +func (in *Identity) DeepCopy() *Identity { + if in == nil { + return nil + } + out := new(Identity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity_STATUS) DeepCopyInto(out *Identity_STATUS) { + *out = *in + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]UserIdentityProperties_STATUS, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity_STATUS. +func (in *Identity_STATUS) DeepCopy() *Identity_STATUS { + if in == nil { + return nil + } + out := new(Identity_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuleResolveConfiguration) DeepCopyInto(out *RuleResolveConfiguration) { + *out = *in + if in.AutoResolved != nil { + in, out := &in.AutoResolved, &out.AutoResolved + *out = new(bool) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TimeToResolve != nil { + in, out := &in.TimeToResolve, &out.TimeToResolve + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleResolveConfiguration. +func (in *RuleResolveConfiguration) DeepCopy() *RuleResolveConfiguration { + if in == nil { + return nil + } + out := new(RuleResolveConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuleResolveConfiguration_STATUS) DeepCopyInto(out *RuleResolveConfiguration_STATUS) { + *out = *in + if in.AutoResolved != nil { + in, out := &in.AutoResolved, &out.AutoResolved + *out = new(bool) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TimeToResolve != nil { + in, out := &in.TimeToResolve, &out.TimeToResolve + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleResolveConfiguration_STATUS. +func (in *RuleResolveConfiguration_STATUS) DeepCopy() *RuleResolveConfiguration_STATUS { + if in == nil { + return nil + } + out := new(RuleResolveConfiguration_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRule) DeepCopyInto(out *ScheduledQueryRule) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRule. +func (in *ScheduledQueryRule) DeepCopy() *ScheduledQueryRule { + if in == nil { + return nil + } + out := new(ScheduledQueryRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ScheduledQueryRule) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleCriteria) DeepCopyInto(out *ScheduledQueryRuleCriteria) { + *out = *in + if in.AllOf != nil { + in, out := &in.AllOf, &out.AllOf + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleCriteria. +func (in *ScheduledQueryRuleCriteria) DeepCopy() *ScheduledQueryRuleCriteria { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleCriteria) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleCriteria_STATUS) DeepCopyInto(out *ScheduledQueryRuleCriteria_STATUS) { + *out = *in + if in.AllOf != nil { + in, out := &in.AllOf, &out.AllOf + *out = make([]Condition_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleCriteria_STATUS. +func (in *ScheduledQueryRuleCriteria_STATUS) DeepCopy() *ScheduledQueryRuleCriteria_STATUS { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleCriteria_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleList) DeepCopyInto(out *ScheduledQueryRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ScheduledQueryRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleList. +func (in *ScheduledQueryRuleList) DeepCopy() *ScheduledQueryRuleList { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ScheduledQueryRuleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleOperatorSpec) DeepCopyInto(out *ScheduledQueryRuleOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleOperatorSpec. +func (in *ScheduledQueryRuleOperatorSpec) DeepCopy() *ScheduledQueryRuleOperatorSpec { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRule_STATUS) DeepCopyInto(out *ScheduledQueryRule_STATUS) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = new(Actions_STATUS) + (*in).DeepCopyInto(*out) + } + if in.AutoMitigate != nil { + in, out := &in.AutoMitigate, &out.AutoMitigate + *out = new(bool) + **out = **in + } + if in.CheckWorkspaceAlertsStorageConfigured != nil { + in, out := &in.CheckWorkspaceAlertsStorageConfigured, &out.CheckWorkspaceAlertsStorageConfigured + *out = new(bool) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]conditions.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CreatedWithApiVersion != nil { + in, out := &in.CreatedWithApiVersion, &out.CreatedWithApiVersion + *out = new(string) + **out = **in + } + if in.Criteria != nil { + in, out := &in.Criteria, &out.Criteria + *out = new(ScheduledQueryRuleCriteria_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.EvaluationFrequency != nil { + in, out := &in.EvaluationFrequency, &out.EvaluationFrequency + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity_STATUS) + (*in).DeepCopyInto(*out) + } + if in.IsLegacyLogAnalyticsRule != nil { + in, out := &in.IsLegacyLogAnalyticsRule, &out.IsLegacyLogAnalyticsRule + *out = new(bool) + **out = **in + } + if in.IsWorkspaceAlertsStorageConfigured != nil { + in, out := &in.IsWorkspaceAlertsStorageConfigured, &out.IsWorkspaceAlertsStorageConfigured + *out = new(bool) + **out = **in + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MuteActionsDuration != nil { + in, out := &in.MuteActionsDuration, &out.MuteActionsDuration + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OverrideQueryTimeRange != nil { + in, out := &in.OverrideQueryTimeRange, &out.OverrideQueryTimeRange + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ResolveConfiguration != nil { + in, out := &in.ResolveConfiguration, &out.ResolveConfiguration + *out = new(RuleResolveConfiguration_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Severity != nil { + in, out := &in.Severity, &out.Severity + *out = new(int) + **out = **in + } + if in.SkipQueryValidation != nil { + in, out := &in.SkipQueryValidation, &out.SkipQueryValidation + *out = new(bool) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TargetResourceTypes != nil { + in, out := &in.TargetResourceTypes, &out.TargetResourceTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.WindowSize != nil { + in, out := &in.WindowSize, &out.WindowSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRule_STATUS. +func (in *ScheduledQueryRule_STATUS) DeepCopy() *ScheduledQueryRule_STATUS { + if in == nil { + return nil + } + out := new(ScheduledQueryRule_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRule_Spec) DeepCopyInto(out *ScheduledQueryRule_Spec) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = new(Actions) + (*in).DeepCopyInto(*out) + } + if in.AutoMitigate != nil { + in, out := &in.AutoMitigate, &out.AutoMitigate + *out = new(bool) + **out = **in + } + if in.CheckWorkspaceAlertsStorageConfigured != nil { + in, out := &in.CheckWorkspaceAlertsStorageConfigured, &out.CheckWorkspaceAlertsStorageConfigured + *out = new(bool) + **out = **in + } + if in.Criteria != nil { + in, out := &in.Criteria, &out.Criteria + *out = new(ScheduledQueryRuleCriteria) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.EvaluationFrequency != nil { + in, out := &in.EvaluationFrequency, &out.EvaluationFrequency + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MuteActionsDuration != nil { + in, out := &in.MuteActionsDuration, &out.MuteActionsDuration + *out = new(string) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(ScheduledQueryRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.OverrideQueryTimeRange != nil { + in, out := &in.OverrideQueryTimeRange, &out.OverrideQueryTimeRange + *out = new(string) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ResolveConfiguration != nil { + in, out := &in.ResolveConfiguration, &out.ResolveConfiguration + *out = new(RuleResolveConfiguration) + (*in).DeepCopyInto(*out) + } + if in.ScopesReferences != nil { + in, out := &in.ScopesReferences, &out.ScopesReferences + *out = make([]genruntime.ResourceReference, len(*in)) + copy(*out, *in) + } + if in.Severity != nil { + in, out := &in.Severity, &out.Severity + *out = new(int) + **out = **in + } + if in.SkipQueryValidation != nil { + in, out := &in.SkipQueryValidation, &out.SkipQueryValidation + *out = new(bool) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TargetResourceTypes != nil { + in, out := &in.TargetResourceTypes, &out.TargetResourceTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.WindowSize != nil { + in, out := &in.WindowSize, &out.WindowSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRule_Spec. +func (in *ScheduledQueryRule_Spec) DeepCopy() *ScheduledQueryRule_Spec { + if in == nil { + return nil + } + out := new(ScheduledQueryRule_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.CreatedBy != nil { + in, out := &in.CreatedBy, &out.CreatedBy + *out = new(string) + **out = **in + } + if in.CreatedByType != nil { + in, out := &in.CreatedByType, &out.CreatedByType + *out = new(string) + **out = **in + } + if in.LastModifiedAt != nil { + in, out := &in.LastModifiedAt, &out.LastModifiedAt + *out = new(string) + **out = **in + } + if in.LastModifiedBy != nil { + in, out := &in.LastModifiedBy, &out.LastModifiedBy + *out = new(string) + **out = **in + } + if in.LastModifiedByType != nil { + in, out := &in.LastModifiedByType, &out.LastModifiedByType + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS. +func (in *SystemData_STATUS) DeepCopy() *SystemData_STATUS { + if in == nil { + return nil + } + out := new(SystemData_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityDetails) DeepCopyInto(out *UserAssignedIdentityDetails) { + *out = *in + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + out.Reference = in.Reference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails. +func (in *UserAssignedIdentityDetails) DeepCopy() *UserAssignedIdentityDetails { + if in == nil { + return nil + } + out := new(UserAssignedIdentityDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserIdentityProperties_STATUS) DeepCopyInto(out *UserIdentityProperties_STATUS) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserIdentityProperties_STATUS. +func (in *UserIdentityProperties_STATUS) DeepCopy() *UserIdentityProperties_STATUS { + if in == nil { + return nil + } + out := new(UserIdentityProperties_STATUS) + in.DeepCopyInto(out) + return out +} diff --git a/v2/api/insights/v1api20240101preview/structure.txt b/v2/api/insights/v1api20240101preview/structure.txt new file mode 100644 index 00000000000..f9162f2456f --- /dev/null +++ b/v2/api/insights/v1api20240101preview/structure.txt @@ -0,0 +1,185 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview +---------------------------------------------------------------------------- +APIVersion: Enum (1 value) +└── "2024-01-01-preview" +ScheduledQueryRule: Resource +├── Owner: resources/v1apiv20191001.ResourceGroup +├── Spec: Object (23 properties) +│ ├── Actions: *Object (3 properties) +│ │ ├── ActionGroupsReferences: genruntime.ResourceReference[] +│ │ ├── ActionProperties: map[string]string +│ │ └── CustomProperties: map[string]string +│ ├── AutoMitigate: *bool +│ ├── AzureName: Validated (1 rule) +│ │ └── Rule 0: Pattern: "^[^#<>%&:\\?/{}*]{1,260}$" +│ ├── CheckWorkspaceAlertsStorageConfigured: *bool +│ ├── Criteria: *Object (1 property) +│ │ └── AllOf: Object (12 properties)[] +│ │ ├── AlertSensitivity: *string +│ │ ├── CriterionType: *Enum (2 values) +│ │ │ ├── "DynamicThresholdCriterion" +│ │ │ └── "StaticThresholdCriterion" +│ │ ├── Dimensions: Object (3 properties)[] +│ │ │ ├── Name: *string +│ │ │ ├── Operator: *Enum (2 values) +│ │ │ │ ├── "Exclude" +│ │ │ │ └── "Include" +│ │ │ └── Values: string[] +│ │ ├── FailingPeriods: *Object (2 properties) +│ │ │ ├── MinFailingPeriodsToAlert: *int +│ │ │ └── NumberOfEvaluationPeriods: *int +│ │ ├── IgnoreDataBefore: *string +│ │ ├── MetricMeasureColumn: *string +│ │ ├── MetricName: *string +│ │ ├── Operator: *Enum (6 values) +│ │ │ ├── "Equals" +│ │ │ ├── "GreaterOrLessThan" +│ │ │ ├── "GreaterThan" +│ │ │ ├── "GreaterThanOrEqual" +│ │ │ ├── "LessThan" +│ │ │ └── "LessThanOrEqual" +│ │ ├── Query: *string +│ │ ├── ResourceIdColumnReference: *genruntime.ResourceReference +│ │ ├── Threshold: *float64 +│ │ └── TimeAggregation: *Enum (5 values) +│ │ ├── "Average" +│ │ ├── "Count" +│ │ ├── "Maximum" +│ │ ├── "Minimum" +│ │ └── "Total" +│ ├── Description: *string +│ ├── DisplayName: *string +│ ├── Enabled: *bool +│ ├── EvaluationFrequency: *string +│ ├── Identity: *Object (2 properties) +│ │ ├── Type: *Enum (3 values) +│ │ │ ├── "None" +│ │ │ ├── "SystemAssigned" +│ │ │ └── "UserAssigned" +│ │ └── UserAssignedIdentities: Object (1 property)[] +│ │ └── Reference: genruntime.ResourceReference +│ ├── Kind: *Enum (3 values) +│ │ ├── "EventLogAlert" +│ │ ├── "LogAlert" +│ │ └── "LogToMetric" +│ ├── Location: *string +│ ├── MuteActionsDuration: *string +│ ├── OperatorSpec: *Object (2 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── OverrideQueryTimeRange: *string +│ ├── Owner: *genruntime.KnownResourceReference +│ ├── ResolveConfiguration: *Object (2 properties) +│ │ ├── AutoResolved: *bool +│ │ └── TimeToResolve: *string +│ ├── ScopesReferences: genruntime.ResourceReference[] +│ ├── Severity: *Enum (5 values) +│ │ ├── 0 +│ │ ├── 1 +│ │ ├── 2 +│ │ ├── 3 +│ │ └── 4 +│ ├── SkipQueryValidation: *bool +│ ├── Tags: map[string]string +│ ├── TargetResourceTypes: string[] +│ └── WindowSize: *string +└── Status: Object (29 properties) + ├── Actions: *Object (3 properties) + │ ├── ActionGroups: string[] + │ ├── ActionProperties: map[string]string + │ └── CustomProperties: map[string]string + ├── AutoMitigate: *bool + ├── CheckWorkspaceAlertsStorageConfigured: *bool + ├── Conditions: conditions.Condition[] + ├── CreatedWithApiVersion: *string + ├── Criteria: *Object (1 property) + │ └── AllOf: Object (12 properties)[] + │ ├── AlertSensitivity: *string + │ ├── CriterionType: *Enum (2 values) + │ │ ├── "DynamicThresholdCriterion" + │ │ └── "StaticThresholdCriterion" + │ ├── Dimensions: Object (3 properties)[] + │ │ ├── Name: *string + │ │ ├── Operator: *Enum (2 values) + │ │ │ ├── "Exclude" + │ │ │ └── "Include" + │ │ └── Values: string[] + │ ├── FailingPeriods: *Object (2 properties) + │ │ ├── MinFailingPeriodsToAlert: *int + │ │ └── NumberOfEvaluationPeriods: *int + │ ├── IgnoreDataBefore: *string + │ ├── MetricMeasureColumn: *string + │ ├── MetricName: *string + │ ├── Operator: *Enum (6 values) + │ │ ├── "Equals" + │ │ ├── "GreaterOrLessThan" + │ │ ├── "GreaterThan" + │ │ ├── "GreaterThanOrEqual" + │ │ ├── "LessThan" + │ │ └── "LessThanOrEqual" + │ ├── Query: *string + │ ├── ResourceIdColumn: *string + │ ├── Threshold: *float64 + │ └── TimeAggregation: *Enum (5 values) + │ ├── "Average" + │ ├── "Count" + │ ├── "Maximum" + │ ├── "Minimum" + │ └── "Total" + ├── Description: *string + ├── DisplayName: *string + ├── Enabled: *bool + ├── Etag: *string + ├── EvaluationFrequency: *string + ├── Id: *string + ├── Identity: *Object (4 properties) + │ ├── PrincipalId: *string + │ ├── TenantId: *string + │ ├── Type: *Enum (3 values) + │ │ ├── "None" + │ │ ├── "SystemAssigned" + │ │ └── "UserAssigned" + │ └── UserAssignedIdentities: map[string]Object (2 properties) + │ ├── ClientId: *string + │ └── PrincipalId: *string + ├── IsLegacyLogAnalyticsRule: *bool + ├── IsWorkspaceAlertsStorageConfigured: *bool + ├── Kind: *Enum (3 values) + │ ├── "EventLogAlert" + │ ├── "LogAlert" + │ └── "LogToMetric" + ├── Location: *string + ├── MuteActionsDuration: *string + ├── Name: *string + ├── OverrideQueryTimeRange: *string + ├── ResolveConfiguration: *Object (2 properties) + │ ├── AutoResolved: *bool + │ └── TimeToResolve: *string + ├── Scopes: string[] + ├── Severity: *Enum (5 values) + │ ├── 0 + │ ├── 1 + │ ├── 2 + │ ├── 3 + │ └── 4 + ├── SkipQueryValidation: *bool + ├── SystemData: *Object (6 properties) + │ ├── CreatedAt: *string + │ ├── CreatedBy: *string + │ ├── CreatedByType: *Enum (4 values) + │ │ ├── "Application" + │ │ ├── "Key" + │ │ ├── "ManagedIdentity" + │ │ └── "User" + │ ├── LastModifiedAt: *string + │ ├── LastModifiedBy: *string + │ └── LastModifiedByType: *Enum (4 values) + │ ├── "Application" + │ ├── "Key" + │ ├── "ManagedIdentity" + │ └── "User" + ├── Tags: map[string]string + ├── TargetResourceTypes: string[] + ├── Type: *string + └── WindowSize: *string diff --git a/v2/api/insights/v1api20240101preview/zz_generated.deepcopy.go b/v2/api/insights/v1api20240101preview/zz_generated.deepcopy.go new file mode 100644 index 00000000000..5d848885342 --- /dev/null +++ b/v2/api/insights/v1api20240101preview/zz_generated.deepcopy.go @@ -0,0 +1,978 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20240101preview + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Actions) DeepCopyInto(out *Actions) { + *out = *in + if in.ActionGroupsReferences != nil { + in, out := &in.ActionGroupsReferences, &out.ActionGroupsReferences + *out = make([]genruntime.ResourceReference, len(*in)) + copy(*out, *in) + } + if in.ActionProperties != nil { + in, out := &in.ActionProperties, &out.ActionProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CustomProperties != nil { + in, out := &in.CustomProperties, &out.CustomProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Actions. +func (in *Actions) DeepCopy() *Actions { + if in == nil { + return nil + } + out := new(Actions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Actions_STATUS) DeepCopyInto(out *Actions_STATUS) { + *out = *in + if in.ActionGroups != nil { + in, out := &in.ActionGroups, &out.ActionGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ActionProperties != nil { + in, out := &in.ActionProperties, &out.ActionProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CustomProperties != nil { + in, out := &in.CustomProperties, &out.CustomProperties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Actions_STATUS. +func (in *Actions_STATUS) DeepCopy() *Actions_STATUS { + if in == nil { + return nil + } + out := new(Actions_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + if in.AlertSensitivity != nil { + in, out := &in.AlertSensitivity, &out.AlertSensitivity + *out = new(string) + **out = **in + } + if in.CriterionType != nil { + in, out := &in.CriterionType, &out.CriterionType + *out = new(Condition_CriterionType) + **out = **in + } + if in.Dimensions != nil { + in, out := &in.Dimensions, &out.Dimensions + *out = make([]Dimension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailingPeriods != nil { + in, out := &in.FailingPeriods, &out.FailingPeriods + *out = new(Condition_FailingPeriods) + (*in).DeepCopyInto(*out) + } + if in.IgnoreDataBefore != nil { + in, out := &in.IgnoreDataBefore, &out.IgnoreDataBefore + *out = new(string) + **out = **in + } + if in.MetricMeasureColumn != nil { + in, out := &in.MetricMeasureColumn, &out.MetricMeasureColumn + *out = new(string) + **out = **in + } + if in.MetricName != nil { + in, out := &in.MetricName, &out.MetricName + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(Condition_Operator) + **out = **in + } + if in.Query != nil { + in, out := &in.Query, &out.Query + *out = new(string) + **out = **in + } + if in.ResourceIdColumnReference != nil { + in, out := &in.ResourceIdColumnReference, &out.ResourceIdColumnReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.Threshold != nil { + in, out := &in.Threshold, &out.Threshold + *out = new(float64) + **out = **in + } + if in.TimeAggregation != nil { + in, out := &in.TimeAggregation, &out.TimeAggregation + *out = new(Condition_TimeAggregation) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition_FailingPeriods) DeepCopyInto(out *Condition_FailingPeriods) { + *out = *in + if in.MinFailingPeriodsToAlert != nil { + in, out := &in.MinFailingPeriodsToAlert, &out.MinFailingPeriodsToAlert + *out = new(int) + **out = **in + } + if in.NumberOfEvaluationPeriods != nil { + in, out := &in.NumberOfEvaluationPeriods, &out.NumberOfEvaluationPeriods + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition_FailingPeriods. +func (in *Condition_FailingPeriods) DeepCopy() *Condition_FailingPeriods { + if in == nil { + return nil + } + out := new(Condition_FailingPeriods) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition_FailingPeriods_STATUS) DeepCopyInto(out *Condition_FailingPeriods_STATUS) { + *out = *in + if in.MinFailingPeriodsToAlert != nil { + in, out := &in.MinFailingPeriodsToAlert, &out.MinFailingPeriodsToAlert + *out = new(int) + **out = **in + } + if in.NumberOfEvaluationPeriods != nil { + in, out := &in.NumberOfEvaluationPeriods, &out.NumberOfEvaluationPeriods + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition_FailingPeriods_STATUS. +func (in *Condition_FailingPeriods_STATUS) DeepCopy() *Condition_FailingPeriods_STATUS { + if in == nil { + return nil + } + out := new(Condition_FailingPeriods_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition_STATUS) DeepCopyInto(out *Condition_STATUS) { + *out = *in + if in.AlertSensitivity != nil { + in, out := &in.AlertSensitivity, &out.AlertSensitivity + *out = new(string) + **out = **in + } + if in.CriterionType != nil { + in, out := &in.CriterionType, &out.CriterionType + *out = new(Condition_CriterionType_STATUS) + **out = **in + } + if in.Dimensions != nil { + in, out := &in.Dimensions, &out.Dimensions + *out = make([]Dimension_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailingPeriods != nil { + in, out := &in.FailingPeriods, &out.FailingPeriods + *out = new(Condition_FailingPeriods_STATUS) + (*in).DeepCopyInto(*out) + } + if in.IgnoreDataBefore != nil { + in, out := &in.IgnoreDataBefore, &out.IgnoreDataBefore + *out = new(string) + **out = **in + } + if in.MetricMeasureColumn != nil { + in, out := &in.MetricMeasureColumn, &out.MetricMeasureColumn + *out = new(string) + **out = **in + } + if in.MetricName != nil { + in, out := &in.MetricName, &out.MetricName + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(Condition_Operator_STATUS) + **out = **in + } + if in.Query != nil { + in, out := &in.Query, &out.Query + *out = new(string) + **out = **in + } + if in.ResourceIdColumn != nil { + in, out := &in.ResourceIdColumn, &out.ResourceIdColumn + *out = new(string) + **out = **in + } + if in.Threshold != nil { + in, out := &in.Threshold, &out.Threshold + *out = new(float64) + **out = **in + } + if in.TimeAggregation != nil { + in, out := &in.TimeAggregation, &out.TimeAggregation + *out = new(Condition_TimeAggregation_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition_STATUS. +func (in *Condition_STATUS) DeepCopy() *Condition_STATUS { + if in == nil { + return nil + } + out := new(Condition_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Dimension) DeepCopyInto(out *Dimension) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(Dimension_Operator) + **out = **in + } + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dimension. +func (in *Dimension) DeepCopy() *Dimension { + if in == nil { + return nil + } + out := new(Dimension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Dimension_STATUS) DeepCopyInto(out *Dimension_STATUS) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(Dimension_Operator_STATUS) + **out = **in + } + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dimension_STATUS. +func (in *Dimension_STATUS) DeepCopy() *Dimension_STATUS { + if in == nil { + return nil + } + out := new(Dimension_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity) DeepCopyInto(out *Identity) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make([]UserAssignedIdentityDetails, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. +func (in *Identity) DeepCopy() *Identity { + if in == nil { + return nil + } + out := new(Identity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity_STATUS) DeepCopyInto(out *Identity_STATUS) { + *out = *in + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type_STATUS) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]UserIdentityProperties_STATUS, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity_STATUS. +func (in *Identity_STATUS) DeepCopy() *Identity_STATUS { + if in == nil { + return nil + } + out := new(Identity_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuleResolveConfiguration) DeepCopyInto(out *RuleResolveConfiguration) { + *out = *in + if in.AutoResolved != nil { + in, out := &in.AutoResolved, &out.AutoResolved + *out = new(bool) + **out = **in + } + if in.TimeToResolve != nil { + in, out := &in.TimeToResolve, &out.TimeToResolve + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleResolveConfiguration. +func (in *RuleResolveConfiguration) DeepCopy() *RuleResolveConfiguration { + if in == nil { + return nil + } + out := new(RuleResolveConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RuleResolveConfiguration_STATUS) DeepCopyInto(out *RuleResolveConfiguration_STATUS) { + *out = *in + if in.AutoResolved != nil { + in, out := &in.AutoResolved, &out.AutoResolved + *out = new(bool) + **out = **in + } + if in.TimeToResolve != nil { + in, out := &in.TimeToResolve, &out.TimeToResolve + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleResolveConfiguration_STATUS. +func (in *RuleResolveConfiguration_STATUS) DeepCopy() *RuleResolveConfiguration_STATUS { + if in == nil { + return nil + } + out := new(RuleResolveConfiguration_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRule) DeepCopyInto(out *ScheduledQueryRule) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRule. +func (in *ScheduledQueryRule) DeepCopy() *ScheduledQueryRule { + if in == nil { + return nil + } + out := new(ScheduledQueryRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ScheduledQueryRule) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleCriteria) DeepCopyInto(out *ScheduledQueryRuleCriteria) { + *out = *in + if in.AllOf != nil { + in, out := &in.AllOf, &out.AllOf + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleCriteria. +func (in *ScheduledQueryRuleCriteria) DeepCopy() *ScheduledQueryRuleCriteria { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleCriteria) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleCriteria_STATUS) DeepCopyInto(out *ScheduledQueryRuleCriteria_STATUS) { + *out = *in + if in.AllOf != nil { + in, out := &in.AllOf, &out.AllOf + *out = make([]Condition_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleCriteria_STATUS. +func (in *ScheduledQueryRuleCriteria_STATUS) DeepCopy() *ScheduledQueryRuleCriteria_STATUS { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleCriteria_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleList) DeepCopyInto(out *ScheduledQueryRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ScheduledQueryRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleList. +func (in *ScheduledQueryRuleList) DeepCopy() *ScheduledQueryRuleList { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ScheduledQueryRuleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRuleOperatorSpec) DeepCopyInto(out *ScheduledQueryRuleOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRuleOperatorSpec. +func (in *ScheduledQueryRuleOperatorSpec) DeepCopy() *ScheduledQueryRuleOperatorSpec { + if in == nil { + return nil + } + out := new(ScheduledQueryRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRule_STATUS) DeepCopyInto(out *ScheduledQueryRule_STATUS) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = new(Actions_STATUS) + (*in).DeepCopyInto(*out) + } + if in.AutoMitigate != nil { + in, out := &in.AutoMitigate, &out.AutoMitigate + *out = new(bool) + **out = **in + } + if in.CheckWorkspaceAlertsStorageConfigured != nil { + in, out := &in.CheckWorkspaceAlertsStorageConfigured, &out.CheckWorkspaceAlertsStorageConfigured + *out = new(bool) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]conditions.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CreatedWithApiVersion != nil { + in, out := &in.CreatedWithApiVersion, &out.CreatedWithApiVersion + *out = new(string) + **out = **in + } + if in.Criteria != nil { + in, out := &in.Criteria, &out.Criteria + *out = new(ScheduledQueryRuleCriteria_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.EvaluationFrequency != nil { + in, out := &in.EvaluationFrequency, &out.EvaluationFrequency + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity_STATUS) + (*in).DeepCopyInto(*out) + } + if in.IsLegacyLogAnalyticsRule != nil { + in, out := &in.IsLegacyLogAnalyticsRule, &out.IsLegacyLogAnalyticsRule + *out = new(bool) + **out = **in + } + if in.IsWorkspaceAlertsStorageConfigured != nil { + in, out := &in.IsWorkspaceAlertsStorageConfigured, &out.IsWorkspaceAlertsStorageConfigured + *out = new(bool) + **out = **in + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(ScheduledQueryRule_Kind_STATUS) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MuteActionsDuration != nil { + in, out := &in.MuteActionsDuration, &out.MuteActionsDuration + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OverrideQueryTimeRange != nil { + in, out := &in.OverrideQueryTimeRange, &out.OverrideQueryTimeRange + *out = new(string) + **out = **in + } + if in.ResolveConfiguration != nil { + in, out := &in.ResolveConfiguration, &out.ResolveConfiguration + *out = new(RuleResolveConfiguration_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Severity != nil { + in, out := &in.Severity, &out.Severity + *out = new(ScheduledQueryRuleProperties_Severity_STATUS) + **out = **in + } + if in.SkipQueryValidation != nil { + in, out := &in.SkipQueryValidation, &out.SkipQueryValidation + *out = new(bool) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TargetResourceTypes != nil { + in, out := &in.TargetResourceTypes, &out.TargetResourceTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.WindowSize != nil { + in, out := &in.WindowSize, &out.WindowSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRule_STATUS. +func (in *ScheduledQueryRule_STATUS) DeepCopy() *ScheduledQueryRule_STATUS { + if in == nil { + return nil + } + out := new(ScheduledQueryRule_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduledQueryRule_Spec) DeepCopyInto(out *ScheduledQueryRule_Spec) { + *out = *in + if in.Actions != nil { + in, out := &in.Actions, &out.Actions + *out = new(Actions) + (*in).DeepCopyInto(*out) + } + if in.AutoMitigate != nil { + in, out := &in.AutoMitigate, &out.AutoMitigate + *out = new(bool) + **out = **in + } + if in.CheckWorkspaceAlertsStorageConfigured != nil { + in, out := &in.CheckWorkspaceAlertsStorageConfigured, &out.CheckWorkspaceAlertsStorageConfigured + *out = new(bool) + **out = **in + } + if in.Criteria != nil { + in, out := &in.Criteria, &out.Criteria + *out = new(ScheduledQueryRuleCriteria) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.EvaluationFrequency != nil { + in, out := &in.EvaluationFrequency, &out.EvaluationFrequency + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(ScheduledQueryRule_Kind_Spec) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MuteActionsDuration != nil { + in, out := &in.MuteActionsDuration, &out.MuteActionsDuration + *out = new(string) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(ScheduledQueryRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.OverrideQueryTimeRange != nil { + in, out := &in.OverrideQueryTimeRange, &out.OverrideQueryTimeRange + *out = new(string) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.ResolveConfiguration != nil { + in, out := &in.ResolveConfiguration, &out.ResolveConfiguration + *out = new(RuleResolveConfiguration) + (*in).DeepCopyInto(*out) + } + if in.ScopesReferences != nil { + in, out := &in.ScopesReferences, &out.ScopesReferences + *out = make([]genruntime.ResourceReference, len(*in)) + copy(*out, *in) + } + if in.Severity != nil { + in, out := &in.Severity, &out.Severity + *out = new(ScheduledQueryRuleProperties_Severity) + **out = **in + } + if in.SkipQueryValidation != nil { + in, out := &in.SkipQueryValidation, &out.SkipQueryValidation + *out = new(bool) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TargetResourceTypes != nil { + in, out := &in.TargetResourceTypes, &out.TargetResourceTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.WindowSize != nil { + in, out := &in.WindowSize, &out.WindowSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduledQueryRule_Spec. +func (in *ScheduledQueryRule_Spec) DeepCopy() *ScheduledQueryRule_Spec { + if in == nil { + return nil + } + out := new(ScheduledQueryRule_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.CreatedBy != nil { + in, out := &in.CreatedBy, &out.CreatedBy + *out = new(string) + **out = **in + } + if in.CreatedByType != nil { + in, out := &in.CreatedByType, &out.CreatedByType + *out = new(SystemData_CreatedByType_STATUS) + **out = **in + } + if in.LastModifiedAt != nil { + in, out := &in.LastModifiedAt, &out.LastModifiedAt + *out = new(string) + **out = **in + } + if in.LastModifiedBy != nil { + in, out := &in.LastModifiedBy, &out.LastModifiedBy + *out = new(string) + **out = **in + } + if in.LastModifiedByType != nil { + in, out := &in.LastModifiedByType, &out.LastModifiedByType + *out = new(SystemData_LastModifiedByType_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS. +func (in *SystemData_STATUS) DeepCopy() *SystemData_STATUS { + if in == nil { + return nil + } + out := new(SystemData_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityDetails) DeepCopyInto(out *UserAssignedIdentityDetails) { + *out = *in + out.Reference = in.Reference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails. +func (in *UserAssignedIdentityDetails) DeepCopy() *UserAssignedIdentityDetails { + if in == nil { + return nil + } + out := new(UserAssignedIdentityDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserIdentityProperties_STATUS) DeepCopyInto(out *UserIdentityProperties_STATUS) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserIdentityProperties_STATUS. +func (in *UserIdentityProperties_STATUS) DeepCopy() *UserIdentityProperties_STATUS { + if in == nil { + return nil + } + out := new(UserIdentityProperties_STATUS) + in.DeepCopyInto(out) + return out +} diff --git a/v2/api/insights/versions_matrix.md b/v2/api/insights/versions_matrix.md index 98021820033..5a697d496ce 100644 --- a/v2/api/insights/versions_matrix.md +++ b/v2/api/insights/versions_matrix.md @@ -1,199 +1,209 @@ -| Type Definitions in package "insights" | v1api20180301 | v1api20180501preview | v1api20200202 | v1api20210501preview | v1api20220615 | v1api20221001 | v1api20230101 | -|--------------------------------------------------------------------|---------------|----------------------|---------------|----------------------|---------------|---------------|---------------| -| APIVersion | v1api20180301 | v1api20180501preview | v1api20200202 | v1api20210501preview | v1api20220615 | v1api20221001 | v1api20230101 | -| ActionGroup | | | | | | | v1api20230101 | -| ActionGroupResource_STATUS | | | | | | | v1api20230101 | -| ActionGroupSpec | | | | | | | v1api20230101 | -| ActionGroup_STATUS | | | | | | | v1api20230101 | -| ActionGroup_Spec | | | | | | | v1api20230101 | -| Actions | | | | | v1api20220615 | | | -| Actions_STATUS | | | | | v1api20220615 | | | -| ApplicationInsightsComponentProperties | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_Application_Type | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_Application_Type_STATUS | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_Flow_Type | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_Flow_Type_STATUS | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_IngestionMode | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_IngestionMode_STATUS | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_Request_Source | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_Request_Source_STATUS | | | v1api20200202 | | | | | -| ApplicationInsightsComponentProperties_STATUS | | | v1api20200202 | | | | | -| ArmRoleReceiver | | | | | | | v1api20230101 | -| ArmRoleReceiver_STATUS | | | | | | | v1api20230101 | -| AutomationRunbookReceiver | | | | | | | v1api20230101 | -| AutomationRunbookReceiver_STATUS | | | | | | | v1api20230101 | -| AutoscaleNotification | | | | | | v1api20221001 | | -| AutoscaleNotification_Operation | | | | | | v1api20221001 | | -| AutoscaleNotification_Operation_STATUS | | | | | | v1api20221001 | | -| AutoscaleNotification_STATUS | | | | | | v1api20221001 | | -| AutoscaleProfile | | | | | | v1api20221001 | | -| AutoscaleProfile_STATUS | | | | | | v1api20221001 | | -| AutoscaleSetting | | | | | | v1api20221001 | | -| AutoscaleSettingProperties | | | | | | v1api20221001 | | -| AutoscaleSetting_STATUS | | | | | | v1api20221001 | | -| AutoscaleSetting_Spec | | | | | | v1api20221001 | | -| Autoscalesetting_STATUS | | | | | | v1api20221001 | | -| AzureAppPushReceiver | | | | | | | v1api20230101 | -| AzureAppPushReceiver_STATUS | | | | | | | v1api20230101 | -| AzureFunctionReceiver | | | | | | | v1api20230101 | -| AzureFunctionReceiver_STATUS | | | | | | | v1api20230101 | -| Component | | | v1api20200202 | | | | | -| Component_STATUS | | | v1api20200202 | | | | | -| Component_Spec | | | v1api20200202 | | | | | -| Condition | | | | | v1api20220615 | | | -| Condition_FailingPeriods | | | | | v1api20220615 | | | -| Condition_FailingPeriods_STATUS | | | | | v1api20220615 | | | -| Condition_Operator | | | | | v1api20220615 | | | -| Condition_Operator_STATUS | | | | | v1api20220615 | | | -| Condition_STATUS | | | | | v1api20220615 | | | -| Condition_TimeAggregation | | | | | v1api20220615 | | | -| Condition_TimeAggregation_STATUS | | | | | v1api20220615 | | | -| DiagnosticSetting | | | | v1api20210501preview | | | | -| DiagnosticSetting_STATUS | | | | v1api20210501preview | | | | -| DiagnosticSetting_Spec | | | | v1api20210501preview | | | | -| DiagnosticSettings | | | | v1api20210501preview | | | | -| DiagnosticSettings_STATUS | | | | v1api20210501preview | | | | -| Dimension | | | | | v1api20220615 | | | -| Dimension_Operator | | | | | v1api20220615 | | | -| Dimension_Operator_STATUS | | | | | v1api20220615 | | | -| Dimension_STATUS | | | | | v1api20220615 | | | -| DynamicMetricCriteria | v1api20180301 | | | | | | | -| DynamicMetricCriteria_AlertSensitivity | v1api20180301 | | | | | | | -| DynamicMetricCriteria_AlertSensitivity_STATUS | v1api20180301 | | | | | | | -| DynamicMetricCriteria_CriterionType | v1api20180301 | | | | | | | -| DynamicMetricCriteria_CriterionType_STATUS | v1api20180301 | | | | | | | -| DynamicMetricCriteria_Operator | v1api20180301 | | | | | | | -| DynamicMetricCriteria_Operator_STATUS | v1api20180301 | | | | | | | -| DynamicMetricCriteria_STATUS | v1api20180301 | | | | | | | -| DynamicMetricCriteria_TimeAggregation | v1api20180301 | | | | | | | -| DynamicMetricCriteria_TimeAggregation_STATUS | v1api20180301 | | | | | | | -| DynamicThresholdFailingPeriods | v1api20180301 | | | | | | | -| DynamicThresholdFailingPeriods_STATUS | v1api20180301 | | | | | | | -| EmailNotification | | | | | | v1api20221001 | | -| EmailNotification_STATUS | | | | | | v1api20221001 | | -| EmailReceiver | | | | | | | v1api20230101 | -| EmailReceiver_STATUS | | | | | | | v1api20230101 | -| EventHubReceiver | | | | | | | v1api20230101 | -| EventHubReceiver_STATUS | | | | | | | v1api20230101 | -| HeaderField | | v1api20180501preview | | | v1api20220615 | | | -| HeaderField_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| ItsmReceiver | | | | | | | v1api20230101 | -| ItsmReceiver_STATUS | | | | | | | v1api20230101 | -| LogSettings | | | | v1api20210501preview | | | | -| LogSettings_STATUS | | | | v1api20210501preview | | | | -| LogicAppReceiver | | | | | | | v1api20230101 | -| LogicAppReceiver_STATUS | | | | | | | v1api20230101 | -| MetricAlert | v1api20180301 | | | | | | | -| MetricAlertAction | v1api20180301 | | | | | | | -| MetricAlertAction_STATUS | v1api20180301 | | | | | | | -| MetricAlertCriteria | v1api20180301 | | | | | | | -| MetricAlertCriteria_STATUS | v1api20180301 | | | | | | | -| MetricAlertMultipleResourceMultipleMetricCriteria | v1api20180301 | | | | | | | -| MetricAlertMultipleResourceMultipleMetricCriteria_OdataType | v1api20180301 | | | | | | | -| MetricAlertMultipleResourceMultipleMetricCriteria_OdataType_STATUS | v1api20180301 | | | | | | | -| MetricAlertMultipleResourceMultipleMetricCriteria_STATUS | v1api20180301 | | | | | | | -| MetricAlertProperties | v1api20180301 | | | | | | | -| MetricAlertProperties_STATUS | v1api20180301 | | | | | | | -| MetricAlertSingleResourceMultipleMetricCriteria | v1api20180301 | | | | | | | -| MetricAlertSingleResourceMultipleMetricCriteria_OdataType | v1api20180301 | | | | | | | -| MetricAlertSingleResourceMultipleMetricCriteria_OdataType_STATUS | v1api20180301 | | | | | | | -| MetricAlertSingleResourceMultipleMetricCriteria_STATUS | v1api20180301 | | | | | | | -| MetricAlert_STATUS | v1api20180301 | | | | | | | -| MetricAlert_Spec | v1api20180301 | | | | | | | -| MetricCriteria | v1api20180301 | | | | | | | -| MetricCriteria_CriterionType | v1api20180301 | | | | | | | -| MetricCriteria_CriterionType_STATUS | v1api20180301 | | | | | | | -| MetricCriteria_Operator | v1api20180301 | | | | | | | -| MetricCriteria_Operator_STATUS | v1api20180301 | | | | | | | -| MetricCriteria_STATUS | v1api20180301 | | | | | | | -| MetricCriteria_TimeAggregation | v1api20180301 | | | | | | | -| MetricCriteria_TimeAggregation_STATUS | v1api20180301 | | | | | | | -| MetricDimension | v1api20180301 | | | | | | | -| MetricDimension_STATUS | v1api20180301 | | | | | | | -| MetricSettings | | | | v1api20210501preview | | | | -| MetricSettings_STATUS | | | | v1api20210501preview | | | | -| MetricTrigger | | | | | | v1api20221001 | | -| MetricTrigger_Operator | | | | | | v1api20221001 | | -| MetricTrigger_Operator_STATUS | | | | | | v1api20221001 | | -| MetricTrigger_STATUS | | | | | | v1api20221001 | | -| MetricTrigger_Statistic | | | | | | v1api20221001 | | -| MetricTrigger_Statistic_STATUS | | | | | | v1api20221001 | | -| MetricTrigger_TimeAggregation | | | | | | v1api20221001 | | -| MetricTrigger_TimeAggregation_STATUS | | | | | | v1api20221001 | | -| MultiMetricCriteria | v1api20180301 | | | | | | | -| MultiMetricCriteria_STATUS | v1api20180301 | | | | | | | -| PredictiveAutoscalePolicy | | | | | | v1api20221001 | | -| PredictiveAutoscalePolicy_STATUS | | | | | | v1api20221001 | | -| PredictiveAutoscalePolicy_ScaleMode | | | | | | v1api20221001 | | -| PredictiveAutoscalePolicy_ScaleMode_STATUS | | | | | | v1api20221001 | | -| PrivateLinkScopedResource_STATUS | | | v1api20200202 | | | | | -| PublicNetworkAccessType | | | v1api20200202 | | | | | -| PublicNetworkAccessType_STATUS | | | v1api20200202 | | | | | -| ReceiverStatus_STATUS | | | | | | | v1api20230101 | -| Recurrence | | | | | | v1api20221001 | | -| Recurrence_Frequency | | | | | | v1api20221001 | | -| Recurrence_Frequency_STATUS | | | | | | v1api20221001 | | -| Recurrence_STATUS | | | | | | v1api20221001 | | -| RecurrentSchedule | | | | | | v1api20221001 | | -| RecurrentSchedule_STATUS | | | | | | v1api20221001 | | -| RetentionPolicy | | | | v1api20210501preview | | | | -| RetentionPolicy_STATUS | | | | v1api20210501preview | | | | -| ScaleAction | | | | | | v1api20221001 | | -| ScaleAction_Direction | | | | | | v1api20221001 | | -| ScaleAction_Direction_STATUS | | | | | | v1api20221001 | | -| ScaleAction_STATUS | | | | | | v1api20221001 | | -| ScaleAction_Type | | | | | | v1api20221001 | | -| ScaleAction_Type_STATUS | | | | | | v1api20221001 | | -| ScaleCapacity | | | | | | v1api20221001 | | -| ScaleCapacity_STATUS | | | | | | v1api20221001 | | -| ScaleRule | | | | | | v1api20221001 | | -| ScaleRuleMetricDimension | | | | | | v1api20221001 | | -| ScaleRuleMetricDimension_Operator | | | | | | v1api20221001 | | -| ScaleRuleMetricDimension_Operator_STATUS | | | | | | v1api20221001 | | -| ScaleRuleMetricDimension_STATUS | | | | | | v1api20221001 | | -| ScaleRule_STATUS | | | | | | v1api20221001 | | -| ScheduledQueryRule | | | | | v1api20220615 | | | -| ScheduledQueryRuleCriteria | | | | | v1api20220615 | | | -| ScheduledQueryRuleCriteria_STATUS | | | | | v1api20220615 | | | -| ScheduledQueryRuleProperties | | | | | v1api20220615 | | | -| ScheduledQueryRuleProperties_STATUS | | | | | v1api20220615 | | | -| ScheduledQueryRuleProperties_Severity | | | | | v1api20220615 | | | -| ScheduledQueryRuleProperties_Severity_STATUS | | | | | v1api20220615 | | | -| ScheduledQueryRule_Kind_STATUS | | | | | v1api20220615 | | | -| ScheduledQueryRule_Kind_Spec | | | | | v1api20220615 | | | -| ScheduledQueryRule_STATUS | | | | | v1api20220615 | | | -| ScheduledQueryRule_Spec | | | | | v1api20220615 | | | -| SmsReceiver | | | | | | | v1api20230101 | -| SmsReceiver_STATUS | | | | | | | v1api20230101 | -| SystemData_CreatedByType_STATUS | | | | v1api20210501preview | v1api20220615 | v1api20221001 | | -| SystemData_LastModifiedByType_STATUS | | | | v1api20210501preview | v1api20220615 | v1api20221001 | | -| SystemData_STATUS | | | | v1api20210501preview | v1api20220615 | v1api20221001 | | -| TimeWindow | | | | | | v1api20221001 | | -| TimeWindow_STATUS | | | | | | v1api20221001 | | -| VoiceReceiver | | | | | | | v1api20230101 | -| VoiceReceiver_STATUS | | | | | | | v1api20230101 | -| WebTestGeolocation | | v1api20180501preview | | | v1api20220615 | | | -| WebTestGeolocation_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_Configuration | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_Configuration_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_Kind | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_Kind_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_Request | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_Request_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_ValidationRules | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_ValidationRules_ContentValidation | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_ValidationRules_ContentValidation_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| WebTestProperties_ValidationRules_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| WebhookNotification | | | | | | v1api20221001 | | -| WebhookNotification_STATUS | | | | | | v1api20221001 | | -| WebhookReceiver | | | | | | | v1api20230101 | -| WebhookReceiver_STATUS | | | | | | | v1api20230101 | -| Webtest | | v1api20180501preview | | | v1api20220615 | | | -| WebtestLocationAvailabilityCriteria | v1api20180301 | | | | | | | -| WebtestLocationAvailabilityCriteria_OdataType | v1api20180301 | | | | | | | -| WebtestLocationAvailabilityCriteria_OdataType_STATUS | v1api20180301 | | | | | | | -| WebtestLocationAvailabilityCriteria_STATUS | v1api20180301 | | | | | | | -| Webtest_STATUS | | v1api20180501preview | | | v1api20220615 | | | -| Webtest_Spec | | v1api20180501preview | | | v1api20220615 | | | +| Type Definitions in package "insights" | v1api20180301 | v1api20180501preview | v1api20200202 | v1api20210501preview | v1api20220615 | v1api20221001 | v1api20230101 | v1api20240101preview | +|--------------------------------------------------------------------|---------------|----------------------|---------------|----------------------|---------------|---------------|---------------|----------------------| +| APIVersion | v1api20180301 | v1api20180501preview | v1api20200202 | v1api20210501preview | v1api20220615 | v1api20221001 | v1api20230101 | v1api20240101preview | +| ActionGroup | | | | | | | v1api20230101 | | +| ActionGroupResource_STATUS | | | | | | | v1api20230101 | | +| ActionGroupSpec | | | | | | | v1api20230101 | | +| ActionGroup_STATUS | | | | | | | v1api20230101 | | +| ActionGroup_Spec | | | | | | | v1api20230101 | | +| Actions | | | | | v1api20220615 | | | v1api20240101preview | +| Actions_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| ApplicationInsightsComponentProperties | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_Application_Type | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_Application_Type_STATUS | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_Flow_Type | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_Flow_Type_STATUS | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_IngestionMode | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_IngestionMode_STATUS | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_Request_Source | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_Request_Source_STATUS | | | v1api20200202 | | | | | | +| ApplicationInsightsComponentProperties_STATUS | | | v1api20200202 | | | | | | +| ArmRoleReceiver | | | | | | | v1api20230101 | | +| ArmRoleReceiver_STATUS | | | | | | | v1api20230101 | | +| AutomationRunbookReceiver | | | | | | | v1api20230101 | | +| AutomationRunbookReceiver_STATUS | | | | | | | v1api20230101 | | +| AutoscaleNotification | | | | | | v1api20221001 | | | +| AutoscaleNotification_Operation | | | | | | v1api20221001 | | | +| AutoscaleNotification_Operation_STATUS | | | | | | v1api20221001 | | | +| AutoscaleNotification_STATUS | | | | | | v1api20221001 | | | +| AutoscaleProfile | | | | | | v1api20221001 | | | +| AutoscaleProfile_STATUS | | | | | | v1api20221001 | | | +| AutoscaleSetting | | | | | | v1api20221001 | | | +| AutoscaleSettingProperties | | | | | | v1api20221001 | | | +| AutoscaleSetting_STATUS | | | | | | v1api20221001 | | | +| AutoscaleSetting_Spec | | | | | | v1api20221001 | | | +| Autoscalesetting_STATUS | | | | | | v1api20221001 | | | +| AzureAppPushReceiver | | | | | | | v1api20230101 | | +| AzureAppPushReceiver_STATUS | | | | | | | v1api20230101 | | +| AzureFunctionReceiver | | | | | | | v1api20230101 | | +| AzureFunctionReceiver_STATUS | | | | | | | v1api20230101 | | +| Component | | | v1api20200202 | | | | | | +| Component_STATUS | | | v1api20200202 | | | | | | +| Component_Spec | | | v1api20200202 | | | | | | +| Condition | | | | | v1api20220615 | | | v1api20240101preview | +| Condition_CriterionType | | | | | | | | v1api20240101preview | +| Condition_CriterionType_STATUS | | | | | | | | v1api20240101preview | +| Condition_FailingPeriods | | | | | v1api20220615 | | | v1api20240101preview | +| Condition_FailingPeriods_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| Condition_Operator | | | | | v1api20220615 | | | v1api20240101preview | +| Condition_Operator_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| Condition_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| Condition_TimeAggregation | | | | | v1api20220615 | | | v1api20240101preview | +| Condition_TimeAggregation_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| DiagnosticSetting | | | | v1api20210501preview | | | | | +| DiagnosticSetting_STATUS | | | | v1api20210501preview | | | | | +| DiagnosticSetting_Spec | | | | v1api20210501preview | | | | | +| DiagnosticSettings | | | | v1api20210501preview | | | | | +| DiagnosticSettings_STATUS | | | | v1api20210501preview | | | | | +| Dimension | | | | | v1api20220615 | | | v1api20240101preview | +| Dimension_Operator | | | | | v1api20220615 | | | v1api20240101preview | +| Dimension_Operator_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| Dimension_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| DynamicMetricCriteria | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_AlertSensitivity | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_AlertSensitivity_STATUS | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_CriterionType | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_CriterionType_STATUS | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_Operator | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_Operator_STATUS | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_STATUS | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_TimeAggregation | v1api20180301 | | | | | | | | +| DynamicMetricCriteria_TimeAggregation_STATUS | v1api20180301 | | | | | | | | +| DynamicThresholdFailingPeriods | v1api20180301 | | | | | | | | +| DynamicThresholdFailingPeriods_STATUS | v1api20180301 | | | | | | | | +| EmailNotification | | | | | | v1api20221001 | | | +| EmailNotification_STATUS | | | | | | v1api20221001 | | | +| EmailReceiver | | | | | | | v1api20230101 | | +| EmailReceiver_STATUS | | | | | | | v1api20230101 | | +| EventHubReceiver | | | | | | | v1api20230101 | | +| EventHubReceiver_STATUS | | | | | | | v1api20230101 | | +| HeaderField | | v1api20180501preview | | | v1api20220615 | | | | +| HeaderField_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| Identity | | | | | | | | v1api20240101preview | +| Identity_STATUS | | | | | | | | v1api20240101preview | +| Identity_Type | | | | | | | | v1api20240101preview | +| Identity_Type_STATUS | | | | | | | | v1api20240101preview | +| ItsmReceiver | | | | | | | v1api20230101 | | +| ItsmReceiver_STATUS | | | | | | | v1api20230101 | | +| LogSettings | | | | v1api20210501preview | | | | | +| LogSettings_STATUS | | | | v1api20210501preview | | | | | +| LogicAppReceiver | | | | | | | v1api20230101 | | +| LogicAppReceiver_STATUS | | | | | | | v1api20230101 | | +| MetricAlert | v1api20180301 | | | | | | | | +| MetricAlertAction | v1api20180301 | | | | | | | | +| MetricAlertAction_STATUS | v1api20180301 | | | | | | | | +| MetricAlertCriteria | v1api20180301 | | | | | | | | +| MetricAlertCriteria_STATUS | v1api20180301 | | | | | | | | +| MetricAlertMultipleResourceMultipleMetricCriteria | v1api20180301 | | | | | | | | +| MetricAlertMultipleResourceMultipleMetricCriteria_OdataType | v1api20180301 | | | | | | | | +| MetricAlertMultipleResourceMultipleMetricCriteria_OdataType_STATUS | v1api20180301 | | | | | | | | +| MetricAlertMultipleResourceMultipleMetricCriteria_STATUS | v1api20180301 | | | | | | | | +| MetricAlertProperties | v1api20180301 | | | | | | | | +| MetricAlertProperties_STATUS | v1api20180301 | | | | | | | | +| MetricAlertSingleResourceMultipleMetricCriteria | v1api20180301 | | | | | | | | +| MetricAlertSingleResourceMultipleMetricCriteria_OdataType | v1api20180301 | | | | | | | | +| MetricAlertSingleResourceMultipleMetricCriteria_OdataType_STATUS | v1api20180301 | | | | | | | | +| MetricAlertSingleResourceMultipleMetricCriteria_STATUS | v1api20180301 | | | | | | | | +| MetricAlert_STATUS | v1api20180301 | | | | | | | | +| MetricAlert_Spec | v1api20180301 | | | | | | | | +| MetricCriteria | v1api20180301 | | | | | | | | +| MetricCriteria_CriterionType | v1api20180301 | | | | | | | | +| MetricCriteria_CriterionType_STATUS | v1api20180301 | | | | | | | | +| MetricCriteria_Operator | v1api20180301 | | | | | | | | +| MetricCriteria_Operator_STATUS | v1api20180301 | | | | | | | | +| MetricCriteria_STATUS | v1api20180301 | | | | | | | | +| MetricCriteria_TimeAggregation | v1api20180301 | | | | | | | | +| MetricCriteria_TimeAggregation_STATUS | v1api20180301 | | | | | | | | +| MetricDimension | v1api20180301 | | | | | | | | +| MetricDimension_STATUS | v1api20180301 | | | | | | | | +| MetricSettings | | | | v1api20210501preview | | | | | +| MetricSettings_STATUS | | | | v1api20210501preview | | | | | +| MetricTrigger | | | | | | v1api20221001 | | | +| MetricTrigger_Operator | | | | | | v1api20221001 | | | +| MetricTrigger_Operator_STATUS | | | | | | v1api20221001 | | | +| MetricTrigger_STATUS | | | | | | v1api20221001 | | | +| MetricTrigger_Statistic | | | | | | v1api20221001 | | | +| MetricTrigger_Statistic_STATUS | | | | | | v1api20221001 | | | +| MetricTrigger_TimeAggregation | | | | | | v1api20221001 | | | +| MetricTrigger_TimeAggregation_STATUS | | | | | | v1api20221001 | | | +| MultiMetricCriteria | v1api20180301 | | | | | | | | +| MultiMetricCriteria_STATUS | v1api20180301 | | | | | | | | +| PredictiveAutoscalePolicy | | | | | | v1api20221001 | | | +| PredictiveAutoscalePolicy_STATUS | | | | | | v1api20221001 | | | +| PredictiveAutoscalePolicy_ScaleMode | | | | | | v1api20221001 | | | +| PredictiveAutoscalePolicy_ScaleMode_STATUS | | | | | | v1api20221001 | | | +| PrivateLinkScopedResource_STATUS | | | v1api20200202 | | | | | | +| PublicNetworkAccessType | | | v1api20200202 | | | | | | +| PublicNetworkAccessType_STATUS | | | v1api20200202 | | | | | | +| ReceiverStatus_STATUS | | | | | | | v1api20230101 | | +| Recurrence | | | | | | v1api20221001 | | | +| Recurrence_Frequency | | | | | | v1api20221001 | | | +| Recurrence_Frequency_STATUS | | | | | | v1api20221001 | | | +| Recurrence_STATUS | | | | | | v1api20221001 | | | +| RecurrentSchedule | | | | | | v1api20221001 | | | +| RecurrentSchedule_STATUS | | | | | | v1api20221001 | | | +| RetentionPolicy | | | | v1api20210501preview | | | | | +| RetentionPolicy_STATUS | | | | v1api20210501preview | | | | | +| RuleResolveConfiguration | | | | | | | | v1api20240101preview | +| RuleResolveConfiguration_STATUS | | | | | | | | v1api20240101preview | +| ScaleAction | | | | | | v1api20221001 | | | +| ScaleAction_Direction | | | | | | v1api20221001 | | | +| ScaleAction_Direction_STATUS | | | | | | v1api20221001 | | | +| ScaleAction_STATUS | | | | | | v1api20221001 | | | +| ScaleAction_Type | | | | | | v1api20221001 | | | +| ScaleAction_Type_STATUS | | | | | | v1api20221001 | | | +| ScaleCapacity | | | | | | v1api20221001 | | | +| ScaleCapacity_STATUS | | | | | | v1api20221001 | | | +| ScaleRule | | | | | | v1api20221001 | | | +| ScaleRuleMetricDimension | | | | | | v1api20221001 | | | +| ScaleRuleMetricDimension_Operator | | | | | | v1api20221001 | | | +| ScaleRuleMetricDimension_Operator_STATUS | | | | | | v1api20221001 | | | +| ScaleRuleMetricDimension_STATUS | | | | | | v1api20221001 | | | +| ScaleRule_STATUS | | | | | | v1api20221001 | | | +| ScheduledQueryRule | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRuleCriteria | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRuleCriteria_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRuleProperties | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRuleProperties_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRuleProperties_Severity | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRuleProperties_Severity_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRule_Kind_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRule_Kind_Spec | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRule_STATUS | | | | | v1api20220615 | | | v1api20240101preview | +| ScheduledQueryRule_Spec | | | | | v1api20220615 | | | v1api20240101preview | +| SmsReceiver | | | | | | | v1api20230101 | | +| SmsReceiver_STATUS | | | | | | | v1api20230101 | | +| SystemData_CreatedByType_STATUS | | | | v1api20210501preview | v1api20220615 | v1api20221001 | | v1api20240101preview | +| SystemData_LastModifiedByType_STATUS | | | | v1api20210501preview | v1api20220615 | v1api20221001 | | v1api20240101preview | +| SystemData_STATUS | | | | v1api20210501preview | v1api20220615 | v1api20221001 | | v1api20240101preview | +| TimeWindow | | | | | | v1api20221001 | | | +| TimeWindow_STATUS | | | | | | v1api20221001 | | | +| UserAssignedIdentityDetails | | | | | | | | v1api20240101preview | +| UserIdentityProperties_STATUS | | | | | | | | v1api20240101preview | +| VoiceReceiver | | | | | | | v1api20230101 | | +| VoiceReceiver_STATUS | | | | | | | v1api20230101 | | +| WebTestGeolocation | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestGeolocation_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_Configuration | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_Configuration_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_Kind | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_Kind_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_Request | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_Request_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_ValidationRules | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_ValidationRules_ContentValidation | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_ValidationRules_ContentValidation_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| WebTestProperties_ValidationRules_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| WebhookNotification | | | | | | v1api20221001 | | | +| WebhookNotification_STATUS | | | | | | v1api20221001 | | | +| WebhookReceiver | | | | | | | v1api20230101 | | +| WebhookReceiver_STATUS | | | | | | | v1api20230101 | | +| Webtest | | v1api20180501preview | | | v1api20220615 | | | | +| WebtestLocationAvailabilityCriteria | v1api20180301 | | | | | | | | +| WebtestLocationAvailabilityCriteria_OdataType | v1api20180301 | | | | | | | | +| WebtestLocationAvailabilityCriteria_OdataType_STATUS | v1api20180301 | | | | | | | | +| WebtestLocationAvailabilityCriteria_STATUS | v1api20180301 | | | | | | | | +| Webtest_STATUS | | v1api20180501preview | | | v1api20220615 | | | | +| Webtest_Spec | | v1api20180501preview | | | v1api20220615 | | | | diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 4f5e6baeb02..857189eb3f9 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -91,6 +91,12 @@ typeFilters: version: v*20210501preview because: We're using DiagnosticSetting from this. +# Latest non-preview version is not supported, see https://github.com/Azure/bicep-types-az/issues/2185 + - action: include + group: insights + version: v*20240101preview + because: We need ScheduledQueryRules from this. + - action: include group: common because: we need these for common resource properties @@ -2570,6 +2576,19 @@ objectModelConfiguration: $armReference: true StorageAccountId: $armReference: true + 2024-01-01-preview: + ScheduledQueryRule: + $export: true + $supportedFrom: v2.12.0 + Actions: + ActionGroups: + $armReference: true + Condition: + ResourceIdColumn: + $armReference: true + ScheduledQueryRuleProperties: + Scopes: + $armReference: true keyvault: 2021-04-01-preview: diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index 2bbfcc794a7..c43f15bbd52 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -131,6 +131,8 @@ import ( insights_v20221001s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20221001/storage" insights_v20230101 "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230101" insights_v20230101s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230101/storage" + insights_v20240101p "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview" + insights_v20240101ps "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview/storage" keyvault_customizations "github.com/Azure/azure-service-operator/v2/api/keyvault/customizations" keyvault_v20210401p "github.com/Azure/azure-service-operator/v2/api/keyvault/v1api20210401preview" keyvault_v20210401ps "github.com/Azure/azure-service-operator/v2/api/keyvault/v1api20210401preview/storage" @@ -1896,6 +1898,8 @@ func getKnownTypes() []client.Object { result = append(result, new(insights_v20221001s.AutoscaleSetting)) result = append(result, new(insights_v20230101.ActionGroup)) result = append(result, new(insights_v20230101s.ActionGroup)) + result = append(result, new(insights_v20240101p.ScheduledQueryRule)) + result = append(result, new(insights_v20240101ps.ScheduledQueryRule)) result = append(result, new(keyvault_v20210401p.Vault)) result = append(result, new(keyvault_v20210401ps.Vault)) result = append(result, new(keyvault_v20230701.Vault)) @@ -2433,6 +2437,8 @@ func createScheme() *runtime.Scheme { _ = insights_v20221001s.AddToScheme(scheme) _ = insights_v20230101.AddToScheme(scheme) _ = insights_v20230101s.AddToScheme(scheme) + _ = insights_v20240101p.AddToScheme(scheme) + _ = insights_v20240101ps.AddToScheme(scheme) _ = keyvault_v20210401p.AddToScheme(scheme) _ = keyvault_v20210401ps.AddToScheme(scheme) _ = keyvault_v20230701.AddToScheme(scheme) diff --git a/v2/internal/controllers/crd_insights_scheduledqueryrule_test.go b/v2/internal/controllers/crd_insights_scheduledqueryrule_20220615_test.go similarity index 100% rename from v2/internal/controllers/crd_insights_scheduledqueryrule_test.go rename to v2/internal/controllers/crd_insights_scheduledqueryrule_20220615_test.go diff --git a/v2/internal/controllers/crd_insights_scheduledqueryrule_20240101preview_test.go b/v2/internal/controllers/crd_insights_scheduledqueryrule_20240101preview_test.go new file mode 100644 index 00000000000..8b7f759489f --- /dev/null +++ b/v2/internal/controllers/crd_insights_scheduledqueryrule_20240101preview_test.go @@ -0,0 +1,132 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +package controllers_test + +import ( + "testing" + + . "github.com/onsi/gomega" + + authorization "github.com/Azure/azure-service-operator/v2/api/authorization/v1api20220401" + insights "github.com/Azure/azure-service-operator/v2/api/insights/v1api20240101preview" + managedidentity "github.com/Azure/azure-service-operator/v2/api/managedidentity/v1api20230131" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/internal/util/to" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_Insights_ScheduledQueryRule_20240101preview_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + tc.AzureRegion = to.Ptr("eastus") + + rg := tc.CreateTestResourceGroupAndWait() + + configMapName := "my-configmap" + principalIdKey := "principalId" + + mi := &managedidentity.UserAssignedIdentity{ + ObjectMeta: tc.MakeObjectMeta("mi"), + Spec: managedidentity.UserAssignedIdentity_Spec{ + Location: tc.AzureRegion, + Owner: testcommon.AsOwner(rg), + OperatorSpec: &managedidentity.UserAssignedIdentityOperatorSpec{ + ConfigMaps: &managedidentity.UserAssignedIdentityOperatorConfigMaps{ + PrincipalId: &genruntime.ConfigMapDestination{ + Name: configMapName, + Key: principalIdKey, + }, + }, + }, + }, + } + tc.CreateResourcesAndWait(mi) + + component := newAppInsightsComponent(tc, rg) + tc.CreateResourceAndWait(component) + + armID := *component.Status.Id + + roleAssignmentGUID, err := tc.Namer.GenerateUUID() + tc.Expect(err).ToNot(HaveOccurred()) + roleAssignment := &authorization.RoleAssignment{ + ObjectMeta: tc.MakeObjectMetaWithName(roleAssignmentGUID.String()), + Spec: authorization.RoleAssignment_Spec{ + Owner: &genruntime.ArbitraryOwnerReference{ + ARMID: armID, + }, + PrincipalIdFromConfig: &genruntime.ConfigMapReference{ + Name: configMapName, + Key: principalIdKey, + }, + RoleDefinitionReference: &genruntime.ResourceReference{ + ARMID: "/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635", // This is owner + }, + }, + } + tc.CreateResourceAndWait(roleAssignment) + + tc.Expect(roleAssignment.Status.Id).ToNot(BeNil()) + armId := *roleAssignment.Status.Id + + rule := &insights.ScheduledQueryRule{ + ObjectMeta: tc.MakeObjectMeta("rule"), + Spec: insights.ScheduledQueryRule_Spec{ + Criteria: &insights.ScheduledQueryRuleCriteria{ + AllOf: []insights.Condition{ + { + FailingPeriods: &insights.Condition_FailingPeriods{ + MinFailingPeriodsToAlert: to.Ptr(1), + NumberOfEvaluationPeriods: to.Ptr(1), + }, + Operator: to.Ptr(insights.Condition_Operator_LessThan), + Query: to.Ptr("requests | summarize CountByCountry=count() by client_CountryOrRegion"), + ResourceIdColumnReference: nil, + Threshold: to.Ptr(10.0), + TimeAggregation: to.Ptr(insights.Condition_TimeAggregation_Count), + }, + }, + }, + EvaluationFrequency: to.Ptr("PT10M"), + Identity: &insights.Identity{ + Type: to.Ptr(insights.Identity_Type_UserAssigned), + UserAssignedIdentities: []insights.UserAssignedIdentityDetails{ + { + Reference: *tc.MakeReferenceFromResource(mi), + }, + }, + }, + Location: tc.AzureRegion, + Owner: testcommon.AsOwner(rg), + ScopesReferences: []genruntime.ResourceReference{ + *tc.MakeReferenceFromResource(component), + }, + Severity: to.Ptr(insights.ScheduledQueryRuleProperties_Severity_0), + WindowSize: to.Ptr("PT10M"), + }, + } + + tc.CreateResourceAndWait(rule) + + tc.Expect(rule.Status.Id).ToNot(BeNil()) + armId = *rule.Status.Id + + old := rule.DeepCopy() + key := "foo" + rule.Spec.Tags = map[string]string{key: "bar"} + + tc.PatchResourceAndWait(old, rule) + tc.Expect(rule.Status.Tags).To(HaveKey(key)) + + tc.DeleteResourceAndWait(rule) + + // Ensure delete + exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(insights.APIVersion_Value)) + tc.Expect(err).ToNot(HaveOccurred()) + tc.Expect(retryAfter).To(BeZero()) + tc.Expect(exists).To(BeFalse()) +} diff --git a/v2/internal/controllers/recordings/Test_Insights_ScheduledQueryRule_20240101preview_CRUD.yaml b/v2/internal/controllers/recordings/Test_Insights_ScheduledQueryRule_20240101preview_CRUD.yaml new file mode 100644 index 00000000000..043593c1b62 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_Insights_ScheduledQueryRule_20240101preview_CRUD.yaml @@ -0,0 +1,1424 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 147 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"eastus","name":"asotest-rg-vrgxjp","tags":{"CreatedAt":"2001-02-03T04:05:06Z","Owner":"andrei.barbu@uipath.com","Project":"Mazewalk"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "147" + Content-Type: + - application/json + Test-Request-Hash: + - 1d0af2ee4389f2740ab33cf9d685dbc7fdde36d9b68b4a700d94624331fba002 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp?api-version=2020-06-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 330 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp","name":"asotest-rg-vrgxjp","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"CreatedAt":"2001-02-03T04:05:06Z","Owner":"andrei.barbu@uipath.com","Project":"Mazewalk"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "330" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "2999" + X-Msedge-Ref: + - 'Ref A: FF213D6C2595490C9526840577EDAC0E Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:16:52Z' + status: 201 Created + code: 201 + duration: 679.499675ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp?api-version=2020-06-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 330 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp","name":"asotest-rg-vrgxjp","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"CreatedAt":"2001-02-03T04:05:06Z","Owner":"andrei.barbu@uipath.com","Project":"Mazewalk"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "330" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: A8A57A54CF9548EC94B62C0EAA204703 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:16:53Z' + status: 200 OK + code: 200 + duration: 146.573577ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 48 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"eastus","name":"asotest-mi-jkuszl"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "48" + Content-Type: + - application/json + Test-Request-Hash: + - 54cdd5515b0f94632ccdd43f94bba26acf1d6a51005184f4dcba9ca5d9e2ba68 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl?api-version=2023-01-31 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 453 + uncompressed: false + body: '{"location":"eastus","tags":{},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl","name":"asotest-mi-jkuszl","type":"Microsoft.ManagedIdentity/userAssignedIdentities","properties":{"tenantId":"00000000-0000-0000-0000-000000000000","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "453" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 919221BA9D774B559D8EFF794FF82FD0 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:16:59Z' + status: 201 Created + code: 201 + duration: 1.452674636s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 48 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"eastus","name":"asotest-mi-jkuszl"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "48" + Content-Type: + - application/json + Test-Request-Hash: + - 54cdd5515b0f94632ccdd43f94bba26acf1d6a51005184f4dcba9ca5d9e2ba68 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl?api-version=2023-01-31 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 453 + uncompressed: false + body: '{"location":"eastus","tags":{},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl","name":"asotest-mi-jkuszl","type":"Microsoft.ManagedIdentity/userAssignedIdentities","properties":{"tenantId":"00000000-0000-0000-0000-000000000000","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "453" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 84051F5EDBA54057A82D19D989506EC2 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:03Z' + status: 200 OK + code: 200 + duration: 766.746624ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl?api-version=2023-01-31 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 453 + uncompressed: false + body: '{"location":"eastus","tags":{},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl","name":"asotest-mi-jkuszl","type":"Microsoft.ManagedIdentity/userAssignedIdentities","properties":{"tenantId":"00000000-0000-0000-0000-000000000000","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "453" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: B6796EA1D7204E759F92100C57848A3A Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:04Z' + status: 200 OK + code: 200 + duration: 237.905404ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 110 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"kind":"web","location":"eastus","name":"asotest-component-jlfdny","properties":{"Application_Type":"other"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "110" + Content-Type: + - application/json + Test-Request-Hash: + - 47c684ab06b7ba8be102c09f201facb60af898730fe6ea3ea996a0c3f0ab2df3 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny?api-version=2020-02-02 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1327 + uncompressed: false + body: "{\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"4c04f964-0000-0100-0000-6779a5560000\\\"\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny\",\r\n \"name\": \"asotest-component-jlfdny\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"ApplicationId\": \"asotest-component-jlfdny\",\r\n \"AppId\": \"38835882-6954-4aa0-8c48-5066c6f0326b\",\r\n \"Application_Type\": \"other\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": null,\r\n \"InstrumentationKey\": \"a3ad27e0-6d6c-4b1b-a204-b0ae7ce5072a\",\r\n \"ConnectionString\": \"InstrumentationKey=a3ad27e0-6d6c-4b1b-a204-b0ae7ce5072a;IngestionEndpoint=https://eastus-1.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/;ApplicationId=38835882-6954-4aa0-8c48-5066c6f0326b\",\r\n \"Name\": \"asotest-component-jlfdny\",\r\n \"CreationDate\": \"2025-01-04T21:17:10.6985453+00:00\",\r\n \"TenantId\": \"00000000-0000-0000-0000-000000000000\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"Ver\": \"v2\"\r\n }\r\n}" + headers: + Access-Control-Expose-Headers: + - Request-Context + Cache-Control: + - no-cache + Content-Length: + - "1327" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:0dd6a9c3-b728-41ca-aa78-7e1962e22331 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 42729274D1E24B9E98938AF3DF2C6E56 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:09Z' + X-Powered-By: + - ASP.NET + status: 200 OK + code: 200 + duration: 5.632685648s + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny?api-version=2020-02-02 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1327 + uncompressed: false + body: "{\r\n \"kind\": \"web\",\r\n \"etag\": \"\\\"4c04f964-0000-0100-0000-6779a5560000\\\"\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny\",\r\n \"name\": \"asotest-component-jlfdny\",\r\n \"type\": \"microsoft.insights/components\",\r\n \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"ApplicationId\": \"asotest-component-jlfdny\",\r\n \"AppId\": \"38835882-6954-4aa0-8c48-5066c6f0326b\",\r\n \"Application_Type\": \"other\",\r\n \"Flow_Type\": null,\r\n \"Request_Source\": null,\r\n \"InstrumentationKey\": \"a3ad27e0-6d6c-4b1b-a204-b0ae7ce5072a\",\r\n \"ConnectionString\": \"InstrumentationKey=a3ad27e0-6d6c-4b1b-a204-b0ae7ce5072a;IngestionEndpoint=https://eastus-1.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/;ApplicationId=38835882-6954-4aa0-8c48-5066c6f0326b\",\r\n \"Name\": \"asotest-component-jlfdny\",\r\n \"CreationDate\": \"2025-01-04T21:17:10.6985453+00:00\",\r\n \"TenantId\": \"00000000-0000-0000-0000-000000000000\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"Ver\": \"v2\"\r\n }\r\n}" + headers: + Access-Control-Expose-Headers: + - Request-Context + Cache-Control: + - no-cache + Content-Length: + - "1327" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:0dd6a9c3-b728-41ca-aa78-7e1962e22331 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 49270AAB39E8408DA42234F36824D945 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:20Z' + X-Powered-By: + - ASP.NET + status: 200 OK + code: 200 + duration: 178.531467ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 224 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f","properties":{"principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","roleDefinitionId":"/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "224" + Content-Type: + - application/json + Test-Request-Hash: + - f75ef0ce4155919f556206b37b47852e6a91aa8f89a25e0c704d2d5c5cafbc0c + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f?api-version=2022-04-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1019 + uncompressed: false + body: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny","condition":null,"conditionVersion":null,"createdOn":"2001-02-03T04:05:06Z","updatedOn":"2001-02-03T04:05:06Z","createdBy":null,"updatedBy":"7fc43de6-8dfd-4804-ac82-3e5d71d9e477","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f","type":"Microsoft.Authorization/roleAssignments","name":"808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "1019" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "2999" + X-Msedge-Ref: + - 'Ref A: CFB1DDA8900A4CF3A3067A9CBF319A01 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:24Z' + status: 201 Created + code: 201 + duration: 2.682208901s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f?api-version=2022-04-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1053 + uncompressed: false + body: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny","condition":null,"conditionVersion":null,"createdOn":"2001-02-03T04:05:06Z","updatedOn":"2001-02-03T04:05:06Z","createdBy":"7fc43de6-8dfd-4804-ac82-3e5d71d9e477","updatedBy":"7fc43de6-8dfd-4804-ac82-3e5d71d9e477","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f","type":"Microsoft.Authorization/roleAssignments","name":"808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "1053" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: AEFBA3D3C41B4C50A62063521AAA3DDD Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:31Z' + status: 200 OK + code: 200 + duration: 333.325301ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f?api-version=2022-04-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1053 + uncompressed: false + body: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny","condition":null,"conditionVersion":null,"createdOn":"2001-02-03T04:05:06Z","updatedOn":"2001-02-03T04:05:06Z","createdBy":"7fc43de6-8dfd-4804-ac82-3e5d71d9e477","updatedBy":"7fc43de6-8dfd-4804-ac82-3e5d71d9e477","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f","type":"Microsoft.Authorization/roleAssignments","name":"808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "1053" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 0F17F6CAF31748A68D680F6A0D987B32 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:32Z' + status: 200 OK + code: 200 + duration: 277.877442ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 767 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl":{}}},"location":"eastus","name":"asotest-rule-vnlubb","properties":{"criteria":{"allOf":[{"failingPeriods":{"minFailingPeriodsToAlert":1,"numberOfEvaluationPeriods":1},"operator":"LessThan","query":"requests | summarize CountByCountry=count() by client_CountryOrRegion","threshold":10,"timeAggregation":"Count"}]},"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny"],"severity":0,"windowSize":"PT10M"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "767" + Content-Type: + - application/json + Test-Request-Hash: + - 063dbfc753b4f02c4e969f02a3edf8b44457137b053a1d81899a765539363195 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/scheduledQueryRules/asotest-rule-vnlubb?api-version=2024-01-01-preview + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1428 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/scheduledqueryrules/asotest-rule-vnlubb","name":"asotest-rule-vnlubb","type":"Microsoft.Insights/scheduledQueryRules","location":"eastus","systemData":{"createdBy":"andrei.barbu@uipath.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"andrei.barbu@uipath.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"identity":{"type":"UserAssigned","tenantId":"00000000-0000-0000-0000-000000000000","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl":{"clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4"}}},"properties":{"createdWithApiVersion":"2024-01-01-preview","severity":0,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"requests | summarize CountByCountry=count() by client_CountryOrRegion","timeAggregation":"Count","operator":"LessThan","threshold":10.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]}}}' + headers: + Api-Supported-Versions: + - 2017-09-01-preview, 2017-09-01, 2018-04-16, 2020-05-01-preview, 2021-02-01-preview, 2021-08-01, 2022-06-15, 2022-08-01-preview, 2023-03-15-preview, 2023-12-01, 2024-01-01-preview + Cache-Control: + - no-cache + Content-Length: + - "1428" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Set-Cookie: + - ARRAffinity=bd40cb4406af7e019459240c4b3391e3ad50b18834d5536b66832ba63d6a7358;Path=/;HttpOnly;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + - ARRAffinitySameSite=bd40cb4406af7e019459240c4b3391e3ad50b18834d5536b66832ba63d6a7358;Path=/;HttpOnly;SameSite=None;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 0DD0A3E3BA464F33B96AF1121938F799 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:34Z' + X-Powered-By: + - ASP.NET + X-Rate-Limit-Limit: + - 1m + X-Rate-Limit-Remaining: + - "29" + X-Rate-Limit-Reset: + - "2025-01-04T21:18:35.8619122Z" + status: 201 Created + code: 201 + duration: 6.981253554s + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/scheduledQueryRules/asotest-rule-vnlubb?api-version=2024-01-01-preview + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1428 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/scheduledqueryrules/asotest-rule-vnlubb","name":"asotest-rule-vnlubb","type":"Microsoft.Insights/scheduledQueryRules","location":"eastus","systemData":{"createdBy":"andrei.barbu@uipath.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"andrei.barbu@uipath.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"identity":{"type":"UserAssigned","tenantId":"00000000-0000-0000-0000-000000000000","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl":{"clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4"}}},"properties":{"createdWithApiVersion":"2024-01-01-preview","severity":0,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"requests | summarize CountByCountry=count() by client_CountryOrRegion","timeAggregation":"Count","operator":"LessThan","threshold":10.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]}}}' + headers: + Api-Supported-Versions: + - 2017-09-01-preview, 2017-09-01, 2018-04-16, 2020-05-01-preview, 2021-02-01-preview, 2021-08-01, 2022-06-15, 2022-08-01-preview, 2023-03-15-preview, 2023-12-01, 2024-01-01-preview + Cache-Control: + - no-cache + Content-Length: + - "1428" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Set-Cookie: + - ARRAffinity=1135860cb1787e6ecbd502a3790d0b01729a4523bbf848b5310d6027a3b35077;Path=/;HttpOnly;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + - ARRAffinitySameSite=1135860cb1787e6ecbd502a3790d0b01729a4523bbf848b5310d6027a3b35077;Path=/;HttpOnly;SameSite=None;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 53DC284EF7494E55B2EF20C40F8360BF Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:50Z' + X-Powered-By: + - ASP.NET + status: 200 OK + code: 200 + duration: 720.064463ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/scheduledQueryRules/asotest-rule-vnlubb?api-version=2024-01-01-preview + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1428 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/scheduledqueryrules/asotest-rule-vnlubb","name":"asotest-rule-vnlubb","type":"Microsoft.Insights/scheduledQueryRules","location":"eastus","systemData":{"createdBy":"andrei.barbu@uipath.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"andrei.barbu@uipath.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"identity":{"type":"UserAssigned","tenantId":"00000000-0000-0000-0000-000000000000","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl":{"clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4"}}},"properties":{"createdWithApiVersion":"2024-01-01-preview","severity":0,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"requests | summarize CountByCountry=count() by client_CountryOrRegion","timeAggregation":"Count","operator":"LessThan","threshold":10.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]}}}' + headers: + Api-Supported-Versions: + - 2017-09-01-preview, 2017-09-01, 2018-04-16, 2020-05-01-preview, 2021-02-01-preview, 2021-08-01, 2022-06-15, 2022-08-01-preview, 2023-03-15-preview, 2023-12-01, 2024-01-01-preview + Cache-Control: + - no-cache + Content-Length: + - "1428" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Set-Cookie: + - ARRAffinity=dbffd5fe3566b989206bb0d2d7a9f23e23e676213d4e69b0da029e867e9581be;Path=/;HttpOnly;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + - ARRAffinitySameSite=dbffd5fe3566b989206bb0d2d7a9f23e23e676213d4e69b0da029e867e9581be;Path=/;HttpOnly;SameSite=None;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 451D671AB9EA4B389344F17D2DBB09E5 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:51Z' + X-Powered-By: + - ASP.NET + status: 200 OK + code: 200 + duration: 1.003778952s + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 788 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl":{}}},"location":"eastus","name":"asotest-rule-vnlubb","properties":{"criteria":{"allOf":[{"failingPeriods":{"minFailingPeriodsToAlert":1,"numberOfEvaluationPeriods":1},"operator":"LessThan","query":"requests | summarize CountByCountry=count() by client_CountryOrRegion","threshold":10,"timeAggregation":"Count"}]},"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny"],"severity":0,"windowSize":"PT10M"},"tags":{"foo":"bar"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "788" + Content-Type: + - application/json + Test-Request-Hash: + - 4eaa374f8940f05df119c75228837785974509bef62add03ed8e30ce2ed24cbc + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/scheduledQueryRules/asotest-rule-vnlubb?api-version=2024-01-01-preview + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1449 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/scheduledqueryrules/asotest-rule-vnlubb","name":"asotest-rule-vnlubb","type":"Microsoft.Insights/scheduledQueryRules","location":"eastus","tags":{"foo":"bar"},"systemData":{"createdBy":"andrei.barbu@uipath.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"andrei.barbu@uipath.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"identity":{"type":"UserAssigned","tenantId":"00000000-0000-0000-0000-000000000000","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl":{"clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4"}}},"properties":{"createdWithApiVersion":"2024-01-01-preview","severity":0,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"requests | summarize CountByCountry=count() by client_CountryOrRegion","timeAggregation":"Count","operator":"LessThan","threshold":10.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]}}}' + headers: + Api-Supported-Versions: + - 2017-09-01-preview, 2017-09-01, 2018-04-16, 2020-05-01-preview, 2021-02-01-preview, 2021-08-01, 2022-06-15, 2022-08-01-preview, 2023-03-15-preview, 2023-12-01, 2024-01-01-preview + Cache-Control: + - no-cache + Content-Length: + - "1449" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Set-Cookie: + - ARRAffinity=93fb7eafabed342579d55cdc8bc202afb66fedcee6923b6f971167b265e56c7d;Path=/;HttpOnly;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + - ARRAffinitySameSite=93fb7eafabed342579d55cdc8bc202afb66fedcee6923b6f971167b265e56c7d;Path=/;HttpOnly;SameSite=None;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 0BC128E975A048E8BB5D649CFF3A4168 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:17:58Z' + X-Powered-By: + - ASP.NET + X-Rate-Limit-Limit: + - 1m + X-Rate-Limit-Remaining: + - "29" + X-Rate-Limit-Reset: + - "2025-01-04T21:18:59.9097791Z" + status: 200 OK + code: 200 + duration: 5.596240103s + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/scheduledQueryRules/asotest-rule-vnlubb?api-version=2024-01-01-preview + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1449 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/scheduledqueryrules/asotest-rule-vnlubb","name":"asotest-rule-vnlubb","type":"Microsoft.Insights/scheduledQueryRules","location":"eastus","tags":{"foo":"bar"},"systemData":{"createdBy":"andrei.barbu@uipath.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"andrei.barbu@uipath.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"identity":{"type":"UserAssigned","tenantId":"00000000-0000-0000-0000-000000000000","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl":{"clientId":"f47651b2-6ad7-40f2-a88c-6b772c730ad6","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4"}}},"properties":{"createdWithApiVersion":"2024-01-01-preview","severity":0,"enabled":true,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"requests | summarize CountByCountry=count() by client_CountryOrRegion","timeAggregation":"Count","operator":"LessThan","threshold":10.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]}}}' + headers: + Api-Supported-Versions: + - 2017-09-01-preview, 2017-09-01, 2018-04-16, 2020-05-01-preview, 2021-02-01-preview, 2021-08-01, 2022-06-15, 2022-08-01-preview, 2023-03-15-preview, 2023-12-01, 2024-01-01-preview + Cache-Control: + - no-cache + Content-Length: + - "1449" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Set-Cookie: + - ARRAffinity=936c5a1707dd3e2fcf89bbb614418d923f46b422b0bd509236f782b4798f469b;Path=/;HttpOnly;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + - ARRAffinitySameSite=936c5a1707dd3e2fcf89bbb614418d923f46b422b0bd509236f782b4798f469b;Path=/;HttpOnly;SameSite=None;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 4517DC20552E4A10B92D4059ADE69CBF Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:18:09Z' + X-Powered-By: + - ASP.NET + status: 200 OK + code: 200 + duration: 391.587957ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/scheduledQueryRules/asotest-rule-vnlubb?api-version=2024-01-01-preview + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Api-Supported-Versions: + - 2017-09-01-preview, 2017-09-01, 2018-04-16, 2020-05-01-preview, 2021-02-01-preview, 2021-08-01, 2022-06-15, 2022-08-01-preview, 2023-03-15-preview, 2023-12-01, 2024-01-01-preview + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Set-Cookie: + - ARRAffinity=d5e266b35b5458631210fa23598998ed376f688fa2a911f8ca5c0cf78f146b00;Path=/;HttpOnly;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + - ARRAffinitySameSite=d5e266b35b5458631210fa23598998ed376f688fa2a911f8ca5c0cf78f146b00;Path=/;HttpOnly;SameSite=None;Secure;Domain=lsa.eastus.prod.alertsrp.azure.com + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 2EDA47E4512D458D89BE97BC6DE7DC85 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:18:13Z' + X-Powered-By: + - ASP.NET + status: 200 OK + code: 200 + duration: 2.803555168s + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/scheduledqueryrules/asotest-rule-vnlubb?api-version=2024-01-01-preview + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 247 + uncompressed: false + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''microsoft.insights/scheduledqueryrules/asotest-rule-vnlubb'' under resource group ''asotest-rg-vrgxjp'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "247" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: 0FC72A55CDD74E9B9695ECFFD055BA23 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:18:23Z' + status: 404 Not Found + code: 404 + duration: 180.48166ms + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f?api-version=2022-04-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1053 + uncompressed: false + body: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635","principalId":"abb4f90a-44cb-4192-852c-eba9d9c44da4","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny","condition":null,"conditionVersion":null,"createdOn":"2001-02-03T04:05:06Z","updatedOn":"2001-02-03T04:05:06Z","createdBy":"7fc43de6-8dfd-4804-ac82-3e5d71d9e477","updatedBy":"7fc43de6-8dfd-4804-ac82-3e5d71d9e477","delegatedManagedIdentityResourceId":null,"description":null},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/microsoft.insights/components/asotest-component-jlfdny/providers/Microsoft.Authorization/roleAssignments/808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f","type":"Microsoft.Authorization/roleAssignments","name":"808c8e81-8a6a-4f58-ac6a-ef04e1f6b66f"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "1053" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 5CF6705248224777A1AE495F06F9B07D Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:18:24Z' + status: 200 OK + code: 200 + duration: 611.88282ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp?api-version=2020-06-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223052673718&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=OR_Irhx7XI598NK1IjZWeJdz4TTzV5oKflG6Z2l-DTPuv-OIWGRiHsBvp0tSPJt_6Rw69ZEDE3nRJbr3t9pS5GpKFv2AnFRPt6rHGpgyELR4KCz0eTK9LEAMdPMcTnNVdqxwonnQ56nsBogYXl-WxtjxSlM7ocC5q-xwue-r_y2rb5nNi9uV3RZX1vzgG94-IGEZchJpjvub92MMApU0wwSXrnx98cnN6g5bvcXtBsL9BN0YF1TyDzTSYXLBGuOmKlx-Vnz-kNZPje7-fPM7AZXCMpXcT1GdPuUIoIgTHq-TQtyHaPygPLIuccHuILrNG-xUkzHy_dF9nzbcndc4xQ&h=B9sxlBTncP_VjxIEt3de7oCGGF9hBMZsOMugIY0LPug + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "2999" + X-Msedge-Ref: + - 'Ref A: 9CDED66D524D48F080D472C0AFFDF187 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:18:24Z' + status: 202 Accepted + code: 202 + duration: 950.950017ms + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223052673718&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=OR_Irhx7XI598NK1IjZWeJdz4TTzV5oKflG6Z2l-DTPuv-OIWGRiHsBvp0tSPJt_6Rw69ZEDE3nRJbr3t9pS5GpKFv2AnFRPt6rHGpgyELR4KCz0eTK9LEAMdPMcTnNVdqxwonnQ56nsBogYXl-WxtjxSlM7ocC5q-xwue-r_y2rb5nNi9uV3RZX1vzgG94-IGEZchJpjvub92MMApU0wwSXrnx98cnN6g5bvcXtBsL9BN0YF1TyDzTSYXLBGuOmKlx-Vnz-kNZPje7-fPM7AZXCMpXcT1GdPuUIoIgTHq-TQtyHaPygPLIuccHuILrNG-xUkzHy_dF9nzbcndc4xQ&h=B9sxlBTncP_VjxIEt3de7oCGGF9hBMZsOMugIY0LPug + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223216514759&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=3ywMeJT8csalYz33BkWPsM1v--4MCUrQJv6CJwQRVq-YAvKBImEbzqyiN2pWzyh5IWGo5os4U9_B8brQOVy5uaTEb-bJSMbp58eGqZGdXdyWxHwYqwu84Dd2wdSq5RBh0CMEi_HAH7dQgOKrc5Dj_PjJVhicg1NYZrs7P4rGvMj36y42XEAKqZNwrGKlE0R94DrnDP1q71qbqrCghzqMmehGyrgKLI8m9GcELhJTMBv5gi078weDS0hFvbwQrEDEz5i3eST3J8YN0-C2Q9iOgDt87Vbp8gda2B9xbNMHpeVLJpJx_vE9GZ_SRImUN28iKtCjI5S_x5_2hXxQ21CoPw&h=4vd0_GK99PlMY-aUpbBYHXEiqhuRbTVzvrIZcJrqngk + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 80BC0B07703D43A68B2D24AD2A1B00FF Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:18:41Z' + status: 202 Accepted + code: 202 + duration: 384.527831ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223052673718&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=OR_Irhx7XI598NK1IjZWeJdz4TTzV5oKflG6Z2l-DTPuv-OIWGRiHsBvp0tSPJt_6Rw69ZEDE3nRJbr3t9pS5GpKFv2AnFRPt6rHGpgyELR4KCz0eTK9LEAMdPMcTnNVdqxwonnQ56nsBogYXl-WxtjxSlM7ocC5q-xwue-r_y2rb5nNi9uV3RZX1vzgG94-IGEZchJpjvub92MMApU0wwSXrnx98cnN6g5bvcXtBsL9BN0YF1TyDzTSYXLBGuOmKlx-Vnz-kNZPje7-fPM7AZXCMpXcT1GdPuUIoIgTHq-TQtyHaPygPLIuccHuILrNG-xUkzHy_dF9nzbcndc4xQ&h=B9sxlBTncP_VjxIEt3de7oCGGF9hBMZsOMugIY0LPug + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223374506903&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=ah0wRC2s2YroC4snNQWyFmmyaYEVaOOjcTZPWdacDkcUJXGsTlYvQ3oa8mTypMjvAyHT778-CksZiT7aDWrKsNyWoEB68Uc9XTXgq5fZfwnh56in5USqIg3QGNCFMKWUiL_vVFTS8io5Wr5rKqaj9_7atoQDqASOHFeLiHjiv50L3pkfyC-JZIXhMxIgfsXMAC1j0bs1nlajKQylGEH5xMhKRebrEtieVbm5PvrkhrIj5cUHaHxO3k536t32f2anQrQKL6jGi8xumvTUtBh3op8VhH375-7LTUkJaPQTSteF1RShLLDHwiGMmHOz19x_0a7T94x7GbZnVn0RimPGsg&h=XpSxpeSbGSv0ZyuB4p-h5GOlvcx8xPBowcRN3_678bk + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 50500C65BBEF45C1942E7191486CC919 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:18:57Z' + status: 202 Accepted + code: 202 + duration: 417.766157ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223052673718&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=OR_Irhx7XI598NK1IjZWeJdz4TTzV5oKflG6Z2l-DTPuv-OIWGRiHsBvp0tSPJt_6Rw69ZEDE3nRJbr3t9pS5GpKFv2AnFRPt6rHGpgyELR4KCz0eTK9LEAMdPMcTnNVdqxwonnQ56nsBogYXl-WxtjxSlM7ocC5q-xwue-r_y2rb5nNi9uV3RZX1vzgG94-IGEZchJpjvub92MMApU0wwSXrnx98cnN6g5bvcXtBsL9BN0YF1TyDzTSYXLBGuOmKlx-Vnz-kNZPje7-fPM7AZXCMpXcT1GdPuUIoIgTHq-TQtyHaPygPLIuccHuILrNG-xUkzHy_dF9nzbcndc4xQ&h=B9sxlBTncP_VjxIEt3de7oCGGF9hBMZsOMugIY0LPug + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223531014293&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=cKXxEeypnaBOMxX9ki_X1Xf2WLE_kmGMKc43jyjNaNfivEeubVdV69L0GpgCJHH7_kS_vC7_HGw28chqQm0Tp2Q1eRF1FS8U-Ris_dCH8S00WggBSfK3NDPA7-Gi6nppgpD3NoCsHG9XT5AdwLqQpw-dyc-PnMQzsfAi99212Y7Fgcf_11eNDdV8aJsMcSfzHeBY4N4mf0RpA-j3urJtupgYcuZPHE-57eyqDHHGYKYLmV-2H-ATrWfSA7cSgm_WauVxixbk6tY1WPiTP1OhzS8ubM_3_cs9C47R-AeMNvZ_tetncUUyaD5k4TMeIfgqS-pczwmaQUBZWlt7mwL6YA&h=7Ot1LS90L2Tc5LhGBOQFL8MBk2dIbSSrTKwRSYAEyE0 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: 3F3059EEB2414D6F9AB5E4C96EF8EC45 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:19:12Z' + status: 202 Accepted + code: 202 + duration: 227.322024ms + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWUkdYSlAtRUFTVFVTIiwiam9iTG9jYXRpb24iOiJlYXN0dXMifQ?api-version=2020-06-01&t=638716223052673718&c=MIIHpTCCBo2gAwIBAgITOgM6dTLGpzYZpvPtgQAEAzp1MjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSU5GUkEgQ0EgMDEwHhcNMjQwNjI2MDEzMjIxWhcNMjUwNjIxMDEzMjIxWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPPPKY5bDN03KptFFhiyLIyn86BlrXYFIZWYXA-hY7_WbLyWN0IxcLIUBW_I-9u-YsXOHk9WPMlUYHIFPgHW7A3FsSGfl9dd6YGapKoSSw0NkTpNXM58R54BBgLp7AhiWzK15D9T-XELNSU4Wq9sEeA5T24kazcgS2MUkzELH0I9dwu7g0dwJIuIJkoJjEzg1b1Q3Ie5HKHHNbjottJn7Q5LBS-9QtQyruuwaNTgSJpCoi4PBKVIOTBYL_Nv1wecmKmfWcT0mnhQE9zjhJTbcoN9hKSvAMqsDHtxWUFZosiw3JKIY0zb59CrVGSuOhfN3qaarwN9EAlXLqc4ZyKpsTkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CWTJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSU5GUkElMjBDQSUyMDAxKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQlkyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMElORlJBJTIwQ0ElMjAwMSg0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JZMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3J0MB0GA1UdDgQWBBRk_38CqdKjPVylWUR4uuqhbFGeHTAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJTkZSQSUyMENBJTIwMDEoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEATAfBgNVHSMEGDAWgBTl2Ztn_PjsurvwwKidileIud8-YzAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFsx7FtYAzSo98T5ydNFa0ukjPZ6XCQc9zo7ldqy235P_zJAUkaNgCU4EGOzbZJDoMa8mAfhyukL_0GfPeApUaY2e44ZOzoYAkeEuDiwcs-9zoQ1fCyXhn0pCumGFXRilX9KjAPaYTzDvQMEllTy_ZViwTahuKaGtFVamZguBPdaeYC_0oybtTVNQCs8hGnffhNZOMASB-5pFs35MNxsDWTVIQksDee419jqpsbWLkh6rnanILO1O_ihwb-WpvRQByQ5NGpG1-z0MQ6nRpr9wWxUi-DsrVsD38NTMIPc2uei4Ivf6qnGRvOOj0fmsciWuTTEXMaD-5a81mGlzhZc09Q&s=OR_Irhx7XI598NK1IjZWeJdz4TTzV5oKflG6Z2l-DTPuv-OIWGRiHsBvp0tSPJt_6Rw69ZEDE3nRJbr3t9pS5GpKFv2AnFRPt6rHGpgyELR4KCz0eTK9LEAMdPMcTnNVdqxwonnQ56nsBogYXl-WxtjxSlM7ocC5q-xwue-r_y2rb5nNi9uV3RZX1vzgG94-IGEZchJpjvub92MMApU0wwSXrnx98cnN6g5bvcXtBsL9BN0YF1TyDzTSYXLBGuOmKlx-Vnz-kNZPje7-fPM7AZXCMpXcT1GdPuUIoIgTHq-TQtyHaPygPLIuccHuILrNG-xUkzHy_dF9nzbcndc4xQ&h=B9sxlBTncP_VjxIEt3de7oCGGF9hBMZsOMugIY0LPug + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "3749" + X-Msedge-Ref: + - 'Ref A: F12014CC30384082B27346EB677B2605 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:19:28Z' + status: 200 OK + code: 200 + duration: 256.1841ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.Insights/components/asotest-component-jlfdny?api-version=2020-02-02 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-vrgxjp'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: 0E63AC4DD15C4A43898E6F92104015B4 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:19:29Z' + status: 404 Not Found + code: 404 + duration: 182.938219ms + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vrgxjp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asotest-mi-jkuszl?api-version=2023-01-31 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-vrgxjp'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: C771CA182FE5485BB6DCFA65BA4DAC89 Ref B: CO6AA3150220019 Ref C: 2025-01-04T21:19:29Z' + status: 404 Not Found + code: 404 + duration: 232.354003ms diff --git a/v2/samples/insights/v1api/v1api20220615_scheduledqueryrule.yaml b/v2/samples/insights/v1api20220615/v1api20220615_scheduledqueryrule.yaml similarity index 100% rename from v2/samples/insights/v1api/v1api20220615_scheduledqueryrule.yaml rename to v2/samples/insights/v1api20220615/v1api20220615_scheduledqueryrule.yaml diff --git a/v2/samples/insights/v1api20240101preview/refs/v1api20181130_userassignedidentity.yaml b/v2/samples/insights/v1api20240101preview/refs/v1api20181130_userassignedidentity.yaml new file mode 100644 index 00000000000..e5568d33312 --- /dev/null +++ b/v2/samples/insights/v1api20240101preview/refs/v1api20181130_userassignedidentity.yaml @@ -0,0 +1,17 @@ +apiVersion: managedidentity.azure.com/v1api20181130 +kind: UserAssignedIdentity +metadata: + name: adminidentity + namespace: default +spec: + location: eastus + owner: + name: aso-sample-rg + operatorSpec: + configMaps: + tenantId: + name: admin-settings + key: tenantId + clientId: + name: admin-settings + key: clientId diff --git a/v2/samples/insights/v1api20240101preview/v1api20240101preview_scheduledqueryrule.yaml b/v2/samples/insights/v1api20240101preview/v1api20240101preview_scheduledqueryrule.yaml new file mode 100644 index 00000000000..8b72fc4dc9b --- /dev/null +++ b/v2/samples/insights/v1api20240101preview/v1api20240101preview_scheduledqueryrule.yaml @@ -0,0 +1,32 @@ +apiVersion: insights.azure.com/v1api20240101preview +kind: ScheduledQueryRule +metadata: + name: aso-sample-rule + namespace: default +spec: + criteria: + allOf: + - failingPeriods: + minFailingPeriodsToAlert: 1 + numberOfEvaluationPeriods: 1 + operator: LessThan + query: "requests | summarize CountByCountry=count() by client_CountryOrRegion" + threshold: 10 + timeAggregation: Count + evaluationFrequency: PT10M + identity: + type: UserAssigned + userAssignedIdentities: + - reference: + group: managedidentity.azure.com + kind: UserAssignedIdentity + name: adminidentity + location: westus2 + owner: + name: aso-sample-rg + scopesReferences: + - group: insights.azure.com + kind: Component + name: sampleappinsights + severity: 0 + windowSize: PT10M