diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index 720b9f7dcd5..19cf1106ec4 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -850,6 +850,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 `operationalinsights.azure.com/*` as 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 | +|-----------|-------------|---------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------| +| Workspace | 2025-07-01 | v1api20250701 | v2.17.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/operationalinsights/v1api/v1api20250701_workspace.yaml) | + ### 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. diff --git a/docs/hugo/content/reference/operationalinsights/_index.md b/docs/hugo/content/reference/operationalinsights/_index.md index 8084b9f4090..a89a92199a6 100644 --- a/docs/hugo/content/reference/operationalinsights/_index.md +++ b/docs/hugo/content/reference/operationalinsights/_index.md @@ -5,6 +5,14 @@ no_list: true --- To install the CRDs for these resources, your ASO configuration must include `operationalinsights.azure.com/*` as 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 | +|-----------|-------------|---------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------| +| Workspace | 2025-07-01 | v1api20250701 | v2.17.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/operationalinsights/v1api/v1api20250701_workspace.yaml) | + ### 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. diff --git a/v2/api/operationalinsights/customizations/workspace_extension.go b/v2/api/operationalinsights/customizations/workspace_extension.go index b0ce7d9e2d8..21af6bf3cde 100644 --- a/v2/api/operationalinsights/customizations/workspace_extension.go +++ b/v2/api/operationalinsights/customizations/workspace_extension.go @@ -16,7 +16,7 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/conversion" - "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/storage" + "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/storage" "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" "github.com/Azure/azure-service-operator/v2/internal/set" "github.com/Azure/azure-service-operator/v2/internal/util/to" diff --git a/v2/api/operationalinsights/customizations/workspace_extension_types_gen.go b/v2/api/operationalinsights/customizations/workspace_extension_types_gen.go index 7a7653ce762..ae5d85da730 100644 --- a/v2/api/operationalinsights/customizations/workspace_extension_types_gen.go +++ b/v2/api/operationalinsights/customizations/workspace_extension_types_gen.go @@ -5,7 +5,9 @@ package customizations import ( v20210601 "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601" - storage "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/storage" + v20210601s "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/storage" + v20250701 "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701" + v20250701s "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +18,7 @@ type WorkspaceExtension struct { func (extension *WorkspaceExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20210601.Workspace{}, - &storage.Workspace{}} + &v20210601s.Workspace{}, + &v20250701.Workspace{}, + &v20250701s.Workspace{}} } diff --git a/v2/api/operationalinsights/v1api20210601/storage/structure.txt b/v2/api/operationalinsights/v1api20210601/storage/structure.txt index 140e9047302..62796ebf152 100644 --- a/v2/api/operationalinsights/v1api20210601/storage/structure.txt +++ b/v2/api/operationalinsights/v1api20210601/storage/structure.txt @@ -80,3 +80,27 @@ Workspace: Resource ├── PropertyBag: genruntime.PropertyBag └── QuotaNextResetTime: *string +augmentConversionForPrivateLinkScopedResource_STATUS: Interface + +augmentConversionForWorkspace: Interface + +augmentConversionForWorkspaceCapping: Interface + +augmentConversionForWorkspaceCapping_STATUS: Interface + +augmentConversionForWorkspaceFeatures: Interface + +augmentConversionForWorkspaceFeatures_STATUS: Interface + +augmentConversionForWorkspaceOperatorSecrets: Interface + +augmentConversionForWorkspaceOperatorSpec: Interface + +augmentConversionForWorkspaceSku: Interface + +augmentConversionForWorkspaceSku_STATUS: Interface + +augmentConversionForWorkspace_STATUS: Interface + +augmentConversionForWorkspace_Spec: Interface + diff --git a/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go b/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go index 3f1146537a8..057383eedbb 100644 --- a/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go +++ b/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen.go @@ -4,6 +4,8 @@ package storage import ( + "fmt" + storage "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/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" @@ -12,15 +14,12 @@ import ( "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:rbac:groups=operationalinsights.azure.com,resources=workspaces,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=operationalinsights.azure.com,resources={workspaces/status,workspaces/finalizers},verbs=get;update;patch - // +kubebuilder:object:root=true // +kubebuilder:resource:categories={azure,operationalinsights} // +kubebuilder:subresource:status -// +kubebuilder:storageversion // +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" @@ -48,6 +47,28 @@ func (workspace *Workspace) SetConditions(conditions conditions.Conditions) { workspace.Status.Conditions = conditions } +var _ conversion.Convertible = &Workspace{} + +// ConvertFrom populates our Workspace from the provided hub Workspace +func (workspace *Workspace) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*storage.Workspace) + if !ok { + return fmt.Errorf("expected operationalinsights/v1api20250701/storage/Workspace but received %T instead", hub) + } + + return workspace.AssignProperties_From_Workspace(source) +} + +// ConvertTo populates the provided hub Workspace from our Workspace +func (workspace *Workspace) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*storage.Workspace) + if !ok { + return fmt.Errorf("expected operationalinsights/v1api20250701/storage/Workspace but received %T instead", hub) + } + + return workspace.AssignProperties_To_Workspace(destination) +} + var _ configmaps.Exporter = &Workspace{} // ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property @@ -143,8 +164,75 @@ func (workspace *Workspace) SetStatus(status genruntime.ConvertibleStatus) error return nil } -// Hub marks that this Workspace is the hub type for conversion -func (workspace *Workspace) Hub() {} +// AssignProperties_From_Workspace populates our Workspace from the provided source Workspace +func (workspace *Workspace) AssignProperties_From_Workspace(source *storage.Workspace) error { + + // ObjectMeta + workspace.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Workspace_Spec + err := spec.AssignProperties_From_Workspace_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Workspace_Spec() to populate field Spec") + } + workspace.Spec = spec + + // Status + var status Workspace_STATUS + err = status.AssignProperties_From_Workspace_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Workspace_STATUS() to populate field Status") + } + workspace.Status = status + + // Invoke the augmentConversionForWorkspace interface (if implemented) to customize the conversion + var workspaceAsAny any = workspace + if augmentedWorkspace, ok := workspaceAsAny.(augmentConversionForWorkspace); ok { + err := augmentedWorkspace.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Workspace populates the provided destination Workspace from our Workspace +func (workspace *Workspace) AssignProperties_To_Workspace(destination *storage.Workspace) error { + + // ObjectMeta + destination.ObjectMeta = *workspace.ObjectMeta.DeepCopy() + + // Spec + var spec storage.Workspace_Spec + err := workspace.Spec.AssignProperties_To_Workspace_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Workspace_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.Workspace_STATUS + err = workspace.Status.AssignProperties_To_Workspace_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Workspace_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForWorkspace interface (if implemented) to customize the conversion + var workspaceAsAny any = workspace + if augmentedWorkspace, ok := workspaceAsAny.(augmentConversionForWorkspace); ok { + err := augmentedWorkspace.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 (workspace *Workspace) OriginalGVK() *schema.GroupVersionKind { @@ -172,6 +260,11 @@ type APIVersion string const APIVersion_Value = APIVersion("2021-06-01") +type augmentConversionForWorkspace interface { + AssignPropertiesFrom(src *storage.Workspace) error + AssignPropertiesTo(dst *storage.Workspace) error +} + // Storage version of v1api20210601.Workspace_Spec type Workspace_Spec struct { // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it @@ -203,20 +296,356 @@ var _ genruntime.ConvertibleSpec = &Workspace_Spec{} // ConvertSpecFrom populates our Workspace_Spec from the provided source func (workspace *Workspace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == workspace { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*storage.Workspace_Spec) + if ok { + // Populate our instance from source + return workspace.AssignProperties_From_Workspace_Spec(src) + } + + // Convert to an intermediate form + src = &storage.Workspace_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = workspace.AssignProperties_From_Workspace_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(workspace) + return nil } // ConvertSpecTo populates the provided destination from our Workspace_Spec func (workspace *Workspace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == workspace { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*storage.Workspace_Spec) + if ok { + // Populate destination from our instance + return workspace.AssignProperties_To_Workspace_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.Workspace_Spec{} + err := workspace.AssignProperties_To_Workspace_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") } - return destination.ConvertSpecFrom(workspace) + // 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_Workspace_Spec populates our Workspace_Spec from the provided source Workspace_Spec +func (workspace *Workspace_Spec) AssignProperties_From_Workspace_Spec(source *storage.Workspace_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AzureName + workspace.AzureName = source.AzureName + + // DefaultDataCollectionRuleResourceReference + if source.DefaultDataCollectionRuleResourceReference != nil { + propertyBag.Add("DefaultDataCollectionRuleResourceReference", *source.DefaultDataCollectionRuleResourceReference) + } else { + propertyBag.Remove("DefaultDataCollectionRuleResourceReference") + } + + // Etag + workspace.Etag = genruntime.ClonePointerToString(source.Etag) + + // Features + if source.Features != nil { + var feature WorkspaceFeatures + err := feature.AssignProperties_From_WorkspaceFeatures(source.Features) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceFeatures() to populate field Features") + } + workspace.Features = &feature + } else { + workspace.Features = nil + } + + // ForceCmkForQuery + if source.ForceCmkForQuery != nil { + forceCmkForQuery := *source.ForceCmkForQuery + workspace.ForceCmkForQuery = &forceCmkForQuery + } else { + workspace.ForceCmkForQuery = nil + } + + // Identity + if source.Identity != nil { + propertyBag.Add("Identity", *source.Identity) + } else { + propertyBag.Remove("Identity") + } + + // Location + workspace.Location = genruntime.ClonePointerToString(source.Location) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec WorkspaceOperatorSpec + err := operatorSpec.AssignProperties_From_WorkspaceOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceOperatorSpec() to populate field OperatorSpec") + } + workspace.OperatorSpec = &operatorSpec + } else { + workspace.OperatorSpec = nil + } + + // OriginalVersion + workspace.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + workspace.Owner = &owner + } else { + workspace.Owner = nil + } + + // ProvisioningState + if propertyBag.Contains("ProvisioningState") { + var provisioningState string + err := propertyBag.Pull("ProvisioningState", &provisioningState) + if err != nil { + return eris.Wrap(err, "pulling 'ProvisioningState' from propertyBag") + } + + workspace.ProvisioningState = &provisioningState + } else { + workspace.ProvisioningState = nil + } + + // PublicNetworkAccessForIngestion + workspace.PublicNetworkAccessForIngestion = genruntime.ClonePointerToString(source.PublicNetworkAccessForIngestion) + + // PublicNetworkAccessForQuery + workspace.PublicNetworkAccessForQuery = genruntime.ClonePointerToString(source.PublicNetworkAccessForQuery) + + // Replication + if source.Replication != nil { + propertyBag.Add("Replication", *source.Replication) + } else { + propertyBag.Remove("Replication") + } + + // RetentionInDays + workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays) + + // Sku + if source.Sku != nil { + var sku WorkspaceSku + err := sku.AssignProperties_From_WorkspaceSku(source.Sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceSku() to populate field Sku") + } + workspace.Sku = &sku + } else { + workspace.Sku = nil + } + + // Tags + workspace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // WorkspaceCapping + if source.WorkspaceCapping != nil { + var workspaceCapping WorkspaceCapping + err := workspaceCapping.AssignProperties_From_WorkspaceCapping(source.WorkspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceCapping() to populate field WorkspaceCapping") + } + workspace.WorkspaceCapping = &workspaceCapping + } else { + workspace.WorkspaceCapping = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + workspace.PropertyBag = propertyBag + } else { + workspace.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspace_Spec interface (if implemented) to customize the conversion + var workspaceAsAny any = workspace + if augmentedWorkspace, ok := workspaceAsAny.(augmentConversionForWorkspace_Spec); ok { + err := augmentedWorkspace.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Workspace_Spec populates the provided destination Workspace_Spec from our Workspace_Spec +func (workspace *Workspace_Spec) AssignProperties_To_Workspace_Spec(destination *storage.Workspace_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(workspace.PropertyBag) + + // AzureName + destination.AzureName = workspace.AzureName + + // DefaultDataCollectionRuleResourceReference + if propertyBag.Contains("DefaultDataCollectionRuleResourceReference") { + var defaultDataCollectionRuleResourceReference genruntime.ResourceReference + err := propertyBag.Pull("DefaultDataCollectionRuleResourceReference", &defaultDataCollectionRuleResourceReference) + if err != nil { + return eris.Wrap(err, "pulling 'DefaultDataCollectionRuleResourceReference' from propertyBag") + } + + destination.DefaultDataCollectionRuleResourceReference = &defaultDataCollectionRuleResourceReference + } else { + destination.DefaultDataCollectionRuleResourceReference = nil + } + + // Etag + destination.Etag = genruntime.ClonePointerToString(workspace.Etag) + + // Features + if workspace.Features != nil { + var feature storage.WorkspaceFeatures + err := workspace.Features.AssignProperties_To_WorkspaceFeatures(&feature) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceFeatures() to populate field Features") + } + destination.Features = &feature + } else { + destination.Features = nil + } + + // ForceCmkForQuery + if workspace.ForceCmkForQuery != nil { + forceCmkForQuery := *workspace.ForceCmkForQuery + destination.ForceCmkForQuery = &forceCmkForQuery + } else { + destination.ForceCmkForQuery = nil + } + + // Identity + if propertyBag.Contains("Identity") { + var identity storage.Identity + err := propertyBag.Pull("Identity", &identity) + if err != nil { + return eris.Wrap(err, "pulling 'Identity' from propertyBag") + } + + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(workspace.Location) + + // OperatorSpec + if workspace.OperatorSpec != nil { + var operatorSpec storage.WorkspaceOperatorSpec + err := workspace.OperatorSpec.AssignProperties_To_WorkspaceOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = workspace.OriginalVersion + + // Owner + if workspace.Owner != nil { + owner := workspace.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // ProvisioningState + if workspace.ProvisioningState != nil { + propertyBag.Add("ProvisioningState", *workspace.ProvisioningState) + } else { + propertyBag.Remove("ProvisioningState") + } + + // PublicNetworkAccessForIngestion + destination.PublicNetworkAccessForIngestion = genruntime.ClonePointerToString(workspace.PublicNetworkAccessForIngestion) + + // PublicNetworkAccessForQuery + destination.PublicNetworkAccessForQuery = genruntime.ClonePointerToString(workspace.PublicNetworkAccessForQuery) + + // Replication + if propertyBag.Contains("Replication") { + var replication storage.WorkspaceReplicationProperties + err := propertyBag.Pull("Replication", &replication) + if err != nil { + return eris.Wrap(err, "pulling 'Replication' from propertyBag") + } + + destination.Replication = &replication + } else { + destination.Replication = nil + } + + // RetentionInDays + destination.RetentionInDays = genruntime.ClonePointerToInt(workspace.RetentionInDays) + + // Sku + if workspace.Sku != nil { + var sku storage.WorkspaceSku + err := workspace.Sku.AssignProperties_To_WorkspaceSku(&sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceSku() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(workspace.Tags) + + // WorkspaceCapping + if workspace.WorkspaceCapping != nil { + var workspaceCapping storage.WorkspaceCapping + err := workspace.WorkspaceCapping.AssignProperties_To_WorkspaceCapping(&workspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceCapping() to populate field WorkspaceCapping") + } + destination.WorkspaceCapping = &workspaceCapping + } else { + destination.WorkspaceCapping = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspace_Spec interface (if implemented) to customize the conversion + var workspaceAsAny any = workspace + if augmentedWorkspace, ok := workspaceAsAny.(augmentConversionForWorkspace_Spec); ok { + err := augmentedWorkspace.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20210601.Workspace_STATUS @@ -248,20 +677,414 @@ var _ genruntime.ConvertibleStatus = &Workspace_STATUS{} // ConvertStatusFrom populates our Workspace_STATUS from the provided source func (workspace *Workspace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == workspace { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*storage.Workspace_STATUS) + if ok { + // Populate our instance from source + return workspace.AssignProperties_From_Workspace_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.Workspace_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = workspace.AssignProperties_From_Workspace_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(workspace) + return nil } // ConvertStatusTo populates the provided destination from our Workspace_STATUS func (workspace *Workspace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == workspace { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*storage.Workspace_STATUS) + if ok { + // Populate destination from our instance + return workspace.AssignProperties_To_Workspace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.Workspace_STATUS{} + err := workspace.AssignProperties_To_Workspace_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_Workspace_STATUS populates our Workspace_STATUS from the provided source Workspace_STATUS +func (workspace *Workspace_STATUS) AssignProperties_From_Workspace_STATUS(source *storage.Workspace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Conditions + workspace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedDate + workspace.CreatedDate = genruntime.ClonePointerToString(source.CreatedDate) + + // CustomerId + workspace.CustomerId = genruntime.ClonePointerToString(source.CustomerId) + + // DefaultDataCollectionRuleResourceId + if source.DefaultDataCollectionRuleResourceId != nil { + propertyBag.Add("DefaultDataCollectionRuleResourceId", *source.DefaultDataCollectionRuleResourceId) + } else { + propertyBag.Remove("DefaultDataCollectionRuleResourceId") + } + + // Etag + workspace.Etag = genruntime.ClonePointerToString(source.Etag) + + // Failover + if source.Failover != nil { + propertyBag.Add("Failover", *source.Failover) + } else { + propertyBag.Remove("Failover") + } + + // Features + if source.Features != nil { + var feature WorkspaceFeatures_STATUS + err := feature.AssignProperties_From_WorkspaceFeatures_STATUS(source.Features) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceFeatures_STATUS() to populate field Features") + } + workspace.Features = &feature + } else { + workspace.Features = nil + } + + // ForceCmkForQuery + if source.ForceCmkForQuery != nil { + forceCmkForQuery := *source.ForceCmkForQuery + workspace.ForceCmkForQuery = &forceCmkForQuery + } else { + workspace.ForceCmkForQuery = nil + } + + // Id + workspace.Id = genruntime.ClonePointerToString(source.Id) + + // Identity + if source.Identity != nil { + propertyBag.Add("Identity", *source.Identity) + } else { + propertyBag.Remove("Identity") + } + + // Location + workspace.Location = genruntime.ClonePointerToString(source.Location) + + // ModifiedDate + workspace.ModifiedDate = genruntime.ClonePointerToString(source.ModifiedDate) + + // Name + workspace.Name = genruntime.ClonePointerToString(source.Name) + + // PrivateLinkScopedResources + if source.PrivateLinkScopedResources != nil { + privateLinkScopedResourceList := make([]PrivateLinkScopedResource_STATUS, len(source.PrivateLinkScopedResources)) + for privateLinkScopedResourceIndex, privateLinkScopedResourceItem := range source.PrivateLinkScopedResources { + var privateLinkScopedResource PrivateLinkScopedResource_STATUS + err := privateLinkScopedResource.AssignProperties_From_PrivateLinkScopedResource_STATUS(&privateLinkScopedResourceItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkScopedResource_STATUS() to populate field PrivateLinkScopedResources") + } + privateLinkScopedResourceList[privateLinkScopedResourceIndex] = privateLinkScopedResource + } + workspace.PrivateLinkScopedResources = privateLinkScopedResourceList + } else { + workspace.PrivateLinkScopedResources = nil + } + + // ProvisioningState + workspace.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState) + + // PublicNetworkAccessForIngestion + workspace.PublicNetworkAccessForIngestion = genruntime.ClonePointerToString(source.PublicNetworkAccessForIngestion) + + // PublicNetworkAccessForQuery + workspace.PublicNetworkAccessForQuery = genruntime.ClonePointerToString(source.PublicNetworkAccessForQuery) + + // Replication + if source.Replication != nil { + propertyBag.Add("Replication", *source.Replication) + } else { + propertyBag.Remove("Replication") + } + + // RetentionInDays + workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays) + + // Sku + if source.Sku != nil { + var sku WorkspaceSku_STATUS + err := sku.AssignProperties_From_WorkspaceSku_STATUS(source.Sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceSku_STATUS() to populate field Sku") + } + workspace.Sku = &sku + } else { + workspace.Sku = nil + } + + // SystemData + if source.SystemData != nil { + propertyBag.Add("SystemData", *source.SystemData) + } else { + propertyBag.Remove("SystemData") + } + + // Tags + workspace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // Type + workspace.Type = genruntime.ClonePointerToString(source.Type) + + // WorkspaceCapping + if source.WorkspaceCapping != nil { + var workspaceCapping WorkspaceCapping_STATUS + err := workspaceCapping.AssignProperties_From_WorkspaceCapping_STATUS(source.WorkspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceCapping_STATUS() to populate field WorkspaceCapping") + } + workspace.WorkspaceCapping = &workspaceCapping + } else { + workspace.WorkspaceCapping = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + workspace.PropertyBag = propertyBag + } else { + workspace.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspace_STATUS interface (if implemented) to customize the conversion + var workspaceAsAny any = workspace + if augmentedWorkspace, ok := workspaceAsAny.(augmentConversionForWorkspace_STATUS); ok { + err := augmentedWorkspace.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Workspace_STATUS populates the provided destination Workspace_STATUS from our Workspace_STATUS +func (workspace *Workspace_STATUS) AssignProperties_To_Workspace_STATUS(destination *storage.Workspace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(workspace.PropertyBag) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(workspace.Conditions) + + // CreatedDate + destination.CreatedDate = genruntime.ClonePointerToString(workspace.CreatedDate) + + // CustomerId + destination.CustomerId = genruntime.ClonePointerToString(workspace.CustomerId) + + // DefaultDataCollectionRuleResourceId + if propertyBag.Contains("DefaultDataCollectionRuleResourceId") { + var defaultDataCollectionRuleResourceId string + err := propertyBag.Pull("DefaultDataCollectionRuleResourceId", &defaultDataCollectionRuleResourceId) + if err != nil { + return eris.Wrap(err, "pulling 'DefaultDataCollectionRuleResourceId' from propertyBag") + } + + destination.DefaultDataCollectionRuleResourceId = &defaultDataCollectionRuleResourceId + } else { + destination.DefaultDataCollectionRuleResourceId = nil + } + + // Etag + destination.Etag = genruntime.ClonePointerToString(workspace.Etag) + + // Failover + if propertyBag.Contains("Failover") { + var failover storage.WorkspaceFailoverProperties_STATUS + err := propertyBag.Pull("Failover", &failover) + if err != nil { + return eris.Wrap(err, "pulling 'Failover' from propertyBag") + } + + destination.Failover = &failover + } else { + destination.Failover = nil + } + + // Features + if workspace.Features != nil { + var feature storage.WorkspaceFeatures_STATUS + err := workspace.Features.AssignProperties_To_WorkspaceFeatures_STATUS(&feature) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceFeatures_STATUS() to populate field Features") + } + destination.Features = &feature + } else { + destination.Features = nil + } + + // ForceCmkForQuery + if workspace.ForceCmkForQuery != nil { + forceCmkForQuery := *workspace.ForceCmkForQuery + destination.ForceCmkForQuery = &forceCmkForQuery + } else { + destination.ForceCmkForQuery = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(workspace.Id) + + // Identity + if propertyBag.Contains("Identity") { + var identity storage.Identity_STATUS + err := propertyBag.Pull("Identity", &identity) + if err != nil { + return eris.Wrap(err, "pulling 'Identity' from propertyBag") + } + + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(workspace.Location) + + // ModifiedDate + destination.ModifiedDate = genruntime.ClonePointerToString(workspace.ModifiedDate) + + // Name + destination.Name = genruntime.ClonePointerToString(workspace.Name) + + // PrivateLinkScopedResources + if workspace.PrivateLinkScopedResources != nil { + privateLinkScopedResourceList := make([]storage.PrivateLinkScopedResource_STATUS, len(workspace.PrivateLinkScopedResources)) + for privateLinkScopedResourceIndex, privateLinkScopedResourceItem := range workspace.PrivateLinkScopedResources { + var privateLinkScopedResource storage.PrivateLinkScopedResource_STATUS + err := privateLinkScopedResourceItem.AssignProperties_To_PrivateLinkScopedResource_STATUS(&privateLinkScopedResource) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkScopedResource_STATUS() to populate field PrivateLinkScopedResources") + } + privateLinkScopedResourceList[privateLinkScopedResourceIndex] = privateLinkScopedResource + } + destination.PrivateLinkScopedResources = privateLinkScopedResourceList + } else { + destination.PrivateLinkScopedResources = nil + } + + // ProvisioningState + destination.ProvisioningState = genruntime.ClonePointerToString(workspace.ProvisioningState) + + // PublicNetworkAccessForIngestion + destination.PublicNetworkAccessForIngestion = genruntime.ClonePointerToString(workspace.PublicNetworkAccessForIngestion) + + // PublicNetworkAccessForQuery + destination.PublicNetworkAccessForQuery = genruntime.ClonePointerToString(workspace.PublicNetworkAccessForQuery) + + // Replication + if propertyBag.Contains("Replication") { + var replication storage.WorkspaceReplicationProperties_STATUS + err := propertyBag.Pull("Replication", &replication) + if err != nil { + return eris.Wrap(err, "pulling 'Replication' from propertyBag") + } + + destination.Replication = &replication + } else { + destination.Replication = nil } - return destination.ConvertStatusFrom(workspace) + // RetentionInDays + destination.RetentionInDays = genruntime.ClonePointerToInt(workspace.RetentionInDays) + + // Sku + if workspace.Sku != nil { + var sku storage.WorkspaceSku_STATUS + err := workspace.Sku.AssignProperties_To_WorkspaceSku_STATUS(&sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceSku_STATUS() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // SystemData + if propertyBag.Contains("SystemData") { + var systemDatum storage.SystemData_STATUS + err := propertyBag.Pull("SystemData", &systemDatum) + if err != nil { + return eris.Wrap(err, "pulling 'SystemData' from propertyBag") + } + + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(workspace.Tags) + + // Type + destination.Type = genruntime.ClonePointerToString(workspace.Type) + + // WorkspaceCapping + if workspace.WorkspaceCapping != nil { + var workspaceCapping storage.WorkspaceCapping_STATUS + err := workspace.WorkspaceCapping.AssignProperties_To_WorkspaceCapping_STATUS(&workspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceCapping_STATUS() to populate field WorkspaceCapping") + } + destination.WorkspaceCapping = &workspaceCapping + } else { + destination.WorkspaceCapping = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspace_STATUS interface (if implemented) to customize the conversion + var workspaceAsAny any = workspace + if augmentedWorkspace, ok := workspaceAsAny.(augmentConversionForWorkspace_STATUS); ok { + err := augmentedWorkspace.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForWorkspace_Spec interface { + AssignPropertiesFrom(src *storage.Workspace_Spec) error + AssignPropertiesTo(dst *storage.Workspace_Spec) error +} + +type augmentConversionForWorkspace_STATUS interface { + AssignPropertiesFrom(src *storage.Workspace_STATUS) error + AssignPropertiesTo(dst *storage.Workspace_STATUS) error } // Storage version of v1api20210601.PrivateLinkScopedResource_STATUS @@ -272,6 +1095,68 @@ type PrivateLinkScopedResource_STATUS struct { ScopeId *string `json:"scopeId,omitempty"` } +// AssignProperties_From_PrivateLinkScopedResource_STATUS populates our PrivateLinkScopedResource_STATUS from the provided source PrivateLinkScopedResource_STATUS +func (resource *PrivateLinkScopedResource_STATUS) AssignProperties_From_PrivateLinkScopedResource_STATUS(source *storage.PrivateLinkScopedResource_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ResourceId + resource.ResourceId = genruntime.ClonePointerToString(source.ResourceId) + + // ScopeId + resource.ScopeId = genruntime.ClonePointerToString(source.ScopeId) + + // Update the property bag + if len(propertyBag) > 0 { + resource.PropertyBag = propertyBag + } else { + resource.PropertyBag = nil + } + + // Invoke the augmentConversionForPrivateLinkScopedResource_STATUS interface (if implemented) to customize the conversion + var resourceAsAny any = resource + if augmentedResource, ok := resourceAsAny.(augmentConversionForPrivateLinkScopedResource_STATUS); ok { + err := augmentedResource.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_PrivateLinkScopedResource_STATUS populates the provided destination PrivateLinkScopedResource_STATUS from our PrivateLinkScopedResource_STATUS +func (resource *PrivateLinkScopedResource_STATUS) AssignProperties_To_PrivateLinkScopedResource_STATUS(destination *storage.PrivateLinkScopedResource_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(resource.PropertyBag) + + // ResourceId + destination.ResourceId = genruntime.ClonePointerToString(resource.ResourceId) + + // ScopeId + destination.ScopeId = genruntime.ClonePointerToString(resource.ScopeId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForPrivateLinkScopedResource_STATUS interface (if implemented) to customize the conversion + var resourceAsAny any = resource + if augmentedResource, ok := resourceAsAny.(augmentConversionForPrivateLinkScopedResource_STATUS); ok { + err := augmentedResource.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210601.WorkspaceCapping // The daily volume cap for ingestion. type WorkspaceCapping struct { @@ -279,6 +1164,72 @@ type WorkspaceCapping struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_WorkspaceCapping populates our WorkspaceCapping from the provided source WorkspaceCapping +func (capping *WorkspaceCapping) AssignProperties_From_WorkspaceCapping(source *storage.WorkspaceCapping) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // DailyQuotaGb + if source.DailyQuotaGb != nil { + dailyQuotaGb := *source.DailyQuotaGb + capping.DailyQuotaGb = &dailyQuotaGb + } else { + capping.DailyQuotaGb = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + capping.PropertyBag = propertyBag + } else { + capping.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceCapping interface (if implemented) to customize the conversion + var cappingAsAny any = capping + if augmentedCapping, ok := cappingAsAny.(augmentConversionForWorkspaceCapping); ok { + err := augmentedCapping.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceCapping populates the provided destination WorkspaceCapping from our WorkspaceCapping +func (capping *WorkspaceCapping) AssignProperties_To_WorkspaceCapping(destination *storage.WorkspaceCapping) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(capping.PropertyBag) + + // DailyQuotaGb + if capping.DailyQuotaGb != nil { + dailyQuotaGb := *capping.DailyQuotaGb + destination.DailyQuotaGb = &dailyQuotaGb + } else { + destination.DailyQuotaGb = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceCapping interface (if implemented) to customize the conversion + var cappingAsAny any = capping + if augmentedCapping, ok := cappingAsAny.(augmentConversionForWorkspaceCapping); ok { + err := augmentedCapping.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210601.WorkspaceCapping_STATUS // The daily volume cap for ingestion. type WorkspaceCapping_STATUS struct { @@ -288,6 +1239,84 @@ type WorkspaceCapping_STATUS struct { QuotaNextResetTime *string `json:"quotaNextResetTime,omitempty"` } +// AssignProperties_From_WorkspaceCapping_STATUS populates our WorkspaceCapping_STATUS from the provided source WorkspaceCapping_STATUS +func (capping *WorkspaceCapping_STATUS) AssignProperties_From_WorkspaceCapping_STATUS(source *storage.WorkspaceCapping_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // DailyQuotaGb + if source.DailyQuotaGb != nil { + dailyQuotaGb := *source.DailyQuotaGb + capping.DailyQuotaGb = &dailyQuotaGb + } else { + capping.DailyQuotaGb = nil + } + + // DataIngestionStatus + capping.DataIngestionStatus = genruntime.ClonePointerToString(source.DataIngestionStatus) + + // QuotaNextResetTime + capping.QuotaNextResetTime = genruntime.ClonePointerToString(source.QuotaNextResetTime) + + // Update the property bag + if len(propertyBag) > 0 { + capping.PropertyBag = propertyBag + } else { + capping.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceCapping_STATUS interface (if implemented) to customize the conversion + var cappingAsAny any = capping + if augmentedCapping, ok := cappingAsAny.(augmentConversionForWorkspaceCapping_STATUS); ok { + err := augmentedCapping.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceCapping_STATUS populates the provided destination WorkspaceCapping_STATUS from our WorkspaceCapping_STATUS +func (capping *WorkspaceCapping_STATUS) AssignProperties_To_WorkspaceCapping_STATUS(destination *storage.WorkspaceCapping_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(capping.PropertyBag) + + // DailyQuotaGb + if capping.DailyQuotaGb != nil { + dailyQuotaGb := *capping.DailyQuotaGb + destination.DailyQuotaGb = &dailyQuotaGb + } else { + destination.DailyQuotaGb = nil + } + + // DataIngestionStatus + destination.DataIngestionStatus = genruntime.ClonePointerToString(capping.DataIngestionStatus) + + // QuotaNextResetTime + destination.QuotaNextResetTime = genruntime.ClonePointerToString(capping.QuotaNextResetTime) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceCapping_STATUS interface (if implemented) to customize the conversion + var cappingAsAny any = capping + if augmentedCapping, ok := cappingAsAny.(augmentConversionForWorkspaceCapping_STATUS); ok { + err := augmentedCapping.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210601.WorkspaceFeatures // Workspace features. type WorkspaceFeatures struct { @@ -300,6 +1329,136 @@ type WorkspaceFeatures struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_WorkspaceFeatures populates our WorkspaceFeatures from the provided source WorkspaceFeatures +func (features *WorkspaceFeatures) AssignProperties_From_WorkspaceFeatures(source *storage.WorkspaceFeatures) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ClusterResourceReference + if source.ClusterResourceReference != nil { + clusterResourceReference := source.ClusterResourceReference.Copy() + features.ClusterResourceReference = &clusterResourceReference + } else { + features.ClusterResourceReference = nil + } + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + features.DisableLocalAuth = &disableLocalAuth + } else { + features.DisableLocalAuth = nil + } + + // EnableDataExport + if source.EnableDataExport != nil { + enableDataExport := *source.EnableDataExport + features.EnableDataExport = &enableDataExport + } else { + features.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if source.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions + features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + features.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if source.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days + features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + features.ImmediatePurgeDataOn30Days = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + features.PropertyBag = propertyBag + } else { + features.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceFeatures interface (if implemented) to customize the conversion + var featuresAsAny any = features + if augmentedFeatures, ok := featuresAsAny.(augmentConversionForWorkspaceFeatures); ok { + err := augmentedFeatures.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceFeatures populates the provided destination WorkspaceFeatures from our WorkspaceFeatures +func (features *WorkspaceFeatures) AssignProperties_To_WorkspaceFeatures(destination *storage.WorkspaceFeatures) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(features.PropertyBag) + + // ClusterResourceReference + if features.ClusterResourceReference != nil { + clusterResourceReference := features.ClusterResourceReference.Copy() + destination.ClusterResourceReference = &clusterResourceReference + } else { + destination.ClusterResourceReference = nil + } + + // DisableLocalAuth + if features.DisableLocalAuth != nil { + disableLocalAuth := *features.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // EnableDataExport + if features.EnableDataExport != nil { + enableDataExport := *features.EnableDataExport + destination.EnableDataExport = &enableDataExport + } else { + destination.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if features.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *features.EnableLogAccessUsingOnlyResourcePermissions + destination.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + destination.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if features.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *features.ImmediatePurgeDataOn30Days + destination.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + destination.ImmediatePurgeDataOn30Days = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceFeatures interface (if implemented) to customize the conversion + var featuresAsAny any = features + if augmentedFeatures, ok := featuresAsAny.(augmentConversionForWorkspaceFeatures); ok { + err := augmentedFeatures.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210601.WorkspaceFeatures_STATUS // Workspace features. type WorkspaceFeatures_STATUS struct { @@ -311,6 +1470,166 @@ type WorkspaceFeatures_STATUS struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_WorkspaceFeatures_STATUS populates our WorkspaceFeatures_STATUS from the provided source WorkspaceFeatures_STATUS +func (features *WorkspaceFeatures_STATUS) AssignProperties_From_WorkspaceFeatures_STATUS(source *storage.WorkspaceFeatures_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Associations + if len(source.Associations) > 0 { + propertyBag.Add("Associations", source.Associations) + } else { + propertyBag.Remove("Associations") + } + + // ClusterResourceId + features.ClusterResourceId = genruntime.ClonePointerToString(source.ClusterResourceId) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + features.DisableLocalAuth = &disableLocalAuth + } else { + features.DisableLocalAuth = nil + } + + // EnableDataExport + if source.EnableDataExport != nil { + enableDataExport := *source.EnableDataExport + features.EnableDataExport = &enableDataExport + } else { + features.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if source.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions + features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + features.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if source.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days + features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + features.ImmediatePurgeDataOn30Days = nil + } + + // UnifiedSentinelBillingOnly + if source.UnifiedSentinelBillingOnly != nil { + propertyBag.Add("UnifiedSentinelBillingOnly", *source.UnifiedSentinelBillingOnly) + } else { + propertyBag.Remove("UnifiedSentinelBillingOnly") + } + + // Update the property bag + if len(propertyBag) > 0 { + features.PropertyBag = propertyBag + } else { + features.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceFeatures_STATUS interface (if implemented) to customize the conversion + var featuresAsAny any = features + if augmentedFeatures, ok := featuresAsAny.(augmentConversionForWorkspaceFeatures_STATUS); ok { + err := augmentedFeatures.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceFeatures_STATUS populates the provided destination WorkspaceFeatures_STATUS from our WorkspaceFeatures_STATUS +func (features *WorkspaceFeatures_STATUS) AssignProperties_To_WorkspaceFeatures_STATUS(destination *storage.WorkspaceFeatures_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(features.PropertyBag) + + // Associations + if propertyBag.Contains("Associations") { + var association []string + err := propertyBag.Pull("Associations", &association) + if err != nil { + return eris.Wrap(err, "pulling 'Associations' from propertyBag") + } + + destination.Associations = association + } else { + destination.Associations = nil + } + + // ClusterResourceId + destination.ClusterResourceId = genruntime.ClonePointerToString(features.ClusterResourceId) + + // DisableLocalAuth + if features.DisableLocalAuth != nil { + disableLocalAuth := *features.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // EnableDataExport + if features.EnableDataExport != nil { + enableDataExport := *features.EnableDataExport + destination.EnableDataExport = &enableDataExport + } else { + destination.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if features.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *features.EnableLogAccessUsingOnlyResourcePermissions + destination.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + destination.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if features.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *features.ImmediatePurgeDataOn30Days + destination.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + destination.ImmediatePurgeDataOn30Days = nil + } + + // UnifiedSentinelBillingOnly + if propertyBag.Contains("UnifiedSentinelBillingOnly") { + var unifiedSentinelBillingOnly bool + err := propertyBag.Pull("UnifiedSentinelBillingOnly", &unifiedSentinelBillingOnly) + if err != nil { + return eris.Wrap(err, "pulling 'UnifiedSentinelBillingOnly' from propertyBag") + } + + destination.UnifiedSentinelBillingOnly = &unifiedSentinelBillingOnly + } else { + destination.UnifiedSentinelBillingOnly = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceFeatures_STATUS interface (if implemented) to customize the conversion + var featuresAsAny any = features + if augmentedFeatures, ok := featuresAsAny.(augmentConversionForWorkspaceFeatures_STATUS); ok { + err := augmentedFeatures.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210601.WorkspaceOperatorSpec // Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure type WorkspaceOperatorSpec struct { @@ -320,6 +1639,144 @@ type WorkspaceOperatorSpec struct { Secrets *WorkspaceOperatorSecrets `json:"secrets,omitempty"` } +// AssignProperties_From_WorkspaceOperatorSpec populates our WorkspaceOperatorSpec from the provided source WorkspaceOperatorSpec +func (operator *WorkspaceOperatorSpec) AssignProperties_From_WorkspaceOperatorSpec(source *storage.WorkspaceOperatorSpec) 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 { + 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 { + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Secrets + if source.Secrets != nil { + var secret WorkspaceOperatorSecrets + err := secret.AssignProperties_From_WorkspaceOperatorSecrets(source.Secrets) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForWorkspaceOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceOperatorSpec populates the provided destination WorkspaceOperatorSpec from our WorkspaceOperatorSpec +func (operator *WorkspaceOperatorSpec) AssignProperties_To_WorkspaceOperatorSpec(destination *storage.WorkspaceOperatorSpec) 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 { + 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 { + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Secrets + if operator.Secrets != nil { + var secret storage.WorkspaceOperatorSecrets + err := operator.Secrets.AssignProperties_To_WorkspaceOperatorSecrets(&secret) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceOperatorSecrets() to populate field Secrets") + } + destination.Secrets = &secret + } else { + destination.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForWorkspaceOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210601.WorkspaceSku // The SKU (tier) of a workspace. type WorkspaceSku struct { @@ -328,6 +1785,68 @@ type WorkspaceSku struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_WorkspaceSku populates our WorkspaceSku from the provided source WorkspaceSku +func (workspaceSku *WorkspaceSku) AssignProperties_From_WorkspaceSku(source *storage.WorkspaceSku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CapacityReservationLevel + workspaceSku.CapacityReservationLevel = genruntime.ClonePointerToInt(source.CapacityReservationLevel) + + // Name + workspaceSku.Name = genruntime.ClonePointerToString(source.Name) + + // Update the property bag + if len(propertyBag) > 0 { + workspaceSku.PropertyBag = propertyBag + } else { + workspaceSku.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceSku interface (if implemented) to customize the conversion + var workspaceSkuAsAny any = workspaceSku + if augmentedWorkspaceSku, ok := workspaceSkuAsAny.(augmentConversionForWorkspaceSku); ok { + err := augmentedWorkspaceSku.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceSku populates the provided destination WorkspaceSku from our WorkspaceSku +func (workspaceSku *WorkspaceSku) AssignProperties_To_WorkspaceSku(destination *storage.WorkspaceSku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(workspaceSku.PropertyBag) + + // CapacityReservationLevel + destination.CapacityReservationLevel = genruntime.ClonePointerToInt(workspaceSku.CapacityReservationLevel) + + // Name + destination.Name = genruntime.ClonePointerToString(workspaceSku.Name) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceSku interface (if implemented) to customize the conversion + var workspaceSkuAsAny any = workspaceSku + if augmentedWorkspaceSku, ok := workspaceSkuAsAny.(augmentConversionForWorkspaceSku); ok { + err := augmentedWorkspaceSku.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210601.WorkspaceSku_STATUS // The SKU (tier) of a workspace. type WorkspaceSku_STATUS struct { @@ -337,6 +1856,114 @@ type WorkspaceSku_STATUS struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_WorkspaceSku_STATUS populates our WorkspaceSku_STATUS from the provided source WorkspaceSku_STATUS +func (workspaceSku *WorkspaceSku_STATUS) AssignProperties_From_WorkspaceSku_STATUS(source *storage.WorkspaceSku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CapacityReservationLevel + workspaceSku.CapacityReservationLevel = genruntime.ClonePointerToInt(source.CapacityReservationLevel) + + // LastSkuUpdate + workspaceSku.LastSkuUpdate = genruntime.ClonePointerToString(source.LastSkuUpdate) + + // Name + workspaceSku.Name = genruntime.ClonePointerToString(source.Name) + + // Update the property bag + if len(propertyBag) > 0 { + workspaceSku.PropertyBag = propertyBag + } else { + workspaceSku.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceSku_STATUS interface (if implemented) to customize the conversion + var workspaceSkuAsAny any = workspaceSku + if augmentedWorkspaceSku, ok := workspaceSkuAsAny.(augmentConversionForWorkspaceSku_STATUS); ok { + err := augmentedWorkspaceSku.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceSku_STATUS populates the provided destination WorkspaceSku_STATUS from our WorkspaceSku_STATUS +func (workspaceSku *WorkspaceSku_STATUS) AssignProperties_To_WorkspaceSku_STATUS(destination *storage.WorkspaceSku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(workspaceSku.PropertyBag) + + // CapacityReservationLevel + destination.CapacityReservationLevel = genruntime.ClonePointerToInt(workspaceSku.CapacityReservationLevel) + + // LastSkuUpdate + destination.LastSkuUpdate = genruntime.ClonePointerToString(workspaceSku.LastSkuUpdate) + + // Name + destination.Name = genruntime.ClonePointerToString(workspaceSku.Name) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceSku_STATUS interface (if implemented) to customize the conversion + var workspaceSkuAsAny any = workspaceSku + if augmentedWorkspaceSku, ok := workspaceSkuAsAny.(augmentConversionForWorkspaceSku_STATUS); ok { + err := augmentedWorkspaceSku.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForPrivateLinkScopedResource_STATUS interface { + AssignPropertiesFrom(src *storage.PrivateLinkScopedResource_STATUS) error + AssignPropertiesTo(dst *storage.PrivateLinkScopedResource_STATUS) error +} + +type augmentConversionForWorkspaceCapping interface { + AssignPropertiesFrom(src *storage.WorkspaceCapping) error + AssignPropertiesTo(dst *storage.WorkspaceCapping) error +} + +type augmentConversionForWorkspaceCapping_STATUS interface { + AssignPropertiesFrom(src *storage.WorkspaceCapping_STATUS) error + AssignPropertiesTo(dst *storage.WorkspaceCapping_STATUS) error +} + +type augmentConversionForWorkspaceFeatures interface { + AssignPropertiesFrom(src *storage.WorkspaceFeatures) error + AssignPropertiesTo(dst *storage.WorkspaceFeatures) error +} + +type augmentConversionForWorkspaceFeatures_STATUS interface { + AssignPropertiesFrom(src *storage.WorkspaceFeatures_STATUS) error + AssignPropertiesTo(dst *storage.WorkspaceFeatures_STATUS) error +} + +type augmentConversionForWorkspaceOperatorSpec interface { + AssignPropertiesFrom(src *storage.WorkspaceOperatorSpec) error + AssignPropertiesTo(dst *storage.WorkspaceOperatorSpec) error +} + +type augmentConversionForWorkspaceSku interface { + AssignPropertiesFrom(src *storage.WorkspaceSku) error + AssignPropertiesTo(dst *storage.WorkspaceSku) error +} + +type augmentConversionForWorkspaceSku_STATUS interface { + AssignPropertiesFrom(src *storage.WorkspaceSku_STATUS) error + AssignPropertiesTo(dst *storage.WorkspaceSku_STATUS) error +} + // Storage version of v1api20210601.WorkspaceOperatorSecrets type WorkspaceOperatorSecrets struct { PrimarySharedKey *genruntime.SecretDestination `json:"primarySharedKey,omitempty"` @@ -344,6 +1971,93 @@ type WorkspaceOperatorSecrets struct { SecondarySharedKey *genruntime.SecretDestination `json:"secondarySharedKey,omitempty"` } +// AssignProperties_From_WorkspaceOperatorSecrets populates our WorkspaceOperatorSecrets from the provided source WorkspaceOperatorSecrets +func (secrets *WorkspaceOperatorSecrets) AssignProperties_From_WorkspaceOperatorSecrets(source *storage.WorkspaceOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // PrimarySharedKey + if source.PrimarySharedKey != nil { + primarySharedKey := source.PrimarySharedKey.Copy() + secrets.PrimarySharedKey = &primarySharedKey + } else { + secrets.PrimarySharedKey = nil + } + + // SecondarySharedKey + if source.SecondarySharedKey != nil { + secondarySharedKey := source.SecondarySharedKey.Copy() + secrets.SecondarySharedKey = &secondarySharedKey + } else { + secrets.SecondarySharedKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + secrets.PropertyBag = propertyBag + } else { + secrets.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForWorkspaceOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceOperatorSecrets populates the provided destination WorkspaceOperatorSecrets from our WorkspaceOperatorSecrets +func (secrets *WorkspaceOperatorSecrets) AssignProperties_To_WorkspaceOperatorSecrets(destination *storage.WorkspaceOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) + + // PrimarySharedKey + if secrets.PrimarySharedKey != nil { + primarySharedKey := secrets.PrimarySharedKey.Copy() + destination.PrimarySharedKey = &primarySharedKey + } else { + destination.PrimarySharedKey = nil + } + + // SecondarySharedKey + if secrets.SecondarySharedKey != nil { + secondarySharedKey := secrets.SecondarySharedKey.Copy() + destination.SecondarySharedKey = &secondarySharedKey + } else { + destination.SecondarySharedKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForWorkspaceOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForWorkspaceOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForWorkspaceOperatorSecrets interface { + AssignPropertiesFrom(src *storage.WorkspaceOperatorSecrets) error + AssignPropertiesTo(dst *storage.WorkspaceOperatorSecrets) error +} + func init() { SchemeBuilder.Register(&Workspace{}, &WorkspaceList{}) } diff --git a/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen_test.go b/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen_test.go index 16410e493db..1d2633b1041 100644 --- a/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen_test.go +++ b/v2/api/operationalinsights/v1api20210601/storage/workspace_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,48 @@ import ( "testing" ) +func Test_PrivateLinkScopedResource_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PrivateLinkScopedResource_STATUS to PrivateLinkScopedResource_STATUS via AssignProperties_To_PrivateLinkScopedResource_STATUS & AssignProperties_From_PrivateLinkScopedResource_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForPrivateLinkScopedResource_STATUS, PrivateLinkScopedResource_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPrivateLinkScopedResource_STATUS tests if a specific instance of PrivateLinkScopedResource_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForPrivateLinkScopedResource_STATUS(subject PrivateLinkScopedResource_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 storage.PrivateLinkScopedResource_STATUS + err := copied.AssignProperties_To_PrivateLinkScopedResource_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual PrivateLinkScopedResource_STATUS + err = actual.AssignProperties_From_PrivateLinkScopedResource_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_PrivateLinkScopedResource_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -79,6 +122,91 @@ func AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS(gens ma gens["ScopeId"] = gen.PtrOf(gen.AlphaString()) } +func Test_Workspace_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 Workspace to hub returns original", + prop.ForAll(RunResourceConversionTestForWorkspace, WorkspaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForWorkspace tests if a specific instance of Workspace round trips to the hub storage version and back losslessly +func RunResourceConversionTestForWorkspace(subject Workspace) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub storage.Workspace + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual Workspace + 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_Workspace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspace to Workspace via AssignProperties_To_Workspace & AssignProperties_From_Workspace returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspace, WorkspaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspace tests if a specific instance of Workspace can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspace(subject Workspace) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Workspace + err := copied.AssignProperties_To_Workspace(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace + err = actual.AssignProperties_From_Workspace(&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_Workspace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -140,6 +268,48 @@ func AddRelatedPropertyGeneratorsForWorkspace(gens map[string]gopter.Gen) { gens["Status"] = Workspace_STATUSGenerator() } +func Test_WorkspaceCapping_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceCapping to WorkspaceCapping via AssignProperties_To_WorkspaceCapping & AssignProperties_From_WorkspaceCapping returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceCapping, WorkspaceCappingGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceCapping tests if a specific instance of WorkspaceCapping can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceCapping(subject WorkspaceCapping) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceCapping + err := copied.AssignProperties_To_WorkspaceCapping(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceCapping + err = actual.AssignProperties_From_WorkspaceCapping(&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_WorkspaceCapping_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -200,6 +370,48 @@ func AddIndependentPropertyGeneratorsForWorkspaceCapping(gens map[string]gopter. gens["DailyQuotaGb"] = gen.PtrOf(gen.Float64()) } +func Test_WorkspaceCapping_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceCapping_STATUS to WorkspaceCapping_STATUS via AssignProperties_To_WorkspaceCapping_STATUS & AssignProperties_From_WorkspaceCapping_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceCapping_STATUS, WorkspaceCapping_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceCapping_STATUS tests if a specific instance of WorkspaceCapping_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceCapping_STATUS(subject WorkspaceCapping_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 storage.WorkspaceCapping_STATUS + err := copied.AssignProperties_To_WorkspaceCapping_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceCapping_STATUS + err = actual.AssignProperties_From_WorkspaceCapping_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_WorkspaceCapping_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -263,6 +475,48 @@ func AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS(gens map[string] gens["QuotaNextResetTime"] = gen.PtrOf(gen.AlphaString()) } +func Test_WorkspaceFeatures_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceFeatures to WorkspaceFeatures via AssignProperties_To_WorkspaceFeatures & AssignProperties_From_WorkspaceFeatures returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceFeatures, WorkspaceFeaturesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceFeatures tests if a specific instance of WorkspaceFeatures can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceFeatures(subject WorkspaceFeatures) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceFeatures + err := copied.AssignProperties_To_WorkspaceFeatures(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceFeatures + err = actual.AssignProperties_From_WorkspaceFeatures(&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_WorkspaceFeatures_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -326,6 +580,48 @@ func AddIndependentPropertyGeneratorsForWorkspaceFeatures(gens map[string]gopter gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) } +func Test_WorkspaceFeatures_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceFeatures_STATUS to WorkspaceFeatures_STATUS via AssignProperties_To_WorkspaceFeatures_STATUS & AssignProperties_From_WorkspaceFeatures_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceFeatures_STATUS, WorkspaceFeatures_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceFeatures_STATUS tests if a specific instance of WorkspaceFeatures_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceFeatures_STATUS(subject WorkspaceFeatures_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 storage.WorkspaceFeatures_STATUS + err := copied.AssignProperties_To_WorkspaceFeatures_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceFeatures_STATUS + err = actual.AssignProperties_From_WorkspaceFeatures_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_WorkspaceFeatures_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -391,6 +687,48 @@ func AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS(gens map[string gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) } +func Test_WorkspaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceOperatorSecrets to WorkspaceOperatorSecrets via AssignProperties_To_WorkspaceOperatorSecrets & AssignProperties_From_WorkspaceOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceOperatorSecrets, WorkspaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceOperatorSecrets tests if a specific instance of WorkspaceOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceOperatorSecrets(subject WorkspaceOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceOperatorSecrets + err := copied.AssignProperties_To_WorkspaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceOperatorSecrets + err = actual.AssignProperties_From_WorkspaceOperatorSecrets(&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_WorkspaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -446,6 +784,48 @@ func WorkspaceOperatorSecretsGenerator() gopter.Gen { return workspaceOperatorSecretsGenerator } +func Test_WorkspaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceOperatorSpec to WorkspaceOperatorSpec via AssignProperties_To_WorkspaceOperatorSpec & AssignProperties_From_WorkspaceOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceOperatorSpec, WorkspaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceOperatorSpec tests if a specific instance of WorkspaceOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceOperatorSpec(subject WorkspaceOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceOperatorSpec + err := copied.AssignProperties_To_WorkspaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceOperatorSpec + err = actual.AssignProperties_From_WorkspaceOperatorSpec(&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_WorkspaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -507,6 +887,48 @@ func AddRelatedPropertyGeneratorsForWorkspaceOperatorSpec(gens map[string]gopter gens["Secrets"] = gen.PtrOf(WorkspaceOperatorSecretsGenerator()) } +func Test_WorkspaceSku_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceSku to WorkspaceSku via AssignProperties_To_WorkspaceSku & AssignProperties_From_WorkspaceSku returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceSku, WorkspaceSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceSku tests if a specific instance of WorkspaceSku can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceSku(subject WorkspaceSku) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceSku + err := copied.AssignProperties_To_WorkspaceSku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceSku + err = actual.AssignProperties_From_WorkspaceSku(&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_WorkspaceSku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -568,6 +990,48 @@ func AddIndependentPropertyGeneratorsForWorkspaceSku(gens map[string]gopter.Gen) gens["Name"] = gen.PtrOf(gen.AlphaString()) } +func Test_WorkspaceSku_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceSku_STATUS to WorkspaceSku_STATUS via AssignProperties_To_WorkspaceSku_STATUS & AssignProperties_From_WorkspaceSku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceSku_STATUS, WorkspaceSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceSku_STATUS tests if a specific instance of WorkspaceSku_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceSku_STATUS(subject WorkspaceSku_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 storage.WorkspaceSku_STATUS + err := copied.AssignProperties_To_WorkspaceSku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceSku_STATUS + err = actual.AssignProperties_From_WorkspaceSku_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_WorkspaceSku_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -631,6 +1095,48 @@ func AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS(gens map[string]gopt gens["Name"] = gen.PtrOf(gen.AlphaString()) } +func Test_Workspace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspace_STATUS to Workspace_STATUS via AssignProperties_To_Workspace_STATUS & AssignProperties_From_Workspace_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspace_STATUS, Workspace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspace_STATUS tests if a specific instance of Workspace_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspace_STATUS(subject Workspace_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 storage.Workspace_STATUS + err := copied.AssignProperties_To_Workspace_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace_STATUS + err = actual.AssignProperties_From_Workspace_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_Workspace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -723,6 +1229,48 @@ func AddRelatedPropertyGeneratorsForWorkspace_STATUS(gens map[string]gopter.Gen) gens["WorkspaceCapping"] = gen.PtrOf(WorkspaceCapping_STATUSGenerator()) } +func Test_Workspace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspace_Spec to Workspace_Spec via AssignProperties_To_Workspace_Spec & AssignProperties_From_Workspace_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspace_Spec, Workspace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspace_Spec tests if a specific instance of Workspace_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspace_Spec(subject Workspace_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 storage.Workspace_Spec + err := copied.AssignProperties_To_Workspace_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace_Spec + err = actual.AssignProperties_From_Workspace_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_Workspace_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go b/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go index 59b3fa0ee41..4f29cad3922 100644 --- a/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go +++ b/v2/api/operationalinsights/v1api20210601/workspace_types_gen.go @@ -51,22 +51,36 @@ var _ conversion.Convertible = &Workspace{} // ConvertFrom populates our Workspace from the provided hub Workspace func (workspace *Workspace) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*storage.Workspace) - if !ok { - return fmt.Errorf("expected operationalinsights/v1api20210601/storage/Workspace but received %T instead", hub) + // intermediate variable for conversion + var source storage.Workspace + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = workspace.AssignProperties_From_Workspace(&source) + if err != nil { + return eris.Wrap(err, "converting from source to workspace") } - return workspace.AssignProperties_From_Workspace(source) + return nil } // ConvertTo populates the provided hub Workspace from our Workspace func (workspace *Workspace) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*storage.Workspace) - if !ok { - return fmt.Errorf("expected operationalinsights/v1api20210601/storage/Workspace but received %T instead", hub) + // intermediate variable for conversion + var destination storage.Workspace + err := workspace.AssignProperties_To_Workspace(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from workspace") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return workspace.AssignProperties_To_Workspace(destination) + return nil } var _ configmaps.Exporter = &Workspace{} @@ -89,17 +103,6 @@ func (workspace *Workspace) SecretDestinationExpressions() []*core.DestinationEx return workspace.Spec.OperatorSpec.SecretExpressions } -var _ genruntime.ImportableResource = &Workspace{} - -// InitializeSpec initializes the spec for this resource from the given status -func (workspace *Workspace) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Workspace_STATUS); ok { - return workspace.Spec.Initialize_From_Workspace_STATUS(s) - } - - return fmt.Errorf("expected Status of type Workspace_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &Workspace{} // AzureName returns the Azure name of the resource @@ -826,93 +829,6 @@ func (workspace *Workspace_Spec) AssignProperties_To_Workspace_Spec(destination return nil } -// Initialize_From_Workspace_STATUS populates our Workspace_Spec from the provided source Workspace_STATUS -func (workspace *Workspace_Spec) Initialize_From_Workspace_STATUS(source *Workspace_STATUS) error { - - // Etag - workspace.Etag = genruntime.ClonePointerToString(source.Etag) - - // Features - if source.Features != nil { - var feature WorkspaceFeatures - err := feature.Initialize_From_WorkspaceFeatures_STATUS(source.Features) - if err != nil { - return eris.Wrap(err, "calling Initialize_From_WorkspaceFeatures_STATUS() to populate field Features") - } - workspace.Features = &feature - } else { - workspace.Features = nil - } - - // ForceCmkForQuery - if source.ForceCmkForQuery != nil { - forceCmkForQuery := *source.ForceCmkForQuery - workspace.ForceCmkForQuery = &forceCmkForQuery - } else { - workspace.ForceCmkForQuery = nil - } - - // Location - workspace.Location = genruntime.ClonePointerToString(source.Location) - - // ProvisioningState - if source.ProvisioningState != nil { - provisioningState := genruntime.ToEnum(string(*source.ProvisioningState), workspaceProperties_ProvisioningState_Values) - workspace.ProvisioningState = &provisioningState - } else { - workspace.ProvisioningState = nil - } - - // PublicNetworkAccessForIngestion - if source.PublicNetworkAccessForIngestion != nil { - publicNetworkAccessForIngestion := genruntime.ToEnum(string(*source.PublicNetworkAccessForIngestion), publicNetworkAccessType_Values) - workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion - } else { - workspace.PublicNetworkAccessForIngestion = nil - } - - // PublicNetworkAccessForQuery - if source.PublicNetworkAccessForQuery != nil { - publicNetworkAccessForQuery := genruntime.ToEnum(string(*source.PublicNetworkAccessForQuery), publicNetworkAccessType_Values) - workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery - } else { - workspace.PublicNetworkAccessForQuery = nil - } - - // RetentionInDays - workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays) - - // Sku - if source.Sku != nil { - var sku WorkspaceSku - err := sku.Initialize_From_WorkspaceSku_STATUS(source.Sku) - if err != nil { - return eris.Wrap(err, "calling Initialize_From_WorkspaceSku_STATUS() to populate field Sku") - } - workspace.Sku = &sku - } else { - workspace.Sku = nil - } - - // Tags - workspace.Tags = genruntime.CloneMapOfStringToString(source.Tags) - - // WorkspaceCapping - if source.WorkspaceCapping != nil { - var workspaceCapping WorkspaceCapping - err := workspaceCapping.Initialize_From_WorkspaceCapping_STATUS(source.WorkspaceCapping) - if err != nil { - return eris.Wrap(err, "calling Initialize_From_WorkspaceCapping_STATUS() to populate field WorkspaceCapping") - } - workspace.WorkspaceCapping = &workspaceCapping - } else { - workspace.WorkspaceCapping = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (workspace *Workspace_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1671,21 +1587,6 @@ func (capping *WorkspaceCapping) AssignProperties_To_WorkspaceCapping(destinatio return nil } -// Initialize_From_WorkspaceCapping_STATUS populates our WorkspaceCapping from the provided source WorkspaceCapping_STATUS -func (capping *WorkspaceCapping) Initialize_From_WorkspaceCapping_STATUS(source *WorkspaceCapping_STATUS) error { - - // DailyQuotaGb - if source.DailyQuotaGb != nil { - dailyQuotaGb := *source.DailyQuotaGb - capping.DailyQuotaGb = &dailyQuotaGb - } else { - capping.DailyQuotaGb = nil - } - - // No error - return nil -} - // The daily volume cap for ingestion. type WorkspaceCapping_STATUS struct { // DailyQuotaGb: The workspace daily quota for ingestion. @@ -2006,53 +1907,6 @@ func (features *WorkspaceFeatures) AssignProperties_To_WorkspaceFeatures(destina return nil } -// Initialize_From_WorkspaceFeatures_STATUS populates our WorkspaceFeatures from the provided source WorkspaceFeatures_STATUS -func (features *WorkspaceFeatures) Initialize_From_WorkspaceFeatures_STATUS(source *WorkspaceFeatures_STATUS) error { - - // ClusterResourceReference - if source.ClusterResourceId != nil { - clusterResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterResourceId) - features.ClusterResourceReference = &clusterResourceReference - } else { - features.ClusterResourceReference = nil - } - - // DisableLocalAuth - if source.DisableLocalAuth != nil { - disableLocalAuth := *source.DisableLocalAuth - features.DisableLocalAuth = &disableLocalAuth - } else { - features.DisableLocalAuth = nil - } - - // EnableDataExport - if source.EnableDataExport != nil { - enableDataExport := *source.EnableDataExport - features.EnableDataExport = &enableDataExport - } else { - features.EnableDataExport = nil - } - - // EnableLogAccessUsingOnlyResourcePermissions - if source.EnableLogAccessUsingOnlyResourcePermissions != nil { - enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions - features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission - } else { - features.EnableLogAccessUsingOnlyResourcePermissions = nil - } - - // ImmediatePurgeDataOn30Days - if source.ImmediatePurgeDataOn30Days != nil { - immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days - features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day - } else { - features.ImmediatePurgeDataOn30Days = nil - } - - // No error - return nil -} - // Workspace features. type WorkspaceFeatures_STATUS struct { // ClusterResourceId: Dedicated LA cluster resourceId that is linked to the workspaces. @@ -2508,29 +2362,6 @@ func (workspaceSku *WorkspaceSku) AssignProperties_To_WorkspaceSku(destination * return nil } -// Initialize_From_WorkspaceSku_STATUS populates our WorkspaceSku from the provided source WorkspaceSku_STATUS -func (workspaceSku *WorkspaceSku) Initialize_From_WorkspaceSku_STATUS(source *WorkspaceSku_STATUS) error { - - // CapacityReservationLevel - if source.CapacityReservationLevel != nil { - capacityReservationLevel := WorkspaceSku_CapacityReservationLevel(*source.CapacityReservationLevel) - workspaceSku.CapacityReservationLevel = &capacityReservationLevel - } else { - workspaceSku.CapacityReservationLevel = nil - } - - // Name - if source.Name != nil { - name := genruntime.ToEnum(string(*source.Name), workspaceSku_Name_Values) - workspaceSku.Name = &name - } else { - workspaceSku.Name = nil - } - - // No error - return nil -} - // The SKU (tier) of a workspace. type WorkspaceSku_STATUS struct { // CapacityReservationLevel: The capacity reservation level in GB for this workspace, when CapacityReservation sku is diff --git a/v2/api/operationalinsights/v1api20210601/workspace_types_gen_test.go b/v2/api/operationalinsights/v1api20210601/workspace_types_gen_test.go index 2067639e59c..8a3b48b2cba 100644 --- a/v2/api/operationalinsights/v1api20210601/workspace_types_gen_test.go +++ b/v2/api/operationalinsights/v1api20210601/workspace_types_gen_test.go @@ -5,7 +5,8 @@ package v1api20210601 import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/storage" + v20210601s "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/storage" + v20250701s "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForPrivateLinkScopedResource_STATUS(subject Privat copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.PrivateLinkScopedResource_STATUS + var other v20210601s.PrivateLinkScopedResource_STATUS err := copied.AssignProperties_To_PrivateLinkScopedResource_STATUS(&other) if err != nil { return err.Error() @@ -140,7 +141,7 @@ func RunResourceConversionTestForWorkspace(subject Workspace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub storage.Workspace + var hub v20250701s.Workspace err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -182,7 +183,7 @@ func RunPropertyAssignmentTestForWorkspace(subject Workspace) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Workspace + var other v20210601s.Workspace err := copied.AssignProperties_To_Workspace(&other) if err != nil { return err.Error() @@ -285,7 +286,7 @@ func RunPropertyAssignmentTestForWorkspaceCapping(subject WorkspaceCapping) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceCapping + var other v20210601s.WorkspaceCapping err := copied.AssignProperties_To_WorkspaceCapping(&other) if err != nil { return err.Error() @@ -387,7 +388,7 @@ func RunPropertyAssignmentTestForWorkspaceCapping_STATUS(subject WorkspaceCappin copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceCapping_STATUS + var other v20210601s.WorkspaceCapping_STATUS err := copied.AssignProperties_To_WorkspaceCapping_STATUS(&other) if err != nil { return err.Error() @@ -498,7 +499,7 @@ func RunPropertyAssignmentTestForWorkspaceFeatures(subject WorkspaceFeatures) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceFeatures + var other v20210601s.WorkspaceFeatures err := copied.AssignProperties_To_WorkspaceFeatures(&other) if err != nil { return err.Error() @@ -603,7 +604,7 @@ func RunPropertyAssignmentTestForWorkspaceFeatures_STATUS(subject WorkspaceFeatu copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceFeatures_STATUS + var other v20210601s.WorkspaceFeatures_STATUS err := copied.AssignProperties_To_WorkspaceFeatures_STATUS(&other) if err != nil { return err.Error() @@ -710,7 +711,7 @@ func RunPropertyAssignmentTestForWorkspaceOperatorSecrets(subject WorkspaceOpera copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceOperatorSecrets + var other v20210601s.WorkspaceOperatorSecrets err := copied.AssignProperties_To_WorkspaceOperatorSecrets(&other) if err != nil { return err.Error() @@ -807,7 +808,7 @@ func RunPropertyAssignmentTestForWorkspaceOperatorSpec(subject WorkspaceOperator copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceOperatorSpec + var other v20210601s.WorkspaceOperatorSpec err := copied.AssignProperties_To_WorkspaceOperatorSpec(&other) if err != nil { return err.Error() @@ -910,7 +911,7 @@ func RunPropertyAssignmentTestForWorkspaceSku(subject WorkspaceSku) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceSku + var other v20210601s.WorkspaceSku err := copied.AssignProperties_To_WorkspaceSku(&other) if err != nil { return err.Error() @@ -1029,7 +1030,7 @@ func RunPropertyAssignmentTestForWorkspaceSku_STATUS(subject WorkspaceSku_STATUS copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.WorkspaceSku_STATUS + var other v20210601s.WorkspaceSku_STATUS err := copied.AssignProperties_To_WorkspaceSku_STATUS(&other) if err != nil { return err.Error() @@ -1150,7 +1151,7 @@ func RunPropertyAssignmentTestForWorkspace_STATUS(subject Workspace_STATUS) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Workspace_STATUS + var other v20210601s.Workspace_STATUS err := copied.AssignProperties_To_Workspace_STATUS(&other) if err != nil { return err.Error() @@ -1291,7 +1292,7 @@ func RunPropertyAssignmentTestForWorkspace_Spec(subject Workspace_Spec) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Workspace_Spec + var other v20210601s.Workspace_Spec err := copied.AssignProperties_To_Workspace_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/operationalinsights/v1api20250701/arm/structure.txt b/v2/api/operationalinsights/v1api20250701/arm/structure.txt new file mode 100644 index 00000000000..a66ec78fc2f --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/arm/structure.txt @@ -0,0 +1,161 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/arm +------------------------------------------------------------------------------------ +Workspace_STATUS: Object (9 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 +├── Location: *string +├── Name: *string +├── Properties: *Object (15 properties) +│ ├── CreatedDate: *string +│ ├── CustomerId: *string +│ ├── DefaultDataCollectionRuleResourceId: *string +│ ├── Failover: *Object (2 properties) +│ │ ├── LastModifiedDate: *string +│ │ └── State: *Enum (5 values) +│ │ ├── "Activating" +│ │ ├── "Active" +│ │ ├── "Deactivating" +│ │ ├── "Failed" +│ │ └── "Inactive" +│ ├── Features: *Object (7 properties) +│ │ ├── Associations: string[] +│ │ ├── ClusterResourceId: *string +│ │ ├── DisableLocalAuth: *bool +│ │ ├── EnableDataExport: *bool +│ │ ├── EnableLogAccessUsingOnlyResourcePermissions: *bool +│ │ ├── ImmediatePurgeDataOn30Days: *bool +│ │ └── UnifiedSentinelBillingOnly: *bool +│ ├── ForceCmkForQuery: *bool +│ ├── ModifiedDate: *string +│ ├── PrivateLinkScopedResources: Object (2 properties)[] +│ │ ├── ResourceId: *string +│ │ └── ScopeId: *string +│ ├── ProvisioningState: *Enum (7 values) +│ │ ├── "Canceled" +│ │ ├── "Creating" +│ │ ├── "Deleting" +│ │ ├── "Failed" +│ │ ├── "ProvisioningAccount" +│ │ ├── "Succeeded" +│ │ └── "Updating" +│ ├── PublicNetworkAccessForIngestion: *Enum (3 values) +│ │ ├── "Disabled" +│ │ ├── "Enabled" +│ │ └── "SecuredByPerimeter" +│ ├── PublicNetworkAccessForQuery: *Enum (3 values) +│ │ ├── "Disabled" +│ │ ├── "Enabled" +│ │ └── "SecuredByPerimeter" +│ ├── Replication: *Object (5 properties) +│ │ ├── CreatedDate: *string +│ │ ├── Enabled: *bool +│ │ ├── LastModifiedDate: *string +│ │ ├── Location: *string +│ │ └── ProvisioningState: *Enum (9 values) +│ │ ├── "Canceled" +│ │ ├── "DisableRequested" +│ │ ├── "Disabling" +│ │ ├── "EnableRequested" +│ │ ├── "Enabling" +│ │ ├── "Failed" +│ │ ├── "RollbackRequested" +│ │ ├── "RollingBack" +│ │ └── "Succeeded" +│ ├── RetentionInDays: *int +│ ├── Sku: *Object (3 properties) +│ │ ├── CapacityReservationLevel: *int +│ │ ├── LastSkuUpdate: *string +│ │ └── Name: *Enum (8 values) +│ │ ├── "CapacityReservation" +│ │ ├── "Free" +│ │ ├── "LACluster" +│ │ ├── "PerGB2018" +│ │ ├── "PerNode" +│ │ ├── "Premium" +│ │ ├── "Standalone" +│ │ └── "Standard" +│ └── WorkspaceCapping: *Object (3 properties) +│ ├── DailyQuotaGb: *float64 +│ ├── DataIngestionStatus: *Enum (6 values) +│ │ ├── "ApproachingQuota" +│ │ ├── "ForceOff" +│ │ ├── "ForceOn" +│ │ ├── "OverQuota" +│ │ ├── "RespectQuota" +│ │ └── "SubscriptionSuspended" +│ └── QuotaNextResetTime: *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 + +Workspace_Spec: Object (6 properties) +├── Etag: *string +├── Identity: *Object (2 properties) +│ ├── Type: *Enum (3 values) +│ │ ├── "None" +│ │ ├── "SystemAssigned" +│ │ └── "UserAssigned" +│ └── UserAssignedIdentities: map[string]Object (0 properties) +├── Location: *string +├── Name: string +├── Properties: *Object (9 properties) +│ ├── DefaultDataCollectionRuleResourceId: *string +│ ├── Features: *Object (5 properties) +│ │ ├── ClusterResourceId: *string +│ │ ├── DisableLocalAuth: *bool +│ │ ├── EnableDataExport: *bool +│ │ ├── EnableLogAccessUsingOnlyResourcePermissions: *bool +│ │ └── ImmediatePurgeDataOn30Days: *bool +│ ├── ForceCmkForQuery: *bool +│ ├── PublicNetworkAccessForIngestion: *Enum (3 values) +│ │ ├── "Disabled" +│ │ ├── "Enabled" +│ │ └── "SecuredByPerimeter" +│ ├── PublicNetworkAccessForQuery: *Enum (3 values) +│ │ ├── "Disabled" +│ │ ├── "Enabled" +│ │ └── "SecuredByPerimeter" +│ ├── Replication: *Object (2 properties) +│ │ ├── Enabled: *bool +│ │ └── Location: *string +│ ├── RetentionInDays: *int +│ ├── Sku: *Object (2 properties) +│ │ ├── CapacityReservationLevel: *int +│ │ └── Name: *Enum (8 values) +│ │ ├── "CapacityReservation" +│ │ ├── "Free" +│ │ ├── "LACluster" +│ │ ├── "PerGB2018" +│ │ ├── "PerNode" +│ │ ├── "Premium" +│ │ ├── "Standalone" +│ │ └── "Standard" +│ └── WorkspaceCapping: *Object (1 property) +│ └── DailyQuotaGb: *float64 +└── Tags: map[string]string + diff --git a/v2/api/operationalinsights/v1api20250701/arm/workspace_spec_types_gen.go b/v2/api/operationalinsights/v1api20250701/arm/workspace_spec_types_gen.go new file mode 100644 index 00000000000..fe503730929 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/arm/workspace_spec_types_gen.go @@ -0,0 +1,188 @@ +// 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 Workspace_Spec struct { + // Etag: The etag of the workspace. + Etag *string `json:"etag,omitempty"` + + // Identity: The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + + // Properties: Workspace properties. + Properties *WorkspaceProperties `json:"properties,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Workspace_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2025-07-01" +func (workspace Workspace_Spec) GetAPIVersion() string { + return "2025-07-01" +} + +// GetName returns the Name of the resource +func (workspace *Workspace_Spec) GetName() string { + return workspace.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.OperationalInsights/workspaces" +func (workspace *Workspace_Spec) GetType() string { + return "Microsoft.OperationalInsights/workspaces" +} + +// 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"` +} + +// Workspace properties. +type WorkspaceProperties struct { + // DefaultDataCollectionRuleResourceId: The resource ID of the default Data Collection Rule to use for this workspace. + // Expected format is - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + DefaultDataCollectionRuleResourceId *string `json:"defaultDataCollectionRuleResourceId,omitempty"` + + // Features: Workspace features. + Features *WorkspaceFeatures `json:"features,omitempty"` + + // ForceCmkForQuery: Indicates whether customer managed storage is mandatory for query management. + ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"` + + // PublicNetworkAccessForIngestion: The network access type for accessing Log Analytics ingestion. + PublicNetworkAccessForIngestion *PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"` + + // PublicNetworkAccessForQuery: The network access type for accessing Log Analytics query. + PublicNetworkAccessForQuery *PublicNetworkAccessType `json:"publicNetworkAccessForQuery,omitempty"` + + // Replication: workspace replication properties. + Replication *WorkspaceReplicationProperties `json:"replication,omitempty"` + + // RetentionInDays: The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers + // documentation for details. + RetentionInDays *int `json:"retentionInDays,omitempty"` + + // Sku: The SKU of the workspace. + Sku *WorkspaceSku `json:"sku,omitempty"` + + // WorkspaceCapping: The daily volume cap for ingestion. + WorkspaceCapping *WorkspaceCapping `json:"workspaceCapping,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, +} + +// The network access type for operating on the Log Analytics Workspace. By default it is Enabled +// +kubebuilder:validation:Enum={"Disabled","Enabled","SecuredByPerimeter"} +type PublicNetworkAccessType string + +const ( + PublicNetworkAccessType_Disabled = PublicNetworkAccessType("Disabled") + PublicNetworkAccessType_Enabled = PublicNetworkAccessType("Enabled") + PublicNetworkAccessType_SecuredByPerimeter = PublicNetworkAccessType("SecuredByPerimeter") +) + +// Mapping from string to PublicNetworkAccessType +var publicNetworkAccessType_Values = map[string]PublicNetworkAccessType{ + "disabled": PublicNetworkAccessType_Disabled, + "enabled": PublicNetworkAccessType_Enabled, + "securedbyperimeter": PublicNetworkAccessType_SecuredByPerimeter, +} + +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { +} + +// The daily volume cap for ingestion. +type WorkspaceCapping struct { + // DailyQuotaGb: The workspace daily quota for ingestion. + DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"` +} + +// Workspace features. +type WorkspaceFeatures struct { + // ClusterResourceId: Dedicated LA cluster resourceId that is linked to the workspaces. + ClusterResourceId *string `json:"clusterResourceId,omitempty"` + + // DisableLocalAuth: Disable Non-AAD based Auth. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // EnableDataExport: Flag that indicate if data should be exported. + EnableDataExport *bool `json:"enableDataExport,omitempty"` + + // EnableLogAccessUsingOnlyResourcePermissions: Flag that indicate which permission to use - resource or workspace or both. + EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"` + + // ImmediatePurgeDataOn30Days: Flag that describes if we want to remove the data after 30 days. + ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"` +} + +// Workspace replication properties. +type WorkspaceReplicationProperties struct { + // Enabled: Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated + // to the specified location. If replication is been enabled, location must be provided. + Enabled *bool `json:"enabled,omitempty"` + + // Location: The location of the replication. + Location *string `json:"location,omitempty"` +} + +// The SKU (tier) of a workspace. +type WorkspaceSku struct { + // CapacityReservationLevel: The capacity reservation level in GB for this workspace, when CapacityReservation sku is + // selected. + CapacityReservationLevel *int `json:"capacityReservationLevel,omitempty"` + + // Name: The name of the SKU. + Name *WorkspaceSku_Name `json:"name,omitempty"` +} + +// +kubebuilder:validation:Enum={"CapacityReservation","Free","LACluster","PerGB2018","PerNode","Premium","Standalone","Standard"} +type WorkspaceSku_Name string + +const ( + WorkspaceSku_Name_CapacityReservation = WorkspaceSku_Name("CapacityReservation") + WorkspaceSku_Name_Free = WorkspaceSku_Name("Free") + WorkspaceSku_Name_LACluster = WorkspaceSku_Name("LACluster") + WorkspaceSku_Name_PerGB2018 = WorkspaceSku_Name("PerGB2018") + WorkspaceSku_Name_PerNode = WorkspaceSku_Name("PerNode") + WorkspaceSku_Name_Premium = WorkspaceSku_Name("Premium") + WorkspaceSku_Name_Standalone = WorkspaceSku_Name("Standalone") + WorkspaceSku_Name_Standard = WorkspaceSku_Name("Standard") +) + +// Mapping from string to WorkspaceSku_Name +var workspaceSku_Name_Values = map[string]WorkspaceSku_Name{ + "capacityreservation": WorkspaceSku_Name_CapacityReservation, + "free": WorkspaceSku_Name_Free, + "lacluster": WorkspaceSku_Name_LACluster, + "pergb2018": WorkspaceSku_Name_PerGB2018, + "pernode": WorkspaceSku_Name_PerNode, + "premium": WorkspaceSku_Name_Premium, + "standalone": WorkspaceSku_Name_Standalone, + "standard": WorkspaceSku_Name_Standard, +} diff --git a/v2/api/operationalinsights/v1api20250701/arm/workspace_spec_types_gen_test.go b/v2/api/operationalinsights/v1api20250701/arm/workspace_spec_types_gen_test.go new file mode 100644 index 00000000000..bfea4495bc5 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/arm/workspace_spec_types_gen_test.go @@ -0,0 +1,566 @@ +// 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_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_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_WorkspaceCapping_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 WorkspaceCapping via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceCapping, WorkspaceCappingGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceCapping runs a test to see if a specific instance of WorkspaceCapping round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceCapping(subject WorkspaceCapping) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceCapping + 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 WorkspaceCapping instances for property testing - lazily instantiated by WorkspaceCappingGenerator() +var workspaceCappingGenerator gopter.Gen + +// WorkspaceCappingGenerator returns a generator of WorkspaceCapping instances for property testing. +func WorkspaceCappingGenerator() gopter.Gen { + if workspaceCappingGenerator != nil { + return workspaceCappingGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceCapping(generators) + workspaceCappingGenerator = gen.Struct(reflect.TypeOf(WorkspaceCapping{}), generators) + + return workspaceCappingGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceCapping is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceCapping(gens map[string]gopter.Gen) { + gens["DailyQuotaGb"] = gen.PtrOf(gen.Float64()) +} + +func Test_WorkspaceFeatures_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 WorkspaceFeatures via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFeatures, WorkspaceFeaturesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFeatures runs a test to see if a specific instance of WorkspaceFeatures round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFeatures(subject WorkspaceFeatures) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFeatures + 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 WorkspaceFeatures instances for property testing - lazily instantiated by WorkspaceFeaturesGenerator() +var workspaceFeaturesGenerator gopter.Gen + +// WorkspaceFeaturesGenerator returns a generator of WorkspaceFeatures instances for property testing. +func WorkspaceFeaturesGenerator() gopter.Gen { + if workspaceFeaturesGenerator != nil { + return workspaceFeaturesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFeatures(generators) + workspaceFeaturesGenerator = gen.Struct(reflect.TypeOf(WorkspaceFeatures{}), generators) + + return workspaceFeaturesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFeatures is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFeatures(gens map[string]gopter.Gen) { + gens["ClusterResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["EnableDataExport"] = gen.PtrOf(gen.Bool()) + gens["EnableLogAccessUsingOnlyResourcePermissions"] = gen.PtrOf(gen.Bool()) + gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) +} + +func Test_WorkspaceProperties_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 WorkspaceProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceProperties, WorkspacePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceProperties runs a test to see if a specific instance of WorkspaceProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceProperties(subject WorkspaceProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceProperties + 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 WorkspaceProperties instances for property testing - lazily instantiated by +// WorkspacePropertiesGenerator() +var workspacePropertiesGenerator gopter.Gen + +// WorkspacePropertiesGenerator returns a generator of WorkspaceProperties instances for property testing. +// We first initialize workspacePropertiesGenerator 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 WorkspacePropertiesGenerator() gopter.Gen { + if workspacePropertiesGenerator != nil { + return workspacePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceProperties(generators) + workspacePropertiesGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceProperties(generators) + AddRelatedPropertyGeneratorsForWorkspaceProperties(generators) + workspacePropertiesGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties{}), generators) + + return workspacePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceProperties(gens map[string]gopter.Gen) { + gens["DefaultDataCollectionRuleResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["ForceCmkForQuery"] = gen.PtrOf(gen.Bool()) + gens["PublicNetworkAccessForIngestion"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_Disabled, PublicNetworkAccessType_Enabled, PublicNetworkAccessType_SecuredByPerimeter)) + gens["PublicNetworkAccessForQuery"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_Disabled, PublicNetworkAccessType_Enabled, PublicNetworkAccessType_SecuredByPerimeter)) + gens["RetentionInDays"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForWorkspaceProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceProperties(gens map[string]gopter.Gen) { + gens["Features"] = gen.PtrOf(WorkspaceFeaturesGenerator()) + gens["Replication"] = gen.PtrOf(WorkspaceReplicationPropertiesGenerator()) + gens["Sku"] = gen.PtrOf(WorkspaceSkuGenerator()) + gens["WorkspaceCapping"] = gen.PtrOf(WorkspaceCappingGenerator()) +} + +func Test_WorkspaceReplicationProperties_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 WorkspaceReplicationProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceReplicationProperties, WorkspaceReplicationPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceReplicationProperties runs a test to see if a specific instance of WorkspaceReplicationProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceReplicationProperties(subject WorkspaceReplicationProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceReplicationProperties + 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 WorkspaceReplicationProperties instances for property testing - lazily instantiated by +// WorkspaceReplicationPropertiesGenerator() +var workspaceReplicationPropertiesGenerator gopter.Gen + +// WorkspaceReplicationPropertiesGenerator returns a generator of WorkspaceReplicationProperties instances for property testing. +func WorkspaceReplicationPropertiesGenerator() gopter.Gen { + if workspaceReplicationPropertiesGenerator != nil { + return workspaceReplicationPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties(generators) + workspaceReplicationPropertiesGenerator = gen.Struct(reflect.TypeOf(WorkspaceReplicationProperties{}), generators) + + return workspaceReplicationPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceSku_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 WorkspaceSku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceSku, WorkspaceSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceSku runs a test to see if a specific instance of WorkspaceSku round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceSku(subject WorkspaceSku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceSku + 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 WorkspaceSku instances for property testing - lazily instantiated by WorkspaceSkuGenerator() +var workspaceSkuGenerator gopter.Gen + +// WorkspaceSkuGenerator returns a generator of WorkspaceSku instances for property testing. +func WorkspaceSkuGenerator() gopter.Gen { + if workspaceSkuGenerator != nil { + return workspaceSkuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceSku(generators) + workspaceSkuGenerator = gen.Struct(reflect.TypeOf(WorkspaceSku{}), generators) + + return workspaceSkuGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceSku(gens map[string]gopter.Gen) { + gens["CapacityReservationLevel"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf( + WorkspaceSku_Name_CapacityReservation, + WorkspaceSku_Name_Free, + WorkspaceSku_Name_LACluster, + WorkspaceSku_Name_PerGB2018, + WorkspaceSku_Name_PerNode, + WorkspaceSku_Name_Premium, + WorkspaceSku_Name_Standalone, + WorkspaceSku_Name_Standard)) +} + +func Test_Workspace_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 Workspace_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace_Spec, Workspace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace_Spec runs a test to see if a specific instance of Workspace_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace_Spec(subject Workspace_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace_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 Workspace_Spec instances for property testing - lazily instantiated by Workspace_SpecGenerator() +var workspace_SpecGenerator gopter.Gen + +// Workspace_SpecGenerator returns a generator of Workspace_Spec instances for property testing. +// We first initialize workspace_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 Workspace_SpecGenerator() gopter.Gen { + if workspace_SpecGenerator != nil { + return workspace_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_Spec(generators) + workspace_SpecGenerator = gen.Struct(reflect.TypeOf(Workspace_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_Spec(generators) + AddRelatedPropertyGeneratorsForWorkspace_Spec(generators) + workspace_SpecGenerator = gen.Struct(reflect.TypeOf(Workspace_Spec{}), generators) + + return workspace_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspace_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspace_Spec(gens map[string]gopter.Gen) { + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.AlphaString() + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspace_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace_Spec(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["Properties"] = gen.PtrOf(WorkspacePropertiesGenerator()) +} diff --git a/v2/api/operationalinsights/v1api20250701/arm/workspace_status_types_gen.go b/v2/api/operationalinsights/v1api20250701/arm/workspace_status_types_gen.go new file mode 100644 index 00000000000..2b9694e5a23 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/arm/workspace_status_types_gen.go @@ -0,0 +1,400 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +// The top level Workspace resource container. +type Workspace_STATUS struct { + // Etag: The etag of the workspace. + 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"` + + // 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: Workspace properties. + Properties *WorkspaceProperties_STATUS `json:"properties,omitempty"` + + // SystemData: Metadata pertaining to creation and last modification of the resource. + 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"` +} + +// 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"` +} + +// Workspace properties. +type WorkspaceProperties_STATUS struct { + // CreatedDate: Workspace creation date. + CreatedDate *string `json:"createdDate,omitempty"` + + // CustomerId: This is a read-only property. Represents the ID associated with the workspace. + CustomerId *string `json:"customerId,omitempty"` + + // DefaultDataCollectionRuleResourceId: The resource ID of the default Data Collection Rule to use for this workspace. + // Expected format is - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + DefaultDataCollectionRuleResourceId *string `json:"defaultDataCollectionRuleResourceId,omitempty"` + + // Failover: workspace failover properties. + Failover *WorkspaceFailoverProperties_STATUS `json:"failover,omitempty"` + + // Features: Workspace features. + Features *WorkspaceFeatures_STATUS `json:"features,omitempty"` + + // ForceCmkForQuery: Indicates whether customer managed storage is mandatory for query management. + ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"` + + // ModifiedDate: Workspace modification date. + ModifiedDate *string `json:"modifiedDate,omitempty"` + + // PrivateLinkScopedResources: List of linked private link scope resources. + PrivateLinkScopedResources []PrivateLinkScopedResource_STATUS `json:"privateLinkScopedResources,omitempty"` + + // ProvisioningState: The provisioning state of the workspace. + ProvisioningState *WorkspaceProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"` + + // PublicNetworkAccessForIngestion: The network access type for accessing Log Analytics ingestion. + PublicNetworkAccessForIngestion *PublicNetworkAccessType_STATUS `json:"publicNetworkAccessForIngestion,omitempty"` + + // PublicNetworkAccessForQuery: The network access type for accessing Log Analytics query. + PublicNetworkAccessForQuery *PublicNetworkAccessType_STATUS `json:"publicNetworkAccessForQuery,omitempty"` + + // Replication: workspace replication properties. + Replication *WorkspaceReplicationProperties_STATUS `json:"replication,omitempty"` + + // RetentionInDays: The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers + // documentation for details. + RetentionInDays *int `json:"retentionInDays,omitempty"` + + // Sku: The SKU of the workspace. + Sku *WorkspaceSku_STATUS `json:"sku,omitempty"` + + // WorkspaceCapping: The daily volume cap for ingestion. + WorkspaceCapping *WorkspaceCapping_STATUS `json:"workspaceCapping,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, +} + +// The private link scope resource reference. +type PrivateLinkScopedResource_STATUS struct { + // ResourceId: The full resource Id of the private link scope resource. + ResourceId *string `json:"resourceId,omitempty"` + + // ScopeId: The private link scope unique Identifier. + ScopeId *string `json:"scopeId,omitempty"` +} + +// The network access type for operating on the Log Analytics Workspace. By default it is Enabled +type PublicNetworkAccessType_STATUS string + +const ( + PublicNetworkAccessType_STATUS_Disabled = PublicNetworkAccessType_STATUS("Disabled") + PublicNetworkAccessType_STATUS_Enabled = PublicNetworkAccessType_STATUS("Enabled") + PublicNetworkAccessType_STATUS_SecuredByPerimeter = PublicNetworkAccessType_STATUS("SecuredByPerimeter") +) + +// Mapping from string to PublicNetworkAccessType_STATUS +var publicNetworkAccessType_STATUS_Values = map[string]PublicNetworkAccessType_STATUS{ + "disabled": PublicNetworkAccessType_STATUS_Disabled, + "enabled": PublicNetworkAccessType_STATUS_Enabled, + "securedbyperimeter": PublicNetworkAccessType_STATUS_SecuredByPerimeter, +} + +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"` +} + +// The daily volume cap for ingestion. +type WorkspaceCapping_STATUS struct { + // DailyQuotaGb: The workspace daily quota for ingestion. + DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"` + + // DataIngestionStatus: The status of data ingestion for this workspace. + DataIngestionStatus *WorkspaceCapping_DataIngestionStatus_STATUS `json:"dataIngestionStatus,omitempty"` + + // QuotaNextResetTime: The time when the quota will be rest. + QuotaNextResetTime *string `json:"quotaNextResetTime,omitempty"` +} + +// The failover state of the replication. +type WorkspaceFailoverProperties_STATUS struct { + // LastModifiedDate: The last time when the failover state was updated. + LastModifiedDate *string `json:"lastModifiedDate,omitempty"` + + // State: The failover state of the replication. + State *WorkspaceFailoverProperties_State_STATUS `json:"state,omitempty"` +} + +// Workspace features. +type WorkspaceFeatures_STATUS struct { + // Associations: List of associations for the workspace. Indicates if the workspace is associated with any of the following + // experiences: MDC, Sentinel, SentinelGraph, etc. + Associations []string `json:"associations,omitempty"` + + // ClusterResourceId: Dedicated LA cluster resourceId that is linked to the workspaces. + ClusterResourceId *string `json:"clusterResourceId,omitempty"` + + // DisableLocalAuth: Disable Non-AAD based Auth. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // EnableDataExport: Flag that indicate if data should be exported. + EnableDataExport *bool `json:"enableDataExport,omitempty"` + + // EnableLogAccessUsingOnlyResourcePermissions: Flag that indicate which permission to use - resource or workspace or both. + EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"` + + // ImmediatePurgeDataOn30Days: Flag that describes if we want to remove the data after 30 days. + ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"` + + // UnifiedSentinelBillingOnly: An indication if the specify workspace is limited to sentinel's unified billing model only. + UnifiedSentinelBillingOnly *bool `json:"unifiedSentinelBillingOnly,omitempty"` +} + +type WorkspaceProperties_ProvisioningState_STATUS string + +const ( + WorkspaceProperties_ProvisioningState_STATUS_Canceled = WorkspaceProperties_ProvisioningState_STATUS("Canceled") + WorkspaceProperties_ProvisioningState_STATUS_Creating = WorkspaceProperties_ProvisioningState_STATUS("Creating") + WorkspaceProperties_ProvisioningState_STATUS_Deleting = WorkspaceProperties_ProvisioningState_STATUS("Deleting") + WorkspaceProperties_ProvisioningState_STATUS_Failed = WorkspaceProperties_ProvisioningState_STATUS("Failed") + WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount = WorkspaceProperties_ProvisioningState_STATUS("ProvisioningAccount") + WorkspaceProperties_ProvisioningState_STATUS_Succeeded = WorkspaceProperties_ProvisioningState_STATUS("Succeeded") + WorkspaceProperties_ProvisioningState_STATUS_Updating = WorkspaceProperties_ProvisioningState_STATUS("Updating") +) + +// Mapping from string to WorkspaceProperties_ProvisioningState_STATUS +var workspaceProperties_ProvisioningState_STATUS_Values = map[string]WorkspaceProperties_ProvisioningState_STATUS{ + "canceled": WorkspaceProperties_ProvisioningState_STATUS_Canceled, + "creating": WorkspaceProperties_ProvisioningState_STATUS_Creating, + "deleting": WorkspaceProperties_ProvisioningState_STATUS_Deleting, + "failed": WorkspaceProperties_ProvisioningState_STATUS_Failed, + "provisioningaccount": WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount, + "succeeded": WorkspaceProperties_ProvisioningState_STATUS_Succeeded, + "updating": WorkspaceProperties_ProvisioningState_STATUS_Updating, +} + +// Workspace replication properties. +type WorkspaceReplicationProperties_STATUS struct { + // CreatedDate: The last time when the replication was enabled. + CreatedDate *string `json:"createdDate,omitempty"` + + // Enabled: Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated + // to the specified location. If replication is been enabled, location must be provided. + Enabled *bool `json:"enabled,omitempty"` + + // LastModifiedDate: The last time when the replication was updated. + LastModifiedDate *string `json:"lastModifiedDate,omitempty"` + + // Location: The location of the replication. + Location *string `json:"location,omitempty"` + + // ProvisioningState: The provisioning state of the replication. + ProvisioningState *WorkspaceReplicationProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"` +} + +// The SKU (tier) of a workspace. +type WorkspaceSku_STATUS struct { + // CapacityReservationLevel: The capacity reservation level in GB for this workspace, when CapacityReservation sku is + // selected. + CapacityReservationLevel *int `json:"capacityReservationLevel,omitempty"` + + // LastSkuUpdate: The last time when the sku was updated. + LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"` + + // Name: The name of the SKU. + Name *WorkspaceSku_Name_STATUS `json:"name,omitempty"` +} + +type WorkspaceCapping_DataIngestionStatus_STATUS string + +const ( + WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota = WorkspaceCapping_DataIngestionStatus_STATUS("ApproachingQuota") + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff = WorkspaceCapping_DataIngestionStatus_STATUS("ForceOff") + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn = WorkspaceCapping_DataIngestionStatus_STATUS("ForceOn") + WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota = WorkspaceCapping_DataIngestionStatus_STATUS("OverQuota") + WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota = WorkspaceCapping_DataIngestionStatus_STATUS("RespectQuota") + WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended = WorkspaceCapping_DataIngestionStatus_STATUS("SubscriptionSuspended") +) + +// Mapping from string to WorkspaceCapping_DataIngestionStatus_STATUS +var workspaceCapping_DataIngestionStatus_STATUS_Values = map[string]WorkspaceCapping_DataIngestionStatus_STATUS{ + "approachingquota": WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota, + "forceoff": WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff, + "forceon": WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn, + "overquota": WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota, + "respectquota": WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota, + "subscriptionsuspended": WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended, +} + +type WorkspaceFailoverProperties_State_STATUS string + +const ( + WorkspaceFailoverProperties_State_STATUS_Activating = WorkspaceFailoverProperties_State_STATUS("Activating") + WorkspaceFailoverProperties_State_STATUS_Active = WorkspaceFailoverProperties_State_STATUS("Active") + WorkspaceFailoverProperties_State_STATUS_Deactivating = WorkspaceFailoverProperties_State_STATUS("Deactivating") + WorkspaceFailoverProperties_State_STATUS_Failed = WorkspaceFailoverProperties_State_STATUS("Failed") + WorkspaceFailoverProperties_State_STATUS_Inactive = WorkspaceFailoverProperties_State_STATUS("Inactive") +) + +// Mapping from string to WorkspaceFailoverProperties_State_STATUS +var workspaceFailoverProperties_State_STATUS_Values = map[string]WorkspaceFailoverProperties_State_STATUS{ + "activating": WorkspaceFailoverProperties_State_STATUS_Activating, + "active": WorkspaceFailoverProperties_State_STATUS_Active, + "deactivating": WorkspaceFailoverProperties_State_STATUS_Deactivating, + "failed": WorkspaceFailoverProperties_State_STATUS_Failed, + "inactive": WorkspaceFailoverProperties_State_STATUS_Inactive, +} + +type WorkspaceReplicationProperties_ProvisioningState_STATUS string + +const ( + WorkspaceReplicationProperties_ProvisioningState_STATUS_Canceled = WorkspaceReplicationProperties_ProvisioningState_STATUS("Canceled") + WorkspaceReplicationProperties_ProvisioningState_STATUS_DisableRequested = WorkspaceReplicationProperties_ProvisioningState_STATUS("DisableRequested") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Disabling = WorkspaceReplicationProperties_ProvisioningState_STATUS("Disabling") + WorkspaceReplicationProperties_ProvisioningState_STATUS_EnableRequested = WorkspaceReplicationProperties_ProvisioningState_STATUS("EnableRequested") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Enabling = WorkspaceReplicationProperties_ProvisioningState_STATUS("Enabling") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Failed = WorkspaceReplicationProperties_ProvisioningState_STATUS("Failed") + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollbackRequested = WorkspaceReplicationProperties_ProvisioningState_STATUS("RollbackRequested") + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollingBack = WorkspaceReplicationProperties_ProvisioningState_STATUS("RollingBack") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Succeeded = WorkspaceReplicationProperties_ProvisioningState_STATUS("Succeeded") +) + +// Mapping from string to WorkspaceReplicationProperties_ProvisioningState_STATUS +var workspaceReplicationProperties_ProvisioningState_STATUS_Values = map[string]WorkspaceReplicationProperties_ProvisioningState_STATUS{ + "canceled": WorkspaceReplicationProperties_ProvisioningState_STATUS_Canceled, + "disablerequested": WorkspaceReplicationProperties_ProvisioningState_STATUS_DisableRequested, + "disabling": WorkspaceReplicationProperties_ProvisioningState_STATUS_Disabling, + "enablerequested": WorkspaceReplicationProperties_ProvisioningState_STATUS_EnableRequested, + "enabling": WorkspaceReplicationProperties_ProvisioningState_STATUS_Enabling, + "failed": WorkspaceReplicationProperties_ProvisioningState_STATUS_Failed, + "rollbackrequested": WorkspaceReplicationProperties_ProvisioningState_STATUS_RollbackRequested, + "rollingback": WorkspaceReplicationProperties_ProvisioningState_STATUS_RollingBack, + "succeeded": WorkspaceReplicationProperties_ProvisioningState_STATUS_Succeeded, +} + +type WorkspaceSku_Name_STATUS string + +const ( + WorkspaceSku_Name_STATUS_CapacityReservation = WorkspaceSku_Name_STATUS("CapacityReservation") + WorkspaceSku_Name_STATUS_Free = WorkspaceSku_Name_STATUS("Free") + WorkspaceSku_Name_STATUS_LACluster = WorkspaceSku_Name_STATUS("LACluster") + WorkspaceSku_Name_STATUS_PerGB2018 = WorkspaceSku_Name_STATUS("PerGB2018") + WorkspaceSku_Name_STATUS_PerNode = WorkspaceSku_Name_STATUS("PerNode") + WorkspaceSku_Name_STATUS_Premium = WorkspaceSku_Name_STATUS("Premium") + WorkspaceSku_Name_STATUS_Standalone = WorkspaceSku_Name_STATUS("Standalone") + WorkspaceSku_Name_STATUS_Standard = WorkspaceSku_Name_STATUS("Standard") +) + +// Mapping from string to WorkspaceSku_Name_STATUS +var workspaceSku_Name_STATUS_Values = map[string]WorkspaceSku_Name_STATUS{ + "capacityreservation": WorkspaceSku_Name_STATUS_CapacityReservation, + "free": WorkspaceSku_Name_STATUS_Free, + "lacluster": WorkspaceSku_Name_STATUS_LACluster, + "pergb2018": WorkspaceSku_Name_STATUS_PerGB2018, + "pernode": WorkspaceSku_Name_STATUS_PerNode, + "premium": WorkspaceSku_Name_STATUS_Premium, + "standalone": WorkspaceSku_Name_STATUS_Standalone, + "standard": WorkspaceSku_Name_STATUS_Standard, +} diff --git a/v2/api/operationalinsights/v1api20250701/arm/workspace_status_types_gen_test.go b/v2/api/operationalinsights/v1api20250701/arm/workspace_status_types_gen_test.go new file mode 100644 index 00000000000..9d8b2a05794 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/arm/workspace_status_types_gen_test.go @@ -0,0 +1,819 @@ +// 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_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_PrivateLinkScopedResource_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 PrivateLinkScopedResource_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateLinkScopedResource_STATUS, PrivateLinkScopedResource_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateLinkScopedResource_STATUS runs a test to see if a specific instance of PrivateLinkScopedResource_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateLinkScopedResource_STATUS(subject PrivateLinkScopedResource_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateLinkScopedResource_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 PrivateLinkScopedResource_STATUS instances for property testing - lazily instantiated by +// PrivateLinkScopedResource_STATUSGenerator() +var privateLinkScopedResource_STATUSGenerator gopter.Gen + +// PrivateLinkScopedResource_STATUSGenerator returns a generator of PrivateLinkScopedResource_STATUS instances for property testing. +func PrivateLinkScopedResource_STATUSGenerator() gopter.Gen { + if privateLinkScopedResource_STATUSGenerator != nil { + return privateLinkScopedResource_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS(generators) + privateLinkScopedResource_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateLinkScopedResource_STATUS{}), generators) + + return privateLinkScopedResource_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS(gens map[string]gopter.Gen) { + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["ScopeId"] = gen.PtrOf(gen.AlphaString()) +} + +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()) +} + +func Test_WorkspaceCapping_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 WorkspaceCapping_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceCapping_STATUS, WorkspaceCapping_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceCapping_STATUS runs a test to see if a specific instance of WorkspaceCapping_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceCapping_STATUS(subject WorkspaceCapping_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceCapping_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 WorkspaceCapping_STATUS instances for property testing - lazily instantiated by +// WorkspaceCapping_STATUSGenerator() +var workspaceCapping_STATUSGenerator gopter.Gen + +// WorkspaceCapping_STATUSGenerator returns a generator of WorkspaceCapping_STATUS instances for property testing. +func WorkspaceCapping_STATUSGenerator() gopter.Gen { + if workspaceCapping_STATUSGenerator != nil { + return workspaceCapping_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS(generators) + workspaceCapping_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceCapping_STATUS{}), generators) + + return workspaceCapping_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS(gens map[string]gopter.Gen) { + gens["DailyQuotaGb"] = gen.PtrOf(gen.Float64()) + gens["DataIngestionStatus"] = gen.PtrOf(gen.OneConstOf( + WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota, + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff, + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn, + WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota, + WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota, + WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended)) + gens["QuotaNextResetTime"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceFailoverProperties_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 WorkspaceFailoverProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS, WorkspaceFailoverProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS runs a test to see if a specific instance of WorkspaceFailoverProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS(subject WorkspaceFailoverProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFailoverProperties_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 WorkspaceFailoverProperties_STATUS instances for property testing - lazily instantiated by +// WorkspaceFailoverProperties_STATUSGenerator() +var workspaceFailoverProperties_STATUSGenerator gopter.Gen + +// WorkspaceFailoverProperties_STATUSGenerator returns a generator of WorkspaceFailoverProperties_STATUS instances for property testing. +func WorkspaceFailoverProperties_STATUSGenerator() gopter.Gen { + if workspaceFailoverProperties_STATUSGenerator != nil { + return workspaceFailoverProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS(generators) + workspaceFailoverProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceFailoverProperties_STATUS{}), generators) + + return workspaceFailoverProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS(gens map[string]gopter.Gen) { + gens["LastModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["State"] = gen.PtrOf(gen.OneConstOf( + WorkspaceFailoverProperties_State_STATUS_Activating, + WorkspaceFailoverProperties_State_STATUS_Active, + WorkspaceFailoverProperties_State_STATUS_Deactivating, + WorkspaceFailoverProperties_State_STATUS_Failed, + WorkspaceFailoverProperties_State_STATUS_Inactive)) +} + +func Test_WorkspaceFeatures_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 WorkspaceFeatures_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFeatures_STATUS, WorkspaceFeatures_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFeatures_STATUS runs a test to see if a specific instance of WorkspaceFeatures_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFeatures_STATUS(subject WorkspaceFeatures_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFeatures_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 WorkspaceFeatures_STATUS instances for property testing - lazily instantiated by +// WorkspaceFeatures_STATUSGenerator() +var workspaceFeatures_STATUSGenerator gopter.Gen + +// WorkspaceFeatures_STATUSGenerator returns a generator of WorkspaceFeatures_STATUS instances for property testing. +func WorkspaceFeatures_STATUSGenerator() gopter.Gen { + if workspaceFeatures_STATUSGenerator != nil { + return workspaceFeatures_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS(generators) + workspaceFeatures_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceFeatures_STATUS{}), generators) + + return workspaceFeatures_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS(gens map[string]gopter.Gen) { + gens["Associations"] = gen.SliceOf(gen.AlphaString()) + gens["ClusterResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["EnableDataExport"] = gen.PtrOf(gen.Bool()) + gens["EnableLogAccessUsingOnlyResourcePermissions"] = gen.PtrOf(gen.Bool()) + gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) + gens["UnifiedSentinelBillingOnly"] = gen.PtrOf(gen.Bool()) +} + +func Test_WorkspaceProperties_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 WorkspaceProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceProperties_STATUS, WorkspaceProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceProperties_STATUS runs a test to see if a specific instance of WorkspaceProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceProperties_STATUS(subject WorkspaceProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceProperties_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 WorkspaceProperties_STATUS instances for property testing - lazily instantiated by +// WorkspaceProperties_STATUSGenerator() +var workspaceProperties_STATUSGenerator gopter.Gen + +// WorkspaceProperties_STATUSGenerator returns a generator of WorkspaceProperties_STATUS instances for property testing. +// We first initialize workspaceProperties_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 WorkspaceProperties_STATUSGenerator() gopter.Gen { + if workspaceProperties_STATUSGenerator != nil { + return workspaceProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceProperties_STATUS(generators) + workspaceProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForWorkspaceProperties_STATUS(generators) + workspaceProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties_STATUS{}), generators) + + return workspaceProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceProperties_STATUS(gens map[string]gopter.Gen) { + gens["CreatedDate"] = gen.PtrOf(gen.AlphaString()) + gens["CustomerId"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultDataCollectionRuleResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["ForceCmkForQuery"] = gen.PtrOf(gen.Bool()) + gens["ModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + WorkspaceProperties_ProvisioningState_STATUS_Canceled, + WorkspaceProperties_ProvisioningState_STATUS_Creating, + WorkspaceProperties_ProvisioningState_STATUS_Deleting, + WorkspaceProperties_ProvisioningState_STATUS_Failed, + WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount, + WorkspaceProperties_ProvisioningState_STATUS_Succeeded, + WorkspaceProperties_ProvisioningState_STATUS_Updating)) + gens["PublicNetworkAccessForIngestion"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_STATUS_Disabled, PublicNetworkAccessType_STATUS_Enabled, PublicNetworkAccessType_STATUS_SecuredByPerimeter)) + gens["PublicNetworkAccessForQuery"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_STATUS_Disabled, PublicNetworkAccessType_STATUS_Enabled, PublicNetworkAccessType_STATUS_SecuredByPerimeter)) + gens["RetentionInDays"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForWorkspaceProperties_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceProperties_STATUS(gens map[string]gopter.Gen) { + gens["Failover"] = gen.PtrOf(WorkspaceFailoverProperties_STATUSGenerator()) + gens["Features"] = gen.PtrOf(WorkspaceFeatures_STATUSGenerator()) + gens["PrivateLinkScopedResources"] = gen.SliceOf(PrivateLinkScopedResource_STATUSGenerator()) + gens["Replication"] = gen.PtrOf(WorkspaceReplicationProperties_STATUSGenerator()) + gens["Sku"] = gen.PtrOf(WorkspaceSku_STATUSGenerator()) + gens["WorkspaceCapping"] = gen.PtrOf(WorkspaceCapping_STATUSGenerator()) +} + +func Test_WorkspaceReplicationProperties_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 WorkspaceReplicationProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS, WorkspaceReplicationProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS runs a test to see if a specific instance of WorkspaceReplicationProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS(subject WorkspaceReplicationProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceReplicationProperties_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 WorkspaceReplicationProperties_STATUS instances for property testing - lazily instantiated by +// WorkspaceReplicationProperties_STATUSGenerator() +var workspaceReplicationProperties_STATUSGenerator gopter.Gen + +// WorkspaceReplicationProperties_STATUSGenerator returns a generator of WorkspaceReplicationProperties_STATUS instances for property testing. +func WorkspaceReplicationProperties_STATUSGenerator() gopter.Gen { + if workspaceReplicationProperties_STATUSGenerator != nil { + return workspaceReplicationProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS(generators) + workspaceReplicationProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceReplicationProperties_STATUS{}), generators) + + return workspaceReplicationProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS(gens map[string]gopter.Gen) { + gens["CreatedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["LastModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + WorkspaceReplicationProperties_ProvisioningState_STATUS_Canceled, + WorkspaceReplicationProperties_ProvisioningState_STATUS_DisableRequested, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Disabling, + WorkspaceReplicationProperties_ProvisioningState_STATUS_EnableRequested, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Enabling, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Failed, + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollbackRequested, + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollingBack, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Succeeded)) +} + +func Test_WorkspaceSku_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 WorkspaceSku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceSku_STATUS, WorkspaceSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceSku_STATUS runs a test to see if a specific instance of WorkspaceSku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceSku_STATUS(subject WorkspaceSku_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceSku_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 WorkspaceSku_STATUS instances for property testing - lazily instantiated by +// WorkspaceSku_STATUSGenerator() +var workspaceSku_STATUSGenerator gopter.Gen + +// WorkspaceSku_STATUSGenerator returns a generator of WorkspaceSku_STATUS instances for property testing. +func WorkspaceSku_STATUSGenerator() gopter.Gen { + if workspaceSku_STATUSGenerator != nil { + return workspaceSku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS(generators) + workspaceSku_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceSku_STATUS{}), generators) + + return workspaceSku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS(gens map[string]gopter.Gen) { + gens["CapacityReservationLevel"] = gen.PtrOf(gen.Int()) + gens["LastSkuUpdate"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.OneConstOf( + WorkspaceSku_Name_STATUS_CapacityReservation, + WorkspaceSku_Name_STATUS_Free, + WorkspaceSku_Name_STATUS_LACluster, + WorkspaceSku_Name_STATUS_PerGB2018, + WorkspaceSku_Name_STATUS_PerNode, + WorkspaceSku_Name_STATUS_Premium, + WorkspaceSku_Name_STATUS_Standalone, + WorkspaceSku_Name_STATUS_Standard)) +} + +func Test_Workspace_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 Workspace_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace_STATUS, Workspace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace_STATUS runs a test to see if a specific instance of Workspace_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace_STATUS(subject Workspace_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace_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 Workspace_STATUS instances for property testing - lazily instantiated by Workspace_STATUSGenerator() +var workspace_STATUSGenerator gopter.Gen + +// Workspace_STATUSGenerator returns a generator of Workspace_STATUS instances for property testing. +// We first initialize workspace_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 Workspace_STATUSGenerator() gopter.Gen { + if workspace_STATUSGenerator != nil { + return workspace_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_STATUS(generators) + workspace_STATUSGenerator = gen.Struct(reflect.TypeOf(Workspace_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_STATUS(generators) + AddRelatedPropertyGeneratorsForWorkspace_STATUS(generators) + workspace_STATUSGenerator = gen.Struct(reflect.TypeOf(Workspace_STATUS{}), generators) + + return workspace_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspace_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspace_STATUS(gens map[string]gopter.Gen) { + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + 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()) +} + +// AddRelatedPropertyGeneratorsForWorkspace_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace_STATUS(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["Properties"] = gen.PtrOf(WorkspaceProperties_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} diff --git a/v2/api/operationalinsights/v1api20250701/doc.go b/v2/api/operationalinsights/v1api20250701/doc.go new file mode 100644 index 00000000000..67036f16f15 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/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 v1api20250701 contains API Schema definitions for the operationalinsights v1api20250701 API group +// +groupName=operationalinsights.azure.com +package v1api20250701 diff --git a/v2/api/operationalinsights/v1api20250701/groupversion_info_gen.go b/v2/api/operationalinsights/v1api20250701/groupversion_info_gen.go new file mode 100644 index 00000000000..2a5a49cb31e --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/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 v1api20250701 contains API Schema definitions for the operationalinsights v1api20250701 API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=operationalinsights.azure.com +// +versionName=v1api20250701 +package v1api20250701 + +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: "operationalinsights.azure.com", Version: "v1api20250701"} + + // 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/operationalinsights/v1api20250701/storage/groupversion_info_gen.go b/v2/api/operationalinsights/v1api20250701/storage/groupversion_info_gen.go new file mode 100644 index 00000000000..65cfe6794cf --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/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 operationalinsights storage API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=operationalinsights.azure.com +// +versionName=v1api20250701storage +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: "operationalinsights.azure.com", Version: "v1api20250701storage"} + + // 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/operationalinsights/v1api20250701/storage/structure.txt b/v2/api/operationalinsights/v1api20250701/storage/structure.txt new file mode 100644 index 00000000000..d051a4c611a --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/storage/structure.txt @@ -0,0 +1,123 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/storage +---------------------------------------------------------------------------------------- +APIVersion: Enum (1 value) +└── "2025-07-01" + +Workspace: Resource +├── Owner: resources/v1apiv20191001.ResourceGroup +├── Spec: Object (18 properties) +│ ├── AzureName: string +│ ├── DefaultDataCollectionRuleResourceReference: *genruntime.ResourceReference +│ ├── Etag: *string +│ ├── Features: *Object (6 properties) +│ │ ├── ClusterResourceReference: *genruntime.ResourceReference +│ │ ├── DisableLocalAuth: *bool +│ │ ├── EnableDataExport: *bool +│ │ ├── EnableLogAccessUsingOnlyResourcePermissions: *bool +│ │ ├── ImmediatePurgeDataOn30Days: *bool +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── ForceCmkForQuery: *bool +│ ├── Identity: *Object (3 properties) +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── Type: *string +│ │ └── UserAssignedIdentities: Object (2 properties)[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── Reference: genruntime.ResourceReference +│ ├── Location: *string +│ ├── OperatorSpec: *Object (4 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── SecretExpressions: *core.DestinationExpression[] +│ │ └── Secrets: *Object (3 properties) +│ │ ├── PrimarySharedKey: *genruntime.SecretDestination +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SecondarySharedKey: *genruntime.SecretDestination +│ ├── OriginalVersion: string +│ ├── Owner: *genruntime.KnownResourceReference +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── PublicNetworkAccessForIngestion: *string +│ ├── PublicNetworkAccessForQuery: *string +│ ├── Replication: *Object (3 properties) +│ │ ├── Enabled: *bool +│ │ ├── Location: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── RetentionInDays: *int +│ ├── Sku: *Object (3 properties) +│ │ ├── CapacityReservationLevel: *int +│ │ ├── Name: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Tags: map[string]string +│ └── WorkspaceCapping: *Object (2 properties) +│ ├── DailyQuotaGb: *float64 +│ └── PropertyBag: genruntime.PropertyBag +└── Status: Object (25 properties) + ├── Conditions: conditions.Condition[] + ├── CreatedDate: *string + ├── CustomerId: *string + ├── DefaultDataCollectionRuleResourceId: *string + ├── Etag: *string + ├── Failover: *Object (3 properties) + │ ├── LastModifiedDate: *string + │ ├── PropertyBag: genruntime.PropertyBag + │ └── State: *string + ├── Features: *Object (8 properties) + │ ├── Associations: string[] + │ ├── ClusterResourceId: *string + │ ├── DisableLocalAuth: *bool + │ ├── EnableDataExport: *bool + │ ├── EnableLogAccessUsingOnlyResourcePermissions: *bool + │ ├── ImmediatePurgeDataOn30Days: *bool + │ ├── PropertyBag: genruntime.PropertyBag + │ └── UnifiedSentinelBillingOnly: *bool + ├── ForceCmkForQuery: *bool + ├── 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 + ├── Location: *string + ├── ModifiedDate: *string + ├── Name: *string + ├── PrivateLinkScopedResources: Object (3 properties)[] + │ ├── PropertyBag: genruntime.PropertyBag + │ ├── ResourceId: *string + │ └── ScopeId: *string + ├── PropertyBag: genruntime.PropertyBag + ├── ProvisioningState: *string + ├── PublicNetworkAccessForIngestion: *string + ├── PublicNetworkAccessForQuery: *string + ├── Replication: *Object (6 properties) + │ ├── CreatedDate: *string + │ ├── Enabled: *bool + │ ├── LastModifiedDate: *string + │ ├── Location: *string + │ ├── PropertyBag: genruntime.PropertyBag + │ └── ProvisioningState: *string + ├── RetentionInDays: *int + ├── Sku: *Object (4 properties) + │ ├── CapacityReservationLevel: *int + │ ├── LastSkuUpdate: *string + │ ├── Name: *string + │ └── PropertyBag: genruntime.PropertyBag + ├── SystemData: *Object (7 properties) + │ ├── CreatedAt: *string + │ ├── CreatedBy: *string + │ ├── CreatedByType: *string + │ ├── LastModifiedAt: *string + │ ├── LastModifiedBy: *string + │ ├── LastModifiedByType: *string + │ └── PropertyBag: genruntime.PropertyBag + ├── Tags: map[string]string + ├── Type: *string + └── WorkspaceCapping: *Object (4 properties) + ├── DailyQuotaGb: *float64 + ├── DataIngestionStatus: *string + ├── PropertyBag: genruntime.PropertyBag + └── QuotaNextResetTime: *string + diff --git a/v2/api/operationalinsights/v1api20250701/storage/workspace_types_gen.go b/v2/api/operationalinsights/v1api20250701/storage/workspace_types_gen.go new file mode 100644 index 00000000000..8163d77cc5d --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/storage/workspace_types_gen.go @@ -0,0 +1,434 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +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/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" +) + +// +kubebuilder:rbac:groups=operationalinsights.azure.com,resources=workspaces,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=operationalinsights.azure.com,resources={workspaces/status,workspaces/finalizers},verbs=get;update;patch + +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories={azure,operationalinsights} +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +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 v1api20250701.Workspace +// Generator information: +// - Generated from: /operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025-07-01/Workspaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName} +type Workspace struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Workspace_Spec `json:"spec,omitempty"` + Status Workspace_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &Workspace{} + +// GetConditions returns the conditions of the resource +func (workspace *Workspace) GetConditions() conditions.Conditions { + return workspace.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (workspace *Workspace) SetConditions(conditions conditions.Conditions) { + workspace.Status.Conditions = conditions +} + +var _ configmaps.Exporter = &Workspace{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (workspace *Workspace) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if workspace.Spec.OperatorSpec == nil { + return nil + } + return workspace.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &Workspace{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (workspace *Workspace) SecretDestinationExpressions() []*core.DestinationExpression { + if workspace.Spec.OperatorSpec == nil { + return nil + } + return workspace.Spec.OperatorSpec.SecretExpressions +} + +var _ genruntime.KubernetesResource = &Workspace{} + +// AzureName returns the Azure name of the resource +func (workspace *Workspace) AzureName() string { + return workspace.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2025-07-01" +func (workspace Workspace) GetAPIVersion() string { + return "2025-07-01" +} + +// GetResourceScope returns the scope of the resource +func (workspace *Workspace) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (workspace *Workspace) GetSpec() genruntime.ConvertibleSpec { + return &workspace.Spec +} + +// GetStatus returns the status of this resource +func (workspace *Workspace) GetStatus() genruntime.ConvertibleStatus { + return &workspace.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (workspace *Workspace) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.OperationalInsights/workspaces" +func (workspace *Workspace) GetType() string { + return "Microsoft.OperationalInsights/workspaces" +} + +// NewEmptyStatus returns a new empty (blank) status +func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Workspace_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) + return workspace.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (workspace *Workspace) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Workspace_STATUS); ok { + workspace.Status = *st + return nil + } + + // Convert status to required version + var st Workspace_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + workspace.Status = st + return nil +} + +// Hub marks that this Workspace is the hub type for conversion +func (workspace *Workspace) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (workspace *Workspace) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: workspace.Spec.OriginalVersion, + Kind: "Workspace", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20250701.Workspace +// Generator information: +// - Generated from: /operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025-07-01/Workspaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName} +type WorkspaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Workspace `json:"items"` +} + +// Storage version of v1api20250701.APIVersion +// +kubebuilder:validation:Enum={"2025-07-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2025-07-01") + +// Storage version of v1api20250701.Workspace_Spec +type Workspace_Spec struct { + // 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"` + + // DefaultDataCollectionRuleResourceReference: The resource ID of the default Data Collection Rule to use for this + // workspace. Expected format is - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + DefaultDataCollectionRuleResourceReference *genruntime.ResourceReference `armReference:"DefaultDataCollectionRuleResourceId" json:"defaultDataCollectionRuleResourceReference,omitempty"` + Etag *string `json:"etag,omitempty"` + Features *WorkspaceFeatures `json:"features,omitempty"` + ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"` + Identity *Identity `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + OperatorSpec *WorkspaceOperatorSpec `json:"operatorSpec,omitempty"` + OriginalVersion string `json:"originalVersion,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"` + PublicNetworkAccessForIngestion *string `json:"publicNetworkAccessForIngestion,omitempty"` + PublicNetworkAccessForQuery *string `json:"publicNetworkAccessForQuery,omitempty"` + Replication *WorkspaceReplicationProperties `json:"replication,omitempty"` + RetentionInDays *int `json:"retentionInDays,omitempty"` + Sku *WorkspaceSku `json:"sku,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + WorkspaceCapping *WorkspaceCapping `json:"workspaceCapping,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Workspace_Spec{} + +// ConvertSpecFrom populates our Workspace_Spec from the provided source +func (workspace *Workspace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == workspace { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(workspace) +} + +// ConvertSpecTo populates the provided destination from our Workspace_Spec +func (workspace *Workspace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == workspace { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(workspace) +} + +// Storage version of v1api20250701.Workspace_STATUS +// The top level Workspace resource container. +type Workspace_STATUS struct { + Conditions []conditions.Condition `json:"conditions,omitempty"` + CreatedDate *string `json:"createdDate,omitempty"` + CustomerId *string `json:"customerId,omitempty"` + DefaultDataCollectionRuleResourceId *string `json:"defaultDataCollectionRuleResourceId,omitempty"` + Etag *string `json:"etag,omitempty"` + Failover *WorkspaceFailoverProperties_STATUS `json:"failover,omitempty"` + Features *WorkspaceFeatures_STATUS `json:"features,omitempty"` + ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"` + Id *string `json:"id,omitempty"` + Identity *Identity_STATUS `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + ModifiedDate *string `json:"modifiedDate,omitempty"` + Name *string `json:"name,omitempty"` + PrivateLinkScopedResources []PrivateLinkScopedResource_STATUS `json:"privateLinkScopedResources,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + PublicNetworkAccessForIngestion *string `json:"publicNetworkAccessForIngestion,omitempty"` + PublicNetworkAccessForQuery *string `json:"publicNetworkAccessForQuery,omitempty"` + Replication *WorkspaceReplicationProperties_STATUS `json:"replication,omitempty"` + RetentionInDays *int `json:"retentionInDays,omitempty"` + Sku *WorkspaceSku_STATUS `json:"sku,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + WorkspaceCapping *WorkspaceCapping_STATUS `json:"workspaceCapping,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Workspace_STATUS{} + +// ConvertStatusFrom populates our Workspace_STATUS from the provided source +func (workspace *Workspace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == workspace { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(workspace) +} + +// ConvertStatusTo populates the provided destination from our Workspace_STATUS +func (workspace *Workspace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == workspace { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(workspace) +} + +// Storage version of v1api20250701.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 v1api20250701.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 v1api20250701.PrivateLinkScopedResource_STATUS +// The private link scope resource reference. +type PrivateLinkScopedResource_STATUS struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + ScopeId *string `json:"scopeId,omitempty"` +} + +// Storage version of v1api20250701.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"` +} + +// Storage version of v1api20250701.WorkspaceCapping +// The daily volume cap for ingestion. +type WorkspaceCapping struct { + DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceCapping_STATUS +// The daily volume cap for ingestion. +type WorkspaceCapping_STATUS struct { + DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"` + DataIngestionStatus *string `json:"dataIngestionStatus,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + QuotaNextResetTime *string `json:"quotaNextResetTime,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceFailoverProperties_STATUS +// The failover state of the replication. +type WorkspaceFailoverProperties_STATUS struct { + LastModifiedDate *string `json:"lastModifiedDate,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + State *string `json:"state,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceFeatures +// Workspace features. +type WorkspaceFeatures struct { + // ClusterResourceReference: Dedicated LA cluster resourceId that is linked to the workspaces. + ClusterResourceReference *genruntime.ResourceReference `armReference:"ClusterResourceId" json:"clusterResourceReference,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + EnableDataExport *bool `json:"enableDataExport,omitempty"` + EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"` + ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceFeatures_STATUS +// Workspace features. +type WorkspaceFeatures_STATUS struct { + Associations []string `json:"associations,omitempty"` + ClusterResourceId *string `json:"clusterResourceId,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + EnableDataExport *bool `json:"enableDataExport,omitempty"` + EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"` + ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + UnifiedSentinelBillingOnly *bool `json:"unifiedSentinelBillingOnly,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type WorkspaceOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` + Secrets *WorkspaceOperatorSecrets `json:"secrets,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceReplicationProperties +// Workspace replication properties. +type WorkspaceReplicationProperties struct { + Enabled *bool `json:"enabled,omitempty"` + Location *string `json:"location,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceReplicationProperties_STATUS +// Workspace replication properties. +type WorkspaceReplicationProperties_STATUS struct { + CreatedDate *string `json:"createdDate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + LastModifiedDate *string `json:"lastModifiedDate,omitempty"` + Location *string `json:"location,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceSku +// The SKU (tier) of a workspace. +type WorkspaceSku struct { + CapacityReservationLevel *int `json:"capacityReservationLevel,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20250701.WorkspaceSku_STATUS +// The SKU (tier) of a workspace. +type WorkspaceSku_STATUS struct { + CapacityReservationLevel *int `json:"capacityReservationLevel,omitempty"` + LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20250701.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 v1api20250701.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"` +} + +// Storage version of v1api20250701.WorkspaceOperatorSecrets +type WorkspaceOperatorSecrets struct { + PrimarySharedKey *genruntime.SecretDestination `json:"primarySharedKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondarySharedKey *genruntime.SecretDestination `json:"secondarySharedKey,omitempty"` +} + +func init() { + SchemeBuilder.Register(&Workspace{}, &WorkspaceList{}) +} diff --git a/v2/api/operationalinsights/v1api20250701/storage/workspace_types_gen_test.go b/v2/api/operationalinsights/v1api20250701/storage/workspace_types_gen_test.go new file mode 100644 index 00000000000..10c1b8228da --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/storage/workspace_types_gen_test.go @@ -0,0 +1,1343 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +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_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_PrivateLinkScopedResource_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 PrivateLinkScopedResource_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateLinkScopedResource_STATUS, PrivateLinkScopedResource_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateLinkScopedResource_STATUS runs a test to see if a specific instance of PrivateLinkScopedResource_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateLinkScopedResource_STATUS(subject PrivateLinkScopedResource_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateLinkScopedResource_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 PrivateLinkScopedResource_STATUS instances for property testing - lazily instantiated by +// PrivateLinkScopedResource_STATUSGenerator() +var privateLinkScopedResource_STATUSGenerator gopter.Gen + +// PrivateLinkScopedResource_STATUSGenerator returns a generator of PrivateLinkScopedResource_STATUS instances for property testing. +func PrivateLinkScopedResource_STATUSGenerator() gopter.Gen { + if privateLinkScopedResource_STATUSGenerator != nil { + return privateLinkScopedResource_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS(generators) + privateLinkScopedResource_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateLinkScopedResource_STATUS{}), generators) + + return privateLinkScopedResource_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS(gens map[string]gopter.Gen) { + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["ScopeId"] = gen.PtrOf(gen.AlphaString()) +} + +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()) +} + +func Test_Workspace_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 Workspace via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace, WorkspaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace runs a test to see if a specific instance of Workspace round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace(subject Workspace) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace + 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 Workspace instances for property testing - lazily instantiated by WorkspaceGenerator() +var workspaceGenerator gopter.Gen + +// WorkspaceGenerator returns a generator of Workspace instances for property testing. +func WorkspaceGenerator() gopter.Gen { + if workspaceGenerator != nil { + return workspaceGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspace(generators) + workspaceGenerator = gen.Struct(reflect.TypeOf(Workspace{}), generators) + + return workspaceGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspace is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace(gens map[string]gopter.Gen) { + gens["Spec"] = Workspace_SpecGenerator() + gens["Status"] = Workspace_STATUSGenerator() +} + +func Test_WorkspaceCapping_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 WorkspaceCapping via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceCapping, WorkspaceCappingGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceCapping runs a test to see if a specific instance of WorkspaceCapping round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceCapping(subject WorkspaceCapping) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceCapping + 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 WorkspaceCapping instances for property testing - lazily instantiated by WorkspaceCappingGenerator() +var workspaceCappingGenerator gopter.Gen + +// WorkspaceCappingGenerator returns a generator of WorkspaceCapping instances for property testing. +func WorkspaceCappingGenerator() gopter.Gen { + if workspaceCappingGenerator != nil { + return workspaceCappingGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceCapping(generators) + workspaceCappingGenerator = gen.Struct(reflect.TypeOf(WorkspaceCapping{}), generators) + + return workspaceCappingGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceCapping is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceCapping(gens map[string]gopter.Gen) { + gens["DailyQuotaGb"] = gen.PtrOf(gen.Float64()) +} + +func Test_WorkspaceCapping_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 WorkspaceCapping_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceCapping_STATUS, WorkspaceCapping_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceCapping_STATUS runs a test to see if a specific instance of WorkspaceCapping_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceCapping_STATUS(subject WorkspaceCapping_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceCapping_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 WorkspaceCapping_STATUS instances for property testing - lazily instantiated by +// WorkspaceCapping_STATUSGenerator() +var workspaceCapping_STATUSGenerator gopter.Gen + +// WorkspaceCapping_STATUSGenerator returns a generator of WorkspaceCapping_STATUS instances for property testing. +func WorkspaceCapping_STATUSGenerator() gopter.Gen { + if workspaceCapping_STATUSGenerator != nil { + return workspaceCapping_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS(generators) + workspaceCapping_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceCapping_STATUS{}), generators) + + return workspaceCapping_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS(gens map[string]gopter.Gen) { + gens["DailyQuotaGb"] = gen.PtrOf(gen.Float64()) + gens["DataIngestionStatus"] = gen.PtrOf(gen.AlphaString()) + gens["QuotaNextResetTime"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceFailoverProperties_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 WorkspaceFailoverProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS, WorkspaceFailoverProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS runs a test to see if a specific instance of WorkspaceFailoverProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS(subject WorkspaceFailoverProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFailoverProperties_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 WorkspaceFailoverProperties_STATUS instances for property testing - lazily instantiated by +// WorkspaceFailoverProperties_STATUSGenerator() +var workspaceFailoverProperties_STATUSGenerator gopter.Gen + +// WorkspaceFailoverProperties_STATUSGenerator returns a generator of WorkspaceFailoverProperties_STATUS instances for property testing. +func WorkspaceFailoverProperties_STATUSGenerator() gopter.Gen { + if workspaceFailoverProperties_STATUSGenerator != nil { + return workspaceFailoverProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS(generators) + workspaceFailoverProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceFailoverProperties_STATUS{}), generators) + + return workspaceFailoverProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS(gens map[string]gopter.Gen) { + gens["LastModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["State"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceFeatures_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 WorkspaceFeatures via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFeatures, WorkspaceFeaturesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFeatures runs a test to see if a specific instance of WorkspaceFeatures round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFeatures(subject WorkspaceFeatures) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFeatures + 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 WorkspaceFeatures instances for property testing - lazily instantiated by WorkspaceFeaturesGenerator() +var workspaceFeaturesGenerator gopter.Gen + +// WorkspaceFeaturesGenerator returns a generator of WorkspaceFeatures instances for property testing. +func WorkspaceFeaturesGenerator() gopter.Gen { + if workspaceFeaturesGenerator != nil { + return workspaceFeaturesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFeatures(generators) + workspaceFeaturesGenerator = gen.Struct(reflect.TypeOf(WorkspaceFeatures{}), generators) + + return workspaceFeaturesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFeatures is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFeatures(gens map[string]gopter.Gen) { + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["EnableDataExport"] = gen.PtrOf(gen.Bool()) + gens["EnableLogAccessUsingOnlyResourcePermissions"] = gen.PtrOf(gen.Bool()) + gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) +} + +func Test_WorkspaceFeatures_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 WorkspaceFeatures_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFeatures_STATUS, WorkspaceFeatures_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFeatures_STATUS runs a test to see if a specific instance of WorkspaceFeatures_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFeatures_STATUS(subject WorkspaceFeatures_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFeatures_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 WorkspaceFeatures_STATUS instances for property testing - lazily instantiated by +// WorkspaceFeatures_STATUSGenerator() +var workspaceFeatures_STATUSGenerator gopter.Gen + +// WorkspaceFeatures_STATUSGenerator returns a generator of WorkspaceFeatures_STATUS instances for property testing. +func WorkspaceFeatures_STATUSGenerator() gopter.Gen { + if workspaceFeatures_STATUSGenerator != nil { + return workspaceFeatures_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS(generators) + workspaceFeatures_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceFeatures_STATUS{}), generators) + + return workspaceFeatures_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS(gens map[string]gopter.Gen) { + gens["Associations"] = gen.SliceOf(gen.AlphaString()) + gens["ClusterResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["EnableDataExport"] = gen.PtrOf(gen.Bool()) + gens["EnableLogAccessUsingOnlyResourcePermissions"] = gen.PtrOf(gen.Bool()) + gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) + gens["UnifiedSentinelBillingOnly"] = gen.PtrOf(gen.Bool()) +} + +func Test_WorkspaceOperatorSecrets_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 WorkspaceOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceOperatorSecrets, WorkspaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceOperatorSecrets runs a test to see if a specific instance of WorkspaceOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceOperatorSecrets(subject WorkspaceOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceOperatorSecrets + 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 WorkspaceOperatorSecrets instances for property testing - lazily instantiated by +// WorkspaceOperatorSecretsGenerator() +var workspaceOperatorSecretsGenerator gopter.Gen + +// WorkspaceOperatorSecretsGenerator returns a generator of WorkspaceOperatorSecrets instances for property testing. +func WorkspaceOperatorSecretsGenerator() gopter.Gen { + if workspaceOperatorSecretsGenerator != nil { + return workspaceOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + workspaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(WorkspaceOperatorSecrets{}), generators) + + return workspaceOperatorSecretsGenerator +} + +func Test_WorkspaceOperatorSpec_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 WorkspaceOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceOperatorSpec, WorkspaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceOperatorSpec runs a test to see if a specific instance of WorkspaceOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceOperatorSpec(subject WorkspaceOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceOperatorSpec + 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 WorkspaceOperatorSpec instances for property testing - lazily instantiated by +// WorkspaceOperatorSpecGenerator() +var workspaceOperatorSpecGenerator gopter.Gen + +// WorkspaceOperatorSpecGenerator returns a generator of WorkspaceOperatorSpec instances for property testing. +func WorkspaceOperatorSpecGenerator() gopter.Gen { + if workspaceOperatorSpecGenerator != nil { + return workspaceOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspaceOperatorSpec(generators) + workspaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(WorkspaceOperatorSpec{}), generators) + + return workspaceOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspaceOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(WorkspaceOperatorSecretsGenerator()) +} + +func Test_WorkspaceReplicationProperties_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 WorkspaceReplicationProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceReplicationProperties, WorkspaceReplicationPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceReplicationProperties runs a test to see if a specific instance of WorkspaceReplicationProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceReplicationProperties(subject WorkspaceReplicationProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceReplicationProperties + 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 WorkspaceReplicationProperties instances for property testing - lazily instantiated by +// WorkspaceReplicationPropertiesGenerator() +var workspaceReplicationPropertiesGenerator gopter.Gen + +// WorkspaceReplicationPropertiesGenerator returns a generator of WorkspaceReplicationProperties instances for property testing. +func WorkspaceReplicationPropertiesGenerator() gopter.Gen { + if workspaceReplicationPropertiesGenerator != nil { + return workspaceReplicationPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties(generators) + workspaceReplicationPropertiesGenerator = gen.Struct(reflect.TypeOf(WorkspaceReplicationProperties{}), generators) + + return workspaceReplicationPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceReplicationProperties_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 WorkspaceReplicationProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS, WorkspaceReplicationProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS runs a test to see if a specific instance of WorkspaceReplicationProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS(subject WorkspaceReplicationProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceReplicationProperties_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 WorkspaceReplicationProperties_STATUS instances for property testing - lazily instantiated by +// WorkspaceReplicationProperties_STATUSGenerator() +var workspaceReplicationProperties_STATUSGenerator gopter.Gen + +// WorkspaceReplicationProperties_STATUSGenerator returns a generator of WorkspaceReplicationProperties_STATUS instances for property testing. +func WorkspaceReplicationProperties_STATUSGenerator() gopter.Gen { + if workspaceReplicationProperties_STATUSGenerator != nil { + return workspaceReplicationProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS(generators) + workspaceReplicationProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceReplicationProperties_STATUS{}), generators) + + return workspaceReplicationProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS(gens map[string]gopter.Gen) { + gens["CreatedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["LastModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceSku_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 WorkspaceSku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceSku, WorkspaceSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceSku runs a test to see if a specific instance of WorkspaceSku round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceSku(subject WorkspaceSku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceSku + 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 WorkspaceSku instances for property testing - lazily instantiated by WorkspaceSkuGenerator() +var workspaceSkuGenerator gopter.Gen + +// WorkspaceSkuGenerator returns a generator of WorkspaceSku instances for property testing. +func WorkspaceSkuGenerator() gopter.Gen { + if workspaceSkuGenerator != nil { + return workspaceSkuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceSku(generators) + workspaceSkuGenerator = gen.Struct(reflect.TypeOf(WorkspaceSku{}), generators) + + return workspaceSkuGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceSku(gens map[string]gopter.Gen) { + gens["CapacityReservationLevel"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceSku_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 WorkspaceSku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceSku_STATUS, WorkspaceSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceSku_STATUS runs a test to see if a specific instance of WorkspaceSku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceSku_STATUS(subject WorkspaceSku_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceSku_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 WorkspaceSku_STATUS instances for property testing - lazily instantiated by +// WorkspaceSku_STATUSGenerator() +var workspaceSku_STATUSGenerator gopter.Gen + +// WorkspaceSku_STATUSGenerator returns a generator of WorkspaceSku_STATUS instances for property testing. +func WorkspaceSku_STATUSGenerator() gopter.Gen { + if workspaceSku_STATUSGenerator != nil { + return workspaceSku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS(generators) + workspaceSku_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceSku_STATUS{}), generators) + + return workspaceSku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS(gens map[string]gopter.Gen) { + gens["CapacityReservationLevel"] = gen.PtrOf(gen.Int()) + gens["LastSkuUpdate"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Workspace_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 Workspace_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace_STATUS, Workspace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace_STATUS runs a test to see if a specific instance of Workspace_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace_STATUS(subject Workspace_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace_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 Workspace_STATUS instances for property testing - lazily instantiated by Workspace_STATUSGenerator() +var workspace_STATUSGenerator gopter.Gen + +// Workspace_STATUSGenerator returns a generator of Workspace_STATUS instances for property testing. +// We first initialize workspace_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 Workspace_STATUSGenerator() gopter.Gen { + if workspace_STATUSGenerator != nil { + return workspace_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_STATUS(generators) + workspace_STATUSGenerator = gen.Struct(reflect.TypeOf(Workspace_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_STATUS(generators) + AddRelatedPropertyGeneratorsForWorkspace_STATUS(generators) + workspace_STATUSGenerator = gen.Struct(reflect.TypeOf(Workspace_STATUS{}), generators) + + return workspace_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspace_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspace_STATUS(gens map[string]gopter.Gen) { + gens["CreatedDate"] = gen.PtrOf(gen.AlphaString()) + gens["CustomerId"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultDataCollectionRuleResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["ForceCmkForQuery"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["ModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccessForIngestion"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccessForQuery"] = gen.PtrOf(gen.AlphaString()) + gens["RetentionInDays"] = gen.PtrOf(gen.Int()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspace_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace_STATUS(gens map[string]gopter.Gen) { + gens["Failover"] = gen.PtrOf(WorkspaceFailoverProperties_STATUSGenerator()) + gens["Features"] = gen.PtrOf(WorkspaceFeatures_STATUSGenerator()) + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["PrivateLinkScopedResources"] = gen.SliceOf(PrivateLinkScopedResource_STATUSGenerator()) + gens["Replication"] = gen.PtrOf(WorkspaceReplicationProperties_STATUSGenerator()) + gens["Sku"] = gen.PtrOf(WorkspaceSku_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) + gens["WorkspaceCapping"] = gen.PtrOf(WorkspaceCapping_STATUSGenerator()) +} + +func Test_Workspace_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 Workspace_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace_Spec, Workspace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace_Spec runs a test to see if a specific instance of Workspace_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace_Spec(subject Workspace_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace_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 Workspace_Spec instances for property testing - lazily instantiated by Workspace_SpecGenerator() +var workspace_SpecGenerator gopter.Gen + +// Workspace_SpecGenerator returns a generator of Workspace_Spec instances for property testing. +// We first initialize workspace_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 Workspace_SpecGenerator() gopter.Gen { + if workspace_SpecGenerator != nil { + return workspace_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_Spec(generators) + workspace_SpecGenerator = gen.Struct(reflect.TypeOf(Workspace_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_Spec(generators) + AddRelatedPropertyGeneratorsForWorkspace_Spec(generators) + workspace_SpecGenerator = gen.Struct(reflect.TypeOf(Workspace_Spec{}), generators) + + return workspace_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspace_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspace_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["ForceCmkForQuery"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() + gens["PublicNetworkAccessForIngestion"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccessForQuery"] = gen.PtrOf(gen.AlphaString()) + gens["RetentionInDays"] = gen.PtrOf(gen.Int()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspace_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace_Spec(gens map[string]gopter.Gen) { + gens["Features"] = gen.PtrOf(WorkspaceFeaturesGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(WorkspaceOperatorSpecGenerator()) + gens["Replication"] = gen.PtrOf(WorkspaceReplicationPropertiesGenerator()) + gens["Sku"] = gen.PtrOf(WorkspaceSkuGenerator()) + gens["WorkspaceCapping"] = gen.PtrOf(WorkspaceCappingGenerator()) +} diff --git a/v2/api/operationalinsights/v1api20250701/storage/zz_generated.deepcopy.go b/v2/api/operationalinsights/v1api20250701/storage/zz_generated.deepcopy.go new file mode 100644 index 00000000000..d2279fa9d64 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/storage/zz_generated.deepcopy.go @@ -0,0 +1,969 @@ +//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 *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 *PrivateLinkScopedResource_STATUS) DeepCopyInto(out *PrivateLinkScopedResource_STATUS) { + *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.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } + if in.ScopeId != nil { + in, out := &in.ScopeId, &out.ScopeId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateLinkScopedResource_STATUS. +func (in *PrivateLinkScopedResource_STATUS) DeepCopy() *PrivateLinkScopedResource_STATUS { + if in == nil { + return nil + } + out := new(PrivateLinkScopedResource_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 *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 +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspace) DeepCopyInto(out *Workspace) { + *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 Workspace. +func (in *Workspace) DeepCopy() *Workspace { + if in == nil { + return nil + } + out := new(Workspace) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Workspace) 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 *WorkspaceCapping) DeepCopyInto(out *WorkspaceCapping) { + *out = *in + if in.DailyQuotaGb != nil { + in, out := &in.DailyQuotaGb, &out.DailyQuotaGb + *out = new(float64) + **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 WorkspaceCapping. +func (in *WorkspaceCapping) DeepCopy() *WorkspaceCapping { + if in == nil { + return nil + } + out := new(WorkspaceCapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceCapping_STATUS) DeepCopyInto(out *WorkspaceCapping_STATUS) { + *out = *in + if in.DailyQuotaGb != nil { + in, out := &in.DailyQuotaGb, &out.DailyQuotaGb + *out = new(float64) + **out = **in + } + if in.DataIngestionStatus != nil { + in, out := &in.DataIngestionStatus, &out.DataIngestionStatus + *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.QuotaNextResetTime != nil { + in, out := &in.QuotaNextResetTime, &out.QuotaNextResetTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceCapping_STATUS. +func (in *WorkspaceCapping_STATUS) DeepCopy() *WorkspaceCapping_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceCapping_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 *WorkspaceFailoverProperties_STATUS) DeepCopyInto(out *WorkspaceFailoverProperties_STATUS) { + *out = *in + if in.LastModifiedDate != nil { + in, out := &in.LastModifiedDate, &out.LastModifiedDate + *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.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceFailoverProperties_STATUS. +func (in *WorkspaceFailoverProperties_STATUS) DeepCopy() *WorkspaceFailoverProperties_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceFailoverProperties_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 *WorkspaceFeatures) DeepCopyInto(out *WorkspaceFeatures) { + *out = *in + if in.ClusterResourceReference != nil { + in, out := &in.ClusterResourceReference, &out.ClusterResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.EnableDataExport != nil { + in, out := &in.EnableDataExport, &out.EnableDataExport + *out = new(bool) + **out = **in + } + if in.EnableLogAccessUsingOnlyResourcePermissions != nil { + in, out := &in.EnableLogAccessUsingOnlyResourcePermissions, &out.EnableLogAccessUsingOnlyResourcePermissions + *out = new(bool) + **out = **in + } + if in.ImmediatePurgeDataOn30Days != nil { + in, out := &in.ImmediatePurgeDataOn30Days, &out.ImmediatePurgeDataOn30Days + *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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceFeatures. +func (in *WorkspaceFeatures) DeepCopy() *WorkspaceFeatures { + if in == nil { + return nil + } + out := new(WorkspaceFeatures) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceFeatures_STATUS) DeepCopyInto(out *WorkspaceFeatures_STATUS) { + *out = *in + if in.Associations != nil { + in, out := &in.Associations, &out.Associations + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ClusterResourceId != nil { + in, out := &in.ClusterResourceId, &out.ClusterResourceId + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.EnableDataExport != nil { + in, out := &in.EnableDataExport, &out.EnableDataExport + *out = new(bool) + **out = **in + } + if in.EnableLogAccessUsingOnlyResourcePermissions != nil { + in, out := &in.EnableLogAccessUsingOnlyResourcePermissions, &out.EnableLogAccessUsingOnlyResourcePermissions + *out = new(bool) + **out = **in + } + if in.ImmediatePurgeDataOn30Days != nil { + in, out := &in.ImmediatePurgeDataOn30Days, &out.ImmediatePurgeDataOn30Days + *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.UnifiedSentinelBillingOnly != nil { + in, out := &in.UnifiedSentinelBillingOnly, &out.UnifiedSentinelBillingOnly + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceFeatures_STATUS. +func (in *WorkspaceFeatures_STATUS) DeepCopy() *WorkspaceFeatures_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceFeatures_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 *WorkspaceList) DeepCopyInto(out *WorkspaceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Workspace, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceList. +func (in *WorkspaceList) DeepCopy() *WorkspaceList { + if in == nil { + return nil + } + out := new(WorkspaceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspaceList) 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 *WorkspaceOperatorSecrets) DeepCopyInto(out *WorkspaceOperatorSecrets) { + *out = *in + if in.PrimarySharedKey != nil { + in, out := &in.PrimarySharedKey, &out.PrimarySharedKey + *out = new(genruntime.SecretDestination) + **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.SecondarySharedKey != nil { + in, out := &in.SecondarySharedKey, &out.SecondarySharedKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceOperatorSecrets. +func (in *WorkspaceOperatorSecrets) DeepCopy() *WorkspaceOperatorSecrets { + if in == nil { + return nil + } + out := new(WorkspaceOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceOperatorSpec) DeepCopyInto(out *WorkspaceOperatorSpec) { + *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 + } + } + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(WorkspaceOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceOperatorSpec. +func (in *WorkspaceOperatorSpec) DeepCopy() *WorkspaceOperatorSpec { + if in == nil { + return nil + } + out := new(WorkspaceOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceReplicationProperties) DeepCopyInto(out *WorkspaceReplicationProperties) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *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 WorkspaceReplicationProperties. +func (in *WorkspaceReplicationProperties) DeepCopy() *WorkspaceReplicationProperties { + if in == nil { + return nil + } + out := new(WorkspaceReplicationProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceReplicationProperties_STATUS) DeepCopyInto(out *WorkspaceReplicationProperties_STATUS) { + *out = *in + if in.CreatedDate != nil { + in, out := &in.CreatedDate, &out.CreatedDate + *out = new(string) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.LastModifiedDate != nil { + in, out := &in.LastModifiedDate, &out.LastModifiedDate + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *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.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceReplicationProperties_STATUS. +func (in *WorkspaceReplicationProperties_STATUS) DeepCopy() *WorkspaceReplicationProperties_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceReplicationProperties_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 *WorkspaceSku) DeepCopyInto(out *WorkspaceSku) { + *out = *in + if in.CapacityReservationLevel != nil { + in, out := &in.CapacityReservationLevel, &out.CapacityReservationLevel + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *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 WorkspaceSku. +func (in *WorkspaceSku) DeepCopy() *WorkspaceSku { + if in == nil { + return nil + } + out := new(WorkspaceSku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceSku_STATUS) DeepCopyInto(out *WorkspaceSku_STATUS) { + *out = *in + if in.CapacityReservationLevel != nil { + in, out := &in.CapacityReservationLevel, &out.CapacityReservationLevel + *out = new(int) + **out = **in + } + if in.LastSkuUpdate != nil { + in, out := &in.LastSkuUpdate, &out.LastSkuUpdate + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *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 WorkspaceSku_STATUS. +func (in *WorkspaceSku_STATUS) DeepCopy() *WorkspaceSku_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceSku_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 *Workspace_STATUS) DeepCopyInto(out *Workspace_STATUS) { + *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.CreatedDate != nil { + in, out := &in.CreatedDate, &out.CreatedDate + *out = new(string) + **out = **in + } + if in.CustomerId != nil { + in, out := &in.CustomerId, &out.CustomerId + *out = new(string) + **out = **in + } + if in.DefaultDataCollectionRuleResourceId != nil { + in, out := &in.DefaultDataCollectionRuleResourceId, &out.DefaultDataCollectionRuleResourceId + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Failover != nil { + in, out := &in.Failover, &out.Failover + *out = new(WorkspaceFailoverProperties_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Features != nil { + in, out := &in.Features, &out.Features + *out = new(WorkspaceFeatures_STATUS) + (*in).DeepCopyInto(*out) + } + if in.ForceCmkForQuery != nil { + in, out := &in.ForceCmkForQuery, &out.ForceCmkForQuery + *out = new(bool) + **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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.ModifiedDate != nil { + in, out := &in.ModifiedDate, &out.ModifiedDate + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateLinkScopedResources != nil { + in, out := &in.PrivateLinkScopedResources, &out.PrivateLinkScopedResources + *out = make([]PrivateLinkScopedResource_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 + } + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(string) + **out = **in + } + if in.PublicNetworkAccessForIngestion != nil { + in, out := &in.PublicNetworkAccessForIngestion, &out.PublicNetworkAccessForIngestion + *out = new(string) + **out = **in + } + if in.PublicNetworkAccessForQuery != nil { + in, out := &in.PublicNetworkAccessForQuery, &out.PublicNetworkAccessForQuery + *out = new(string) + **out = **in + } + if in.Replication != nil { + in, out := &in.Replication, &out.Replication + *out = new(WorkspaceReplicationProperties_STATUS) + (*in).DeepCopyInto(*out) + } + if in.RetentionInDays != nil { + in, out := &in.RetentionInDays, &out.RetentionInDays + *out = new(int) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(WorkspaceSku_STATUS) + (*in).DeepCopyInto(*out) + } + 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.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.WorkspaceCapping != nil { + in, out := &in.WorkspaceCapping, &out.WorkspaceCapping + *out = new(WorkspaceCapping_STATUS) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace_STATUS. +func (in *Workspace_STATUS) DeepCopy() *Workspace_STATUS { + if in == nil { + return nil + } + out := new(Workspace_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 *Workspace_Spec) DeepCopyInto(out *Workspace_Spec) { + *out = *in + if in.DefaultDataCollectionRuleResourceReference != nil { + in, out := &in.DefaultDataCollectionRuleResourceReference, &out.DefaultDataCollectionRuleResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Features != nil { + in, out := &in.Features, &out.Features + *out = new(WorkspaceFeatures) + (*in).DeepCopyInto(*out) + } + if in.ForceCmkForQuery != nil { + in, out := &in.ForceCmkForQuery, &out.ForceCmkForQuery + *out = new(bool) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(WorkspaceOperatorSpec) + (*in).DeepCopyInto(*out) + } + 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.PublicNetworkAccessForIngestion != nil { + in, out := &in.PublicNetworkAccessForIngestion, &out.PublicNetworkAccessForIngestion + *out = new(string) + **out = **in + } + if in.PublicNetworkAccessForQuery != nil { + in, out := &in.PublicNetworkAccessForQuery, &out.PublicNetworkAccessForQuery + *out = new(string) + **out = **in + } + if in.Replication != nil { + in, out := &in.Replication, &out.Replication + *out = new(WorkspaceReplicationProperties) + (*in).DeepCopyInto(*out) + } + if in.RetentionInDays != nil { + in, out := &in.RetentionInDays, &out.RetentionInDays + *out = new(int) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(WorkspaceSku) + (*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.WorkspaceCapping != nil { + in, out := &in.WorkspaceCapping, &out.WorkspaceCapping + *out = new(WorkspaceCapping) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace_Spec. +func (in *Workspace_Spec) DeepCopy() *Workspace_Spec { + if in == nil { + return nil + } + out := new(Workspace_Spec) + in.DeepCopyInto(out) + return out +} diff --git a/v2/api/operationalinsights/v1api20250701/structure.txt b/v2/api/operationalinsights/v1api20250701/structure.txt new file mode 100644 index 00000000000..7fc2a330ac1 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/structure.txt @@ -0,0 +1,175 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701 +-------------------------------------------------------------------------------- +APIVersion: Enum (1 value) +└── "2025-07-01" + +Workspace: Resource +├── Owner: resources/v1apiv20191001.ResourceGroup +├── Spec: Object (16 properties) +│ ├── AzureName: Validated (3 rules) +│ │ ├── Rule 0: MaxLength: 63 +│ │ ├── Rule 1: MinLength: 4 +│ │ └── Rule 2: Pattern: "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$" +│ ├── DefaultDataCollectionRuleResourceReference: *genruntime.ResourceReference +│ ├── Etag: *string +│ ├── Features: *Object (5 properties) +│ │ ├── ClusterResourceReference: *genruntime.ResourceReference +│ │ ├── DisableLocalAuth: *bool +│ │ ├── EnableDataExport: *bool +│ │ ├── EnableLogAccessUsingOnlyResourcePermissions: *bool +│ │ └── ImmediatePurgeDataOn30Days: *bool +│ ├── ForceCmkForQuery: *bool +│ ├── Identity: *Object (2 properties) +│ │ ├── Type: *Enum (3 values) +│ │ │ ├── "None" +│ │ │ ├── "SystemAssigned" +│ │ │ └── "UserAssigned" +│ │ └── UserAssignedIdentities: Object (1 property)[] +│ │ └── Reference: genruntime.ResourceReference +│ ├── Location: *string +│ ├── OperatorSpec: *Object (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── SecretExpressions: *core.DestinationExpression[] +│ │ └── Secrets: *Object (2 properties) +│ │ ├── PrimarySharedKey: *genruntime.SecretDestination +│ │ └── SecondarySharedKey: *genruntime.SecretDestination +│ ├── Owner: *genruntime.KnownResourceReference +│ ├── PublicNetworkAccessForIngestion: *Enum (3 values) +│ │ ├── "Disabled" +│ │ ├── "Enabled" +│ │ └── "SecuredByPerimeter" +│ ├── PublicNetworkAccessForQuery: *Enum (3 values) +│ │ ├── "Disabled" +│ │ ├── "Enabled" +│ │ └── "SecuredByPerimeter" +│ ├── Replication: *Object (2 properties) +│ │ ├── Enabled: *bool +│ │ └── Location: *string +│ ├── RetentionInDays: *int +│ ├── Sku: *Object (2 properties) +│ │ ├── CapacityReservationLevel: *int +│ │ └── Name: *Enum (8 values) +│ │ ├── "CapacityReservation" +│ │ ├── "Free" +│ │ ├── "LACluster" +│ │ ├── "PerGB2018" +│ │ ├── "PerNode" +│ │ ├── "Premium" +│ │ ├── "Standalone" +│ │ └── "Standard" +│ ├── Tags: map[string]string +│ └── WorkspaceCapping: *Object (1 property) +│ └── DailyQuotaGb: *float64 +└── Status: Object (24 properties) + ├── Conditions: conditions.Condition[] + ├── CreatedDate: *string + ├── CustomerId: *string + ├── DefaultDataCollectionRuleResourceId: *string + ├── Etag: *string + ├── Failover: *Object (2 properties) + │ ├── LastModifiedDate: *string + │ └── State: *Enum (5 values) + │ ├── "Activating" + │ ├── "Active" + │ ├── "Deactivating" + │ ├── "Failed" + │ └── "Inactive" + ├── Features: *Object (7 properties) + │ ├── Associations: string[] + │ ├── ClusterResourceId: *string + │ ├── DisableLocalAuth: *bool + │ ├── EnableDataExport: *bool + │ ├── EnableLogAccessUsingOnlyResourcePermissions: *bool + │ ├── ImmediatePurgeDataOn30Days: *bool + │ └── UnifiedSentinelBillingOnly: *bool + ├── ForceCmkForQuery: *bool + ├── 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 + ├── Location: *string + ├── ModifiedDate: *string + ├── Name: *string + ├── PrivateLinkScopedResources: Object (2 properties)[] + │ ├── ResourceId: *string + │ └── ScopeId: *string + ├── ProvisioningState: *Enum (7 values) + │ ├── "Canceled" + │ ├── "Creating" + │ ├── "Deleting" + │ ├── "Failed" + │ ├── "ProvisioningAccount" + │ ├── "Succeeded" + │ └── "Updating" + ├── PublicNetworkAccessForIngestion: *Enum (3 values) + │ ├── "Disabled" + │ ├── "Enabled" + │ └── "SecuredByPerimeter" + ├── PublicNetworkAccessForQuery: *Enum (3 values) + │ ├── "Disabled" + │ ├── "Enabled" + │ └── "SecuredByPerimeter" + ├── Replication: *Object (5 properties) + │ ├── CreatedDate: *string + │ ├── Enabled: *bool + │ ├── LastModifiedDate: *string + │ ├── Location: *string + │ └── ProvisioningState: *Enum (9 values) + │ ├── "Canceled" + │ ├── "DisableRequested" + │ ├── "Disabling" + │ ├── "EnableRequested" + │ ├── "Enabling" + │ ├── "Failed" + │ ├── "RollbackRequested" + │ ├── "RollingBack" + │ └── "Succeeded" + ├── RetentionInDays: *int + ├── Sku: *Object (3 properties) + │ ├── CapacityReservationLevel: *int + │ ├── LastSkuUpdate: *string + │ └── Name: *Enum (8 values) + │ ├── "CapacityReservation" + │ ├── "Free" + │ ├── "LACluster" + │ ├── "PerGB2018" + │ ├── "PerNode" + │ ├── "Premium" + │ ├── "Standalone" + │ └── "Standard" + ├── 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 + └── WorkspaceCapping: *Object (3 properties) + ├── DailyQuotaGb: *float64 + ├── DataIngestionStatus: *Enum (6 values) + │ ├── "ApproachingQuota" + │ ├── "ForceOff" + │ ├── "ForceOn" + │ ├── "OverQuota" + │ ├── "RespectQuota" + │ └── "SubscriptionSuspended" + └── QuotaNextResetTime: *string + diff --git a/v2/api/operationalinsights/v1api20250701/webhook/structure.txt b/v2/api/operationalinsights/v1api20250701/webhook/structure.txt new file mode 100644 index 00000000000..4b3a00ec537 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/webhook/structure.txt @@ -0,0 +1,5 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/webhook +---------------------------------------------------------------------------------------- +Workspace: Object (0 properties) + diff --git a/v2/api/operationalinsights/v1api20250701/webhook/workspace_types_gen.go b/v2/api/operationalinsights/v1api20250701/webhook/workspace_types_gen.go new file mode 100644 index 00000000000..13710fb0b56 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/webhook/workspace_types_gen.go @@ -0,0 +1,191 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package webhook + +import ( + "context" + "fmt" + v20250701 "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701" + "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/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/webhook" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +type Workspace struct { +} + +// +kubebuilder:webhook:path=/mutate-operationalinsights-azure-com-v1api20250701-workspace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=operationalinsights.azure.com,resources=workspaces,verbs=create;update,versions=v1api20250701,name=default.v1api20250701.workspaces.operationalinsights.azure.com,admissionReviewVersions=v1 + +var _ webhook.CustomDefaulter = &Workspace{} + +// Default applies defaults to the Workspace resource +func (workspace *Workspace) Default(ctx context.Context, obj runtime.Object) error { + resource, ok := obj.(*v20250701.Workspace) + if !ok { + return fmt.Errorf("expected github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/Workspace, but got %T", obj) + } + err := workspace.defaultImpl(ctx, resource) + if err != nil { + return err + } + var temp any = workspace + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + err = runtimeDefaulter.CustomDefault(ctx, resource) + if err != nil { + return err + } + } + return nil +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (workspace *Workspace) defaultAzureName(ctx context.Context, obj *v20250701.Workspace) error { + if obj.Spec.AzureName == "" { + obj.Spec.AzureName = obj.Name + } + return nil +} + +// defaultImpl applies the code generated defaults to the Workspace resource +func (workspace *Workspace) defaultImpl(ctx context.Context, obj *v20250701.Workspace) error { + err := workspace.defaultAzureName(ctx, obj) + if err != nil { + return err + } + return nil +} + +// +kubebuilder:webhook:path=/validate-operationalinsights-azure-com-v1api20250701-workspace,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=operationalinsights.azure.com,resources=workspaces,verbs=create;update,versions=v1api20250701,name=validate.v1api20250701.workspaces.operationalinsights.azure.com,admissionReviewVersions=v1 + +var _ webhook.CustomValidator = &Workspace{} + +// ValidateCreate validates the creation of the resource +func (workspace *Workspace) ValidateCreate(ctx context.Context, resource runtime.Object) (admission.Warnings, error) { + obj, ok := resource.(*v20250701.Workspace) + if !ok { + return nil, fmt.Errorf("expected github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/Workspace, but got %T", resource) + } + validations := workspace.createValidations() + var temp any = workspace + if runtimeValidator, ok := temp.(genruntime.Validator[*v20250701.Workspace]); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(ctx, obj, validations) +} + +// ValidateDelete validates the deletion of the resource +func (workspace *Workspace) ValidateDelete(ctx context.Context, resource runtime.Object) (admission.Warnings, error) { + obj, ok := resource.(*v20250701.Workspace) + if !ok { + return nil, fmt.Errorf("expected github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/Workspace, but got %T", resource) + } + validations := workspace.deleteValidations() + var temp any = workspace + if runtimeValidator, ok := temp.(genruntime.Validator[*v20250701.Workspace]); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(ctx, obj, validations) +} + +// ValidateUpdate validates an update of the resource +func (workspace *Workspace) ValidateUpdate(ctx context.Context, oldResource runtime.Object, newResource runtime.Object) (admission.Warnings, error) { + newObj, ok := newResource.(*v20250701.Workspace) + if !ok { + return nil, fmt.Errorf("expected github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/Workspace, but got %T", newResource) + } + oldObj, ok := oldResource.(*v20250701.Workspace) + if !ok { + return nil, fmt.Errorf("expected github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/Workspace, but got %T", oldResource) + } + validations := workspace.updateValidations() + var temp any = workspace + if runtimeValidator, ok := temp.(genruntime.Validator[*v20250701.Workspace]); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + return genruntime.ValidateUpdate( + ctx, + oldObj, + newObj, + validations) +} + +// createValidations validates the creation of the resource +func (workspace *Workspace) createValidations() []func(ctx context.Context, obj *v20250701.Workspace) (admission.Warnings, error) { + return []func(ctx context.Context, obj *v20250701.Workspace) (admission.Warnings, error){ + workspace.validateResourceReferences, + workspace.validateOwnerReference, + workspace.validateSecretDestinations, + workspace.validateConfigMapDestinations, + } +} + +// deleteValidations validates the deletion of the resource +func (workspace *Workspace) deleteValidations() []func(ctx context.Context, obj *v20250701.Workspace) (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (workspace *Workspace) updateValidations() []func(ctx context.Context, oldObj *v20250701.Workspace, newObj *v20250701.Workspace) (admission.Warnings, error) { + return []func(ctx context.Context, oldObj *v20250701.Workspace, newObj *v20250701.Workspace) (admission.Warnings, error){ + func(ctx context.Context, oldObj *v20250701.Workspace, newObj *v20250701.Workspace) (admission.Warnings, error) { + return workspace.validateResourceReferences(ctx, newObj) + }, + workspace.validateWriteOnceProperties, + func(ctx context.Context, oldObj *v20250701.Workspace, newObj *v20250701.Workspace) (admission.Warnings, error) { + return workspace.validateOwnerReference(ctx, newObj) + }, + func(ctx context.Context, oldObj *v20250701.Workspace, newObj *v20250701.Workspace) (admission.Warnings, error) { + return workspace.validateSecretDestinations(ctx, newObj) + }, + func(ctx context.Context, oldObj *v20250701.Workspace, newObj *v20250701.Workspace) (admission.Warnings, error) { + return workspace.validateConfigMapDestinations(ctx, newObj) + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (workspace *Workspace) validateConfigMapDestinations(ctx context.Context, obj *v20250701.Workspace) (admission.Warnings, error) { + if obj.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(obj, nil, obj.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (workspace *Workspace) validateOwnerReference(ctx context.Context, obj *v20250701.Workspace) (admission.Warnings, error) { + return genruntime.ValidateOwner(obj) +} + +// validateResourceReferences validates all resource references +func (workspace *Workspace) validateResourceReferences(ctx context.Context, obj *v20250701.Workspace) (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&obj.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (workspace *Workspace) validateSecretDestinations(ctx context.Context, obj *v20250701.Workspace) (admission.Warnings, error) { + if obj.Spec.OperatorSpec == nil { + return nil, nil + } + var toValidate []*genruntime.SecretDestination + if obj.Spec.OperatorSpec.Secrets != nil { + toValidate = []*genruntime.SecretDestination{ + obj.Spec.OperatorSpec.Secrets.PrimarySharedKey, + obj.Spec.OperatorSpec.Secrets.SecondarySharedKey, + } + } + return secrets.ValidateDestinations(obj, toValidate, obj.Spec.OperatorSpec.SecretExpressions) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (workspace *Workspace) validateWriteOnceProperties(ctx context.Context, oldObj *v20250701.Workspace, newObj *v20250701.Workspace) (admission.Warnings, error) { + return genruntime.ValidateWriteOnceProperties(oldObj, newObj) +} diff --git a/v2/api/operationalinsights/v1api20250701/workspace_types_gen.go b/v2/api/operationalinsights/v1api20250701/workspace_types_gen.go new file mode 100644 index 00000000000..9c51fcfd57b --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/workspace_types_gen.go @@ -0,0 +1,4123 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20250701 + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/arm" + storage "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/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:resource:categories={azure,operationalinsights} +// +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: /operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025-07-01/Workspaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName} +type Workspace struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Workspace_Spec `json:"spec,omitempty"` + Status Workspace_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &Workspace{} + +// GetConditions returns the conditions of the resource +func (workspace *Workspace) GetConditions() conditions.Conditions { + return workspace.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (workspace *Workspace) SetConditions(conditions conditions.Conditions) { + workspace.Status.Conditions = conditions +} + +var _ conversion.Convertible = &Workspace{} + +// ConvertFrom populates our Workspace from the provided hub Workspace +func (workspace *Workspace) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*storage.Workspace) + if !ok { + return fmt.Errorf("expected operationalinsights/v1api20250701/storage/Workspace but received %T instead", hub) + } + + return workspace.AssignProperties_From_Workspace(source) +} + +// ConvertTo populates the provided hub Workspace from our Workspace +func (workspace *Workspace) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*storage.Workspace) + if !ok { + return fmt.Errorf("expected operationalinsights/v1api20250701/storage/Workspace but received %T instead", hub) + } + + return workspace.AssignProperties_To_Workspace(destination) +} + +var _ configmaps.Exporter = &Workspace{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (workspace *Workspace) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if workspace.Spec.OperatorSpec == nil { + return nil + } + return workspace.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &Workspace{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (workspace *Workspace) SecretDestinationExpressions() []*core.DestinationExpression { + if workspace.Spec.OperatorSpec == nil { + return nil + } + return workspace.Spec.OperatorSpec.SecretExpressions +} + +var _ genruntime.ImportableResource = &Workspace{} + +// InitializeSpec initializes the spec for this resource from the given status +func (workspace *Workspace) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Workspace_STATUS); ok { + return workspace.Spec.Initialize_From_Workspace_STATUS(s) + } + + return fmt.Errorf("expected Status of type Workspace_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &Workspace{} + +// AzureName returns the Azure name of the resource +func (workspace *Workspace) AzureName() string { + return workspace.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2025-07-01" +func (workspace Workspace) GetAPIVersion() string { + return "2025-07-01" +} + +// GetResourceScope returns the scope of the resource +func (workspace *Workspace) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (workspace *Workspace) GetSpec() genruntime.ConvertibleSpec { + return &workspace.Spec +} + +// GetStatus returns the status of this resource +func (workspace *Workspace) GetStatus() genruntime.ConvertibleStatus { + return &workspace.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (workspace *Workspace) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.OperationalInsights/workspaces" +func (workspace *Workspace) GetType() string { + return "Microsoft.OperationalInsights/workspaces" +} + +// NewEmptyStatus returns a new empty (blank) status +func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Workspace_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (workspace *Workspace) Owner() *genruntime.ResourceReference { + if workspace.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) + return workspace.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (workspace *Workspace) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Workspace_STATUS); ok { + workspace.Status = *st + return nil + } + + // Convert status to required version + var st Workspace_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + workspace.Status = st + return nil +} + +// AssignProperties_From_Workspace populates our Workspace from the provided source Workspace +func (workspace *Workspace) AssignProperties_From_Workspace(source *storage.Workspace) error { + + // ObjectMeta + workspace.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Workspace_Spec + err := spec.AssignProperties_From_Workspace_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Workspace_Spec() to populate field Spec") + } + workspace.Spec = spec + + // Status + var status Workspace_STATUS + err = status.AssignProperties_From_Workspace_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_Workspace_STATUS() to populate field Status") + } + workspace.Status = status + + // No error + return nil +} + +// AssignProperties_To_Workspace populates the provided destination Workspace from our Workspace +func (workspace *Workspace) AssignProperties_To_Workspace(destination *storage.Workspace) error { + + // ObjectMeta + destination.ObjectMeta = *workspace.ObjectMeta.DeepCopy() + + // Spec + var spec storage.Workspace_Spec + err := workspace.Spec.AssignProperties_To_Workspace_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Workspace_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.Workspace_STATUS + err = workspace.Status.AssignProperties_To_Workspace_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Workspace_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 (workspace *Workspace) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: workspace.Spec.OriginalVersion(), + Kind: "Workspace", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025-07-01/Workspaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName} +type WorkspaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Workspace `json:"items"` +} + +// +kubebuilder:validation:Enum={"2025-07-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2025-07-01") + +type Workspace_Spec struct { + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:MinLength=4 + // +kubebuilder:validation:Pattern="^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$" + // 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"` + + // DefaultDataCollectionRuleResourceReference: The resource ID of the default Data Collection Rule to use for this + // workspace. Expected format is - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + DefaultDataCollectionRuleResourceReference *genruntime.ResourceReference `armReference:"DefaultDataCollectionRuleResourceId" json:"defaultDataCollectionRuleResourceReference,omitempty"` + + // Etag: The etag of the workspace. + Etag *string `json:"etag,omitempty"` + + // Features: Workspace features. + Features *WorkspaceFeatures `json:"features,omitempty"` + + // ForceCmkForQuery: Indicates whether customer managed storage is mandatory for query management. + ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"` + + // Identity: The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + + // +kubebuilder:validation:Required + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *WorkspaceOperatorSpec `json:"operatorSpec,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"` + + // PublicNetworkAccessForIngestion: The network access type for accessing Log Analytics ingestion. + PublicNetworkAccessForIngestion *PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"` + + // PublicNetworkAccessForQuery: The network access type for accessing Log Analytics query. + PublicNetworkAccessForQuery *PublicNetworkAccessType `json:"publicNetworkAccessForQuery,omitempty"` + + // Replication: workspace replication properties. + Replication *WorkspaceReplicationProperties `json:"replication,omitempty"` + + // RetentionInDays: The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers + // documentation for details. + RetentionInDays *int `json:"retentionInDays,omitempty"` + + // Sku: The SKU of the workspace. + Sku *WorkspaceSku `json:"sku,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` + + // WorkspaceCapping: The daily volume cap for ingestion. + WorkspaceCapping *WorkspaceCapping `json:"workspaceCapping,omitempty"` +} + +var _ genruntime.ARMTransformer = &Workspace_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (workspace *Workspace_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if workspace == nil { + return nil, nil + } + result := &arm.Workspace_Spec{} + + // Set property "Etag": + if workspace.Etag != nil { + etag := *workspace.Etag + result.Etag = &etag + } + + // Set property "Identity": + if workspace.Identity != nil { + identity_ARM, err := workspace.Identity.ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identity_ARM.(*arm.Identity) + result.Identity = &identity + } + + // Set property "Location": + if workspace.Location != nil { + location := *workspace.Location + result.Location = &location + } + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if workspace.DefaultDataCollectionRuleResourceReference != nil || + workspace.Features != nil || + workspace.ForceCmkForQuery != nil || + workspace.PublicNetworkAccessForIngestion != nil || + workspace.PublicNetworkAccessForQuery != nil || + workspace.Replication != nil || + workspace.RetentionInDays != nil || + workspace.Sku != nil || + workspace.WorkspaceCapping != nil { + result.Properties = &arm.WorkspaceProperties{} + } + if workspace.DefaultDataCollectionRuleResourceReference != nil { + defaultDataCollectionRuleResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*workspace.DefaultDataCollectionRuleResourceReference) + if err != nil { + return nil, err + } + defaultDataCollectionRuleResourceId := defaultDataCollectionRuleResourceIdARMID + result.Properties.DefaultDataCollectionRuleResourceId = &defaultDataCollectionRuleResourceId + } + if workspace.Features != nil { + features_ARM, err := workspace.Features.ConvertToARM(resolved) + if err != nil { + return nil, err + } + features := *features_ARM.(*arm.WorkspaceFeatures) + result.Properties.Features = &features + } + if workspace.ForceCmkForQuery != nil { + forceCmkForQuery := *workspace.ForceCmkForQuery + result.Properties.ForceCmkForQuery = &forceCmkForQuery + } + if workspace.PublicNetworkAccessForIngestion != nil { + var temp string + temp = string(*workspace.PublicNetworkAccessForIngestion) + publicNetworkAccessForIngestion := arm.PublicNetworkAccessType(temp) + result.Properties.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion + } + if workspace.PublicNetworkAccessForQuery != nil { + var temp string + temp = string(*workspace.PublicNetworkAccessForQuery) + publicNetworkAccessForQuery := arm.PublicNetworkAccessType(temp) + result.Properties.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery + } + if workspace.Replication != nil { + replication_ARM, err := workspace.Replication.ConvertToARM(resolved) + if err != nil { + return nil, err + } + replication := *replication_ARM.(*arm.WorkspaceReplicationProperties) + result.Properties.Replication = &replication + } + if workspace.RetentionInDays != nil { + retentionInDays := *workspace.RetentionInDays + result.Properties.RetentionInDays = &retentionInDays + } + if workspace.Sku != nil { + sku_ARM, err := workspace.Sku.ConvertToARM(resolved) + if err != nil { + return nil, err + } + sku := *sku_ARM.(*arm.WorkspaceSku) + result.Properties.Sku = &sku + } + if workspace.WorkspaceCapping != nil { + workspaceCapping_ARM, err := workspace.WorkspaceCapping.ConvertToARM(resolved) + if err != nil { + return nil, err + } + workspaceCapping := *workspaceCapping_ARM.(*arm.WorkspaceCapping) + result.Properties.WorkspaceCapping = &workspaceCapping + } + + // Set property "Tags": + if workspace.Tags != nil { + result.Tags = make(map[string]string, len(workspace.Tags)) + for key, value := range workspace.Tags { + result.Tags[key] = value + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (workspace *Workspace_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Workspace_Spec{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (workspace *Workspace_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Workspace_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Workspace_Spec, got %T", armInput) + } + + // Set property "AzureName": + workspace.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // no assignment for property "DefaultDataCollectionRuleResourceReference" + + // Set property "Etag": + if typedInput.Etag != nil { + etag := *typedInput.Etag + workspace.Etag = &etag + } + + // Set property "Features": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Features != nil { + var features1 WorkspaceFeatures + err := features1.PopulateFromARM(owner, *typedInput.Properties.Features) + if err != nil { + return err + } + features := features1 + workspace.Features = &features + } + } + + // Set property "ForceCmkForQuery": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForceCmkForQuery != nil { + forceCmkForQuery := *typedInput.Properties.ForceCmkForQuery + workspace.ForceCmkForQuery = &forceCmkForQuery + } + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 Identity + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + workspace.Identity = &identity + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + workspace.Location = &location + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + workspace.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "PublicNetworkAccessForIngestion": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccessForIngestion != nil { + var temp string + temp = string(*typedInput.Properties.PublicNetworkAccessForIngestion) + publicNetworkAccessForIngestion := PublicNetworkAccessType(temp) + workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion + } + } + + // Set property "PublicNetworkAccessForQuery": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccessForQuery != nil { + var temp string + temp = string(*typedInput.Properties.PublicNetworkAccessForQuery) + publicNetworkAccessForQuery := PublicNetworkAccessType(temp) + workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery + } + } + + // Set property "Replication": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Replication != nil { + var replication1 WorkspaceReplicationProperties + err := replication1.PopulateFromARM(owner, *typedInput.Properties.Replication) + if err != nil { + return err + } + replication := replication1 + workspace.Replication = &replication + } + } + + // Set property "RetentionInDays": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RetentionInDays != nil { + retentionInDays := *typedInput.Properties.RetentionInDays + workspace.RetentionInDays = &retentionInDays + } + } + + // Set property "Sku": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Sku != nil { + var sku1 WorkspaceSku + err := sku1.PopulateFromARM(owner, *typedInput.Properties.Sku) + if err != nil { + return err + } + sku := sku1 + workspace.Sku = &sku + } + } + + // Set property "Tags": + if typedInput.Tags != nil { + workspace.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + workspace.Tags[key] = value + } + } + + // Set property "WorkspaceCapping": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.WorkspaceCapping != nil { + var workspaceCapping1 WorkspaceCapping + err := workspaceCapping1.PopulateFromARM(owner, *typedInput.Properties.WorkspaceCapping) + if err != nil { + return err + } + workspaceCapping := workspaceCapping1 + workspace.WorkspaceCapping = &workspaceCapping + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Workspace_Spec{} + +// ConvertSpecFrom populates our Workspace_Spec from the provided source +func (workspace *Workspace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*storage.Workspace_Spec) + if ok { + // Populate our instance from source + return workspace.AssignProperties_From_Workspace_Spec(src) + } + + // Convert to an intermediate form + src = &storage.Workspace_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = workspace.AssignProperties_From_Workspace_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our Workspace_Spec +func (workspace *Workspace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*storage.Workspace_Spec) + if ok { + // Populate destination from our instance + return workspace.AssignProperties_To_Workspace_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.Workspace_Spec{} + err := workspace.AssignProperties_To_Workspace_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_Workspace_Spec populates our Workspace_Spec from the provided source Workspace_Spec +func (workspace *Workspace_Spec) AssignProperties_From_Workspace_Spec(source *storage.Workspace_Spec) error { + + // AzureName + workspace.AzureName = source.AzureName + + // DefaultDataCollectionRuleResourceReference + if source.DefaultDataCollectionRuleResourceReference != nil { + defaultDataCollectionRuleResourceReference := source.DefaultDataCollectionRuleResourceReference.Copy() + workspace.DefaultDataCollectionRuleResourceReference = &defaultDataCollectionRuleResourceReference + } else { + workspace.DefaultDataCollectionRuleResourceReference = nil + } + + // Etag + workspace.Etag = genruntime.ClonePointerToString(source.Etag) + + // Features + if source.Features != nil { + var feature WorkspaceFeatures + err := feature.AssignProperties_From_WorkspaceFeatures(source.Features) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceFeatures() to populate field Features") + } + workspace.Features = &feature + } else { + workspace.Features = nil + } + + // ForceCmkForQuery + if source.ForceCmkForQuery != nil { + forceCmkForQuery := *source.ForceCmkForQuery + workspace.ForceCmkForQuery = &forceCmkForQuery + } else { + workspace.ForceCmkForQuery = nil + } + + // 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") + } + workspace.Identity = &identity + } else { + workspace.Identity = nil + } + + // Location + workspace.Location = genruntime.ClonePointerToString(source.Location) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec WorkspaceOperatorSpec + err := operatorSpec.AssignProperties_From_WorkspaceOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceOperatorSpec() to populate field OperatorSpec") + } + workspace.OperatorSpec = &operatorSpec + } else { + workspace.OperatorSpec = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + workspace.Owner = &owner + } else { + workspace.Owner = nil + } + + // PublicNetworkAccessForIngestion + if source.PublicNetworkAccessForIngestion != nil { + publicNetworkAccessForIngestion := *source.PublicNetworkAccessForIngestion + publicNetworkAccessForIngestionTemp := genruntime.ToEnum(publicNetworkAccessForIngestion, publicNetworkAccessType_Values) + workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestionTemp + } else { + workspace.PublicNetworkAccessForIngestion = nil + } + + // PublicNetworkAccessForQuery + if source.PublicNetworkAccessForQuery != nil { + publicNetworkAccessForQuery := *source.PublicNetworkAccessForQuery + publicNetworkAccessForQueryTemp := genruntime.ToEnum(publicNetworkAccessForQuery, publicNetworkAccessType_Values) + workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQueryTemp + } else { + workspace.PublicNetworkAccessForQuery = nil + } + + // Replication + if source.Replication != nil { + var replication WorkspaceReplicationProperties + err := replication.AssignProperties_From_WorkspaceReplicationProperties(source.Replication) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceReplicationProperties() to populate field Replication") + } + workspace.Replication = &replication + } else { + workspace.Replication = nil + } + + // RetentionInDays + workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays) + + // Sku + if source.Sku != nil { + var sku WorkspaceSku + err := sku.AssignProperties_From_WorkspaceSku(source.Sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceSku() to populate field Sku") + } + workspace.Sku = &sku + } else { + workspace.Sku = nil + } + + // Tags + workspace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // WorkspaceCapping + if source.WorkspaceCapping != nil { + var workspaceCapping WorkspaceCapping + err := workspaceCapping.AssignProperties_From_WorkspaceCapping(source.WorkspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceCapping() to populate field WorkspaceCapping") + } + workspace.WorkspaceCapping = &workspaceCapping + } else { + workspace.WorkspaceCapping = nil + } + + // No error + return nil +} + +// AssignProperties_To_Workspace_Spec populates the provided destination Workspace_Spec from our Workspace_Spec +func (workspace *Workspace_Spec) AssignProperties_To_Workspace_Spec(destination *storage.Workspace_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = workspace.AzureName + + // DefaultDataCollectionRuleResourceReference + if workspace.DefaultDataCollectionRuleResourceReference != nil { + defaultDataCollectionRuleResourceReference := workspace.DefaultDataCollectionRuleResourceReference.Copy() + destination.DefaultDataCollectionRuleResourceReference = &defaultDataCollectionRuleResourceReference + } else { + destination.DefaultDataCollectionRuleResourceReference = nil + } + + // Etag + destination.Etag = genruntime.ClonePointerToString(workspace.Etag) + + // Features + if workspace.Features != nil { + var feature storage.WorkspaceFeatures + err := workspace.Features.AssignProperties_To_WorkspaceFeatures(&feature) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceFeatures() to populate field Features") + } + destination.Features = &feature + } else { + destination.Features = nil + } + + // ForceCmkForQuery + if workspace.ForceCmkForQuery != nil { + forceCmkForQuery := *workspace.ForceCmkForQuery + destination.ForceCmkForQuery = &forceCmkForQuery + } else { + destination.ForceCmkForQuery = nil + } + + // Identity + if workspace.Identity != nil { + var identity storage.Identity + err := workspace.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(workspace.Location) + + // OperatorSpec + if workspace.OperatorSpec != nil { + var operatorSpec storage.WorkspaceOperatorSpec + err := workspace.OperatorSpec.AssignProperties_To_WorkspaceOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = workspace.OriginalVersion() + + // Owner + if workspace.Owner != nil { + owner := workspace.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // PublicNetworkAccessForIngestion + if workspace.PublicNetworkAccessForIngestion != nil { + publicNetworkAccessForIngestion := string(*workspace.PublicNetworkAccessForIngestion) + destination.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion + } else { + destination.PublicNetworkAccessForIngestion = nil + } + + // PublicNetworkAccessForQuery + if workspace.PublicNetworkAccessForQuery != nil { + publicNetworkAccessForQuery := string(*workspace.PublicNetworkAccessForQuery) + destination.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery + } else { + destination.PublicNetworkAccessForQuery = nil + } + + // Replication + if workspace.Replication != nil { + var replication storage.WorkspaceReplicationProperties + err := workspace.Replication.AssignProperties_To_WorkspaceReplicationProperties(&replication) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceReplicationProperties() to populate field Replication") + } + destination.Replication = &replication + } else { + destination.Replication = nil + } + + // RetentionInDays + destination.RetentionInDays = genruntime.ClonePointerToInt(workspace.RetentionInDays) + + // Sku + if workspace.Sku != nil { + var sku storage.WorkspaceSku + err := workspace.Sku.AssignProperties_To_WorkspaceSku(&sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceSku() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(workspace.Tags) + + // WorkspaceCapping + if workspace.WorkspaceCapping != nil { + var workspaceCapping storage.WorkspaceCapping + err := workspace.WorkspaceCapping.AssignProperties_To_WorkspaceCapping(&workspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceCapping() to populate field WorkspaceCapping") + } + destination.WorkspaceCapping = &workspaceCapping + } else { + destination.WorkspaceCapping = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Workspace_STATUS populates our Workspace_Spec from the provided source Workspace_STATUS +func (workspace *Workspace_Spec) Initialize_From_Workspace_STATUS(source *Workspace_STATUS) error { + + // DefaultDataCollectionRuleResourceReference + if source.DefaultDataCollectionRuleResourceId != nil { + defaultDataCollectionRuleResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.DefaultDataCollectionRuleResourceId) + workspace.DefaultDataCollectionRuleResourceReference = &defaultDataCollectionRuleResourceReference + } else { + workspace.DefaultDataCollectionRuleResourceReference = nil + } + + // Etag + workspace.Etag = genruntime.ClonePointerToString(source.Etag) + + // Features + if source.Features != nil { + var feature WorkspaceFeatures + err := feature.Initialize_From_WorkspaceFeatures_STATUS(source.Features) + if err != nil { + return eris.Wrap(err, "calling Initialize_From_WorkspaceFeatures_STATUS() to populate field Features") + } + workspace.Features = &feature + } else { + workspace.Features = nil + } + + // ForceCmkForQuery + if source.ForceCmkForQuery != nil { + forceCmkForQuery := *source.ForceCmkForQuery + workspace.ForceCmkForQuery = &forceCmkForQuery + } else { + workspace.ForceCmkForQuery = nil + } + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.Initialize_From_Identity_STATUS(source.Identity) + if err != nil { + return eris.Wrap(err, "calling Initialize_From_Identity_STATUS() to populate field Identity") + } + workspace.Identity = &identity + } else { + workspace.Identity = nil + } + + // Location + workspace.Location = genruntime.ClonePointerToString(source.Location) + + // PublicNetworkAccessForIngestion + if source.PublicNetworkAccessForIngestion != nil { + publicNetworkAccessForIngestion := genruntime.ToEnum(string(*source.PublicNetworkAccessForIngestion), publicNetworkAccessType_Values) + workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion + } else { + workspace.PublicNetworkAccessForIngestion = nil + } + + // PublicNetworkAccessForQuery + if source.PublicNetworkAccessForQuery != nil { + publicNetworkAccessForQuery := genruntime.ToEnum(string(*source.PublicNetworkAccessForQuery), publicNetworkAccessType_Values) + workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery + } else { + workspace.PublicNetworkAccessForQuery = nil + } + + // Replication + if source.Replication != nil { + var replication WorkspaceReplicationProperties + err := replication.Initialize_From_WorkspaceReplicationProperties_STATUS(source.Replication) + if err != nil { + return eris.Wrap(err, "calling Initialize_From_WorkspaceReplicationProperties_STATUS() to populate field Replication") + } + workspace.Replication = &replication + } else { + workspace.Replication = nil + } + + // RetentionInDays + workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays) + + // Sku + if source.Sku != nil { + var sku WorkspaceSku + err := sku.Initialize_From_WorkspaceSku_STATUS(source.Sku) + if err != nil { + return eris.Wrap(err, "calling Initialize_From_WorkspaceSku_STATUS() to populate field Sku") + } + workspace.Sku = &sku + } else { + workspace.Sku = nil + } + + // Tags + workspace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // WorkspaceCapping + if source.WorkspaceCapping != nil { + var workspaceCapping WorkspaceCapping + err := workspaceCapping.Initialize_From_WorkspaceCapping_STATUS(source.WorkspaceCapping) + if err != nil { + return eris.Wrap(err, "calling Initialize_From_WorkspaceCapping_STATUS() to populate field WorkspaceCapping") + } + workspace.WorkspaceCapping = &workspaceCapping + } else { + workspace.WorkspaceCapping = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (workspace *Workspace_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (workspace *Workspace_Spec) SetAzureName(azureName string) { workspace.AzureName = azureName } + +// The top level Workspace resource container. +type Workspace_STATUS struct { + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CreatedDate: Workspace creation date. + CreatedDate *string `json:"createdDate,omitempty"` + + // CustomerId: This is a read-only property. Represents the ID associated with the workspace. + CustomerId *string `json:"customerId,omitempty"` + + // DefaultDataCollectionRuleResourceId: The resource ID of the default Data Collection Rule to use for this workspace. + // Expected format is - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + DefaultDataCollectionRuleResourceId *string `json:"defaultDataCollectionRuleResourceId,omitempty"` + + // Etag: The etag of the workspace. + Etag *string `json:"etag,omitempty"` + + // Failover: workspace failover properties. + Failover *WorkspaceFailoverProperties_STATUS `json:"failover,omitempty"` + + // Features: Workspace features. + Features *WorkspaceFeatures_STATUS `json:"features,omitempty"` + + // ForceCmkForQuery: Indicates whether customer managed storage is mandatory for query management. + ForceCmkForQuery *bool `json:"forceCmkForQuery,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"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // ModifiedDate: Workspace modification date. + ModifiedDate *string `json:"modifiedDate,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // PrivateLinkScopedResources: List of linked private link scope resources. + PrivateLinkScopedResources []PrivateLinkScopedResource_STATUS `json:"privateLinkScopedResources,omitempty"` + + // ProvisioningState: The provisioning state of the workspace. + ProvisioningState *WorkspaceProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"` + + // PublicNetworkAccessForIngestion: The network access type for accessing Log Analytics ingestion. + PublicNetworkAccessForIngestion *PublicNetworkAccessType_STATUS `json:"publicNetworkAccessForIngestion,omitempty"` + + // PublicNetworkAccessForQuery: The network access type for accessing Log Analytics query. + PublicNetworkAccessForQuery *PublicNetworkAccessType_STATUS `json:"publicNetworkAccessForQuery,omitempty"` + + // Replication: workspace replication properties. + Replication *WorkspaceReplicationProperties_STATUS `json:"replication,omitempty"` + + // RetentionInDays: The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers + // documentation for details. + RetentionInDays *int `json:"retentionInDays,omitempty"` + + // Sku: The SKU of the workspace. + Sku *WorkspaceSku_STATUS `json:"sku,omitempty"` + + // SystemData: Metadata pertaining to creation and last modification of the resource. + 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"` + + // WorkspaceCapping: The daily volume cap for ingestion. + WorkspaceCapping *WorkspaceCapping_STATUS `json:"workspaceCapping,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Workspace_STATUS{} + +// ConvertStatusFrom populates our Workspace_STATUS from the provided source +func (workspace *Workspace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*storage.Workspace_STATUS) + if ok { + // Populate our instance from source + return workspace.AssignProperties_From_Workspace_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.Workspace_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = workspace.AssignProperties_From_Workspace_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our Workspace_STATUS +func (workspace *Workspace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*storage.Workspace_STATUS) + if ok { + // Populate destination from our instance + return workspace.AssignProperties_To_Workspace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.Workspace_STATUS{} + err := workspace.AssignProperties_To_Workspace_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 = &Workspace_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (workspace *Workspace_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Workspace_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (workspace *Workspace_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Workspace_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Workspace_STATUS, got %T", armInput) + } + + // no assignment for property "Conditions" + + // Set property "CreatedDate": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedDate != nil { + createdDate := *typedInput.Properties.CreatedDate + workspace.CreatedDate = &createdDate + } + } + + // Set property "CustomerId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CustomerId != nil { + customerId := *typedInput.Properties.CustomerId + workspace.CustomerId = &customerId + } + } + + // Set property "DefaultDataCollectionRuleResourceId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultDataCollectionRuleResourceId != nil { + defaultDataCollectionRuleResourceId := *typedInput.Properties.DefaultDataCollectionRuleResourceId + workspace.DefaultDataCollectionRuleResourceId = &defaultDataCollectionRuleResourceId + } + } + + // Set property "Etag": + if typedInput.Etag != nil { + etag := *typedInput.Etag + workspace.Etag = &etag + } + + // Set property "Failover": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Failover != nil { + var failover1 WorkspaceFailoverProperties_STATUS + err := failover1.PopulateFromARM(owner, *typedInput.Properties.Failover) + if err != nil { + return err + } + failover := failover1 + workspace.Failover = &failover + } + } + + // Set property "Features": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Features != nil { + var features1 WorkspaceFeatures_STATUS + err := features1.PopulateFromARM(owner, *typedInput.Properties.Features) + if err != nil { + return err + } + features := features1 + workspace.Features = &features + } + } + + // Set property "ForceCmkForQuery": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForceCmkForQuery != nil { + forceCmkForQuery := *typedInput.Properties.ForceCmkForQuery + workspace.ForceCmkForQuery = &forceCmkForQuery + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + workspace.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 + workspace.Identity = &identity + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + workspace.Location = &location + } + + // Set property "ModifiedDate": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ModifiedDate != nil { + modifiedDate := *typedInput.Properties.ModifiedDate + workspace.ModifiedDate = &modifiedDate + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + workspace.Name = &name + } + + // Set property "PrivateLinkScopedResources": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.PrivateLinkScopedResources { + var item1 PrivateLinkScopedResource_STATUS + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + workspace.PrivateLinkScopedResources = append(workspace.PrivateLinkScopedResources, item1) + } + } + + // Set property "ProvisioningState": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ProvisioningState != nil { + var temp string + temp = string(*typedInput.Properties.ProvisioningState) + provisioningState := WorkspaceProperties_ProvisioningState_STATUS(temp) + workspace.ProvisioningState = &provisioningState + } + } + + // Set property "PublicNetworkAccessForIngestion": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccessForIngestion != nil { + var temp string + temp = string(*typedInput.Properties.PublicNetworkAccessForIngestion) + publicNetworkAccessForIngestion := PublicNetworkAccessType_STATUS(temp) + workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion + } + } + + // Set property "PublicNetworkAccessForQuery": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccessForQuery != nil { + var temp string + temp = string(*typedInput.Properties.PublicNetworkAccessForQuery) + publicNetworkAccessForQuery := PublicNetworkAccessType_STATUS(temp) + workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery + } + } + + // Set property "Replication": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Replication != nil { + var replication1 WorkspaceReplicationProperties_STATUS + err := replication1.PopulateFromARM(owner, *typedInput.Properties.Replication) + if err != nil { + return err + } + replication := replication1 + workspace.Replication = &replication + } + } + + // Set property "RetentionInDays": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RetentionInDays != nil { + retentionInDays := *typedInput.Properties.RetentionInDays + workspace.RetentionInDays = &retentionInDays + } + } + + // Set property "Sku": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Sku != nil { + var sku1 WorkspaceSku_STATUS + err := sku1.PopulateFromARM(owner, *typedInput.Properties.Sku) + if err != nil { + return err + } + sku := sku1 + workspace.Sku = &sku + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + workspace.SystemData = &systemData + } + + // Set property "Tags": + if typedInput.Tags != nil { + workspace.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + workspace.Tags[key] = value + } + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + workspace.Type = &typeVar + } + + // Set property "WorkspaceCapping": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.WorkspaceCapping != nil { + var workspaceCapping1 WorkspaceCapping_STATUS + err := workspaceCapping1.PopulateFromARM(owner, *typedInput.Properties.WorkspaceCapping) + if err != nil { + return err + } + workspaceCapping := workspaceCapping1 + workspace.WorkspaceCapping = &workspaceCapping + } + } + + // No error + return nil +} + +// AssignProperties_From_Workspace_STATUS populates our Workspace_STATUS from the provided source Workspace_STATUS +func (workspace *Workspace_STATUS) AssignProperties_From_Workspace_STATUS(source *storage.Workspace_STATUS) error { + + // Conditions + workspace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedDate + workspace.CreatedDate = genruntime.ClonePointerToString(source.CreatedDate) + + // CustomerId + workspace.CustomerId = genruntime.ClonePointerToString(source.CustomerId) + + // DefaultDataCollectionRuleResourceId + workspace.DefaultDataCollectionRuleResourceId = genruntime.ClonePointerToString(source.DefaultDataCollectionRuleResourceId) + + // Etag + workspace.Etag = genruntime.ClonePointerToString(source.Etag) + + // Failover + if source.Failover != nil { + var failover WorkspaceFailoverProperties_STATUS + err := failover.AssignProperties_From_WorkspaceFailoverProperties_STATUS(source.Failover) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceFailoverProperties_STATUS() to populate field Failover") + } + workspace.Failover = &failover + } else { + workspace.Failover = nil + } + + // Features + if source.Features != nil { + var feature WorkspaceFeatures_STATUS + err := feature.AssignProperties_From_WorkspaceFeatures_STATUS(source.Features) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceFeatures_STATUS() to populate field Features") + } + workspace.Features = &feature + } else { + workspace.Features = nil + } + + // ForceCmkForQuery + if source.ForceCmkForQuery != nil { + forceCmkForQuery := *source.ForceCmkForQuery + workspace.ForceCmkForQuery = &forceCmkForQuery + } else { + workspace.ForceCmkForQuery = nil + } + + // Id + workspace.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") + } + workspace.Identity = &identity + } else { + workspace.Identity = nil + } + + // Location + workspace.Location = genruntime.ClonePointerToString(source.Location) + + // ModifiedDate + workspace.ModifiedDate = genruntime.ClonePointerToString(source.ModifiedDate) + + // Name + workspace.Name = genruntime.ClonePointerToString(source.Name) + + // PrivateLinkScopedResources + if source.PrivateLinkScopedResources != nil { + privateLinkScopedResourceList := make([]PrivateLinkScopedResource_STATUS, len(source.PrivateLinkScopedResources)) + for privateLinkScopedResourceIndex, privateLinkScopedResourceItem := range source.PrivateLinkScopedResources { + var privateLinkScopedResource PrivateLinkScopedResource_STATUS + err := privateLinkScopedResource.AssignProperties_From_PrivateLinkScopedResource_STATUS(&privateLinkScopedResourceItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkScopedResource_STATUS() to populate field PrivateLinkScopedResources") + } + privateLinkScopedResourceList[privateLinkScopedResourceIndex] = privateLinkScopedResource + } + workspace.PrivateLinkScopedResources = privateLinkScopedResourceList + } else { + workspace.PrivateLinkScopedResources = nil + } + + // ProvisioningState + if source.ProvisioningState != nil { + provisioningState := *source.ProvisioningState + provisioningStateTemp := genruntime.ToEnum(provisioningState, workspaceProperties_ProvisioningState_STATUS_Values) + workspace.ProvisioningState = &provisioningStateTemp + } else { + workspace.ProvisioningState = nil + } + + // PublicNetworkAccessForIngestion + if source.PublicNetworkAccessForIngestion != nil { + publicNetworkAccessForIngestion := *source.PublicNetworkAccessForIngestion + publicNetworkAccessForIngestionTemp := genruntime.ToEnum(publicNetworkAccessForIngestion, publicNetworkAccessType_STATUS_Values) + workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestionTemp + } else { + workspace.PublicNetworkAccessForIngestion = nil + } + + // PublicNetworkAccessForQuery + if source.PublicNetworkAccessForQuery != nil { + publicNetworkAccessForQuery := *source.PublicNetworkAccessForQuery + publicNetworkAccessForQueryTemp := genruntime.ToEnum(publicNetworkAccessForQuery, publicNetworkAccessType_STATUS_Values) + workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQueryTemp + } else { + workspace.PublicNetworkAccessForQuery = nil + } + + // Replication + if source.Replication != nil { + var replication WorkspaceReplicationProperties_STATUS + err := replication.AssignProperties_From_WorkspaceReplicationProperties_STATUS(source.Replication) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceReplicationProperties_STATUS() to populate field Replication") + } + workspace.Replication = &replication + } else { + workspace.Replication = nil + } + + // RetentionInDays + workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays) + + // Sku + if source.Sku != nil { + var sku WorkspaceSku_STATUS + err := sku.AssignProperties_From_WorkspaceSku_STATUS(source.Sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceSku_STATUS() to populate field Sku") + } + workspace.Sku = &sku + } else { + workspace.Sku = 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") + } + workspace.SystemData = &systemDatum + } else { + workspace.SystemData = nil + } + + // Tags + workspace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // Type + workspace.Type = genruntime.ClonePointerToString(source.Type) + + // WorkspaceCapping + if source.WorkspaceCapping != nil { + var workspaceCapping WorkspaceCapping_STATUS + err := workspaceCapping.AssignProperties_From_WorkspaceCapping_STATUS(source.WorkspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceCapping_STATUS() to populate field WorkspaceCapping") + } + workspace.WorkspaceCapping = &workspaceCapping + } else { + workspace.WorkspaceCapping = nil + } + + // No error + return nil +} + +// AssignProperties_To_Workspace_STATUS populates the provided destination Workspace_STATUS from our Workspace_STATUS +func (workspace *Workspace_STATUS) AssignProperties_To_Workspace_STATUS(destination *storage.Workspace_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(workspace.Conditions) + + // CreatedDate + destination.CreatedDate = genruntime.ClonePointerToString(workspace.CreatedDate) + + // CustomerId + destination.CustomerId = genruntime.ClonePointerToString(workspace.CustomerId) + + // DefaultDataCollectionRuleResourceId + destination.DefaultDataCollectionRuleResourceId = genruntime.ClonePointerToString(workspace.DefaultDataCollectionRuleResourceId) + + // Etag + destination.Etag = genruntime.ClonePointerToString(workspace.Etag) + + // Failover + if workspace.Failover != nil { + var failover storage.WorkspaceFailoverProperties_STATUS + err := workspace.Failover.AssignProperties_To_WorkspaceFailoverProperties_STATUS(&failover) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceFailoverProperties_STATUS() to populate field Failover") + } + destination.Failover = &failover + } else { + destination.Failover = nil + } + + // Features + if workspace.Features != nil { + var feature storage.WorkspaceFeatures_STATUS + err := workspace.Features.AssignProperties_To_WorkspaceFeatures_STATUS(&feature) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceFeatures_STATUS() to populate field Features") + } + destination.Features = &feature + } else { + destination.Features = nil + } + + // ForceCmkForQuery + if workspace.ForceCmkForQuery != nil { + forceCmkForQuery := *workspace.ForceCmkForQuery + destination.ForceCmkForQuery = &forceCmkForQuery + } else { + destination.ForceCmkForQuery = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(workspace.Id) + + // Identity + if workspace.Identity != nil { + var identity storage.Identity_STATUS + err := workspace.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(workspace.Location) + + // ModifiedDate + destination.ModifiedDate = genruntime.ClonePointerToString(workspace.ModifiedDate) + + // Name + destination.Name = genruntime.ClonePointerToString(workspace.Name) + + // PrivateLinkScopedResources + if workspace.PrivateLinkScopedResources != nil { + privateLinkScopedResourceList := make([]storage.PrivateLinkScopedResource_STATUS, len(workspace.PrivateLinkScopedResources)) + for privateLinkScopedResourceIndex, privateLinkScopedResourceItem := range workspace.PrivateLinkScopedResources { + var privateLinkScopedResource storage.PrivateLinkScopedResource_STATUS + err := privateLinkScopedResourceItem.AssignProperties_To_PrivateLinkScopedResource_STATUS(&privateLinkScopedResource) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkScopedResource_STATUS() to populate field PrivateLinkScopedResources") + } + privateLinkScopedResourceList[privateLinkScopedResourceIndex] = privateLinkScopedResource + } + destination.PrivateLinkScopedResources = privateLinkScopedResourceList + } else { + destination.PrivateLinkScopedResources = nil + } + + // ProvisioningState + if workspace.ProvisioningState != nil { + provisioningState := string(*workspace.ProvisioningState) + destination.ProvisioningState = &provisioningState + } else { + destination.ProvisioningState = nil + } + + // PublicNetworkAccessForIngestion + if workspace.PublicNetworkAccessForIngestion != nil { + publicNetworkAccessForIngestion := string(*workspace.PublicNetworkAccessForIngestion) + destination.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion + } else { + destination.PublicNetworkAccessForIngestion = nil + } + + // PublicNetworkAccessForQuery + if workspace.PublicNetworkAccessForQuery != nil { + publicNetworkAccessForQuery := string(*workspace.PublicNetworkAccessForQuery) + destination.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery + } else { + destination.PublicNetworkAccessForQuery = nil + } + + // Replication + if workspace.Replication != nil { + var replication storage.WorkspaceReplicationProperties_STATUS + err := workspace.Replication.AssignProperties_To_WorkspaceReplicationProperties_STATUS(&replication) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceReplicationProperties_STATUS() to populate field Replication") + } + destination.Replication = &replication + } else { + destination.Replication = nil + } + + // RetentionInDays + destination.RetentionInDays = genruntime.ClonePointerToInt(workspace.RetentionInDays) + + // Sku + if workspace.Sku != nil { + var sku storage.WorkspaceSku_STATUS + err := workspace.Sku.AssignProperties_To_WorkspaceSku_STATUS(&sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceSku_STATUS() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // SystemData + if workspace.SystemData != nil { + var systemDatum storage.SystemData_STATUS + err := workspace.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(workspace.Tags) + + // Type + destination.Type = genruntime.ClonePointerToString(workspace.Type) + + // WorkspaceCapping + if workspace.WorkspaceCapping != nil { + var workspaceCapping storage.WorkspaceCapping_STATUS + err := workspace.WorkspaceCapping.AssignProperties_To_WorkspaceCapping_STATUS(&workspaceCapping) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceCapping_STATUS() to populate field WorkspaceCapping") + } + destination.WorkspaceCapping = &workspaceCapping + } else { + destination.WorkspaceCapping = 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 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 { + 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 { + 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 +} + +// Initialize_From_Identity_STATUS populates our Identity from the provided source Identity_STATUS +func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error { + + // Type + if source.Type != nil { + typeVar := genruntime.ToEnum(string(*source.Type), identity_Type_Values) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities)) + for userAssignedIdentitiesKey := range source.UserAssignedIdentities { + userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey) + userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef}) + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = 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 { + 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 { + 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 +} + +// The private link scope resource reference. +type PrivateLinkScopedResource_STATUS struct { + // ResourceId: The full resource Id of the private link scope resource. + ResourceId *string `json:"resourceId,omitempty"` + + // ScopeId: The private link scope unique Identifier. + ScopeId *string `json:"scopeId,omitempty"` +} + +var _ genruntime.FromARMConverter = &PrivateLinkScopedResource_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (resource *PrivateLinkScopedResource_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.PrivateLinkScopedResource_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (resource *PrivateLinkScopedResource_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.PrivateLinkScopedResource_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.PrivateLinkScopedResource_STATUS, got %T", armInput) + } + + // Set property "ResourceId": + if typedInput.ResourceId != nil { + resourceId := *typedInput.ResourceId + resource.ResourceId = &resourceId + } + + // Set property "ScopeId": + if typedInput.ScopeId != nil { + scopeId := *typedInput.ScopeId + resource.ScopeId = &scopeId + } + + // No error + return nil +} + +// AssignProperties_From_PrivateLinkScopedResource_STATUS populates our PrivateLinkScopedResource_STATUS from the provided source PrivateLinkScopedResource_STATUS +func (resource *PrivateLinkScopedResource_STATUS) AssignProperties_From_PrivateLinkScopedResource_STATUS(source *storage.PrivateLinkScopedResource_STATUS) error { + + // ResourceId + resource.ResourceId = genruntime.ClonePointerToString(source.ResourceId) + + // ScopeId + resource.ScopeId = genruntime.ClonePointerToString(source.ScopeId) + + // No error + return nil +} + +// AssignProperties_To_PrivateLinkScopedResource_STATUS populates the provided destination PrivateLinkScopedResource_STATUS from our PrivateLinkScopedResource_STATUS +func (resource *PrivateLinkScopedResource_STATUS) AssignProperties_To_PrivateLinkScopedResource_STATUS(destination *storage.PrivateLinkScopedResource_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ResourceId + destination.ResourceId = genruntime.ClonePointerToString(resource.ResourceId) + + // ScopeId + destination.ScopeId = genruntime.ClonePointerToString(resource.ScopeId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// The network access type for operating on the Log Analytics Workspace. By default it is Enabled +// +kubebuilder:validation:Enum={"Disabled","Enabled","SecuredByPerimeter"} +type PublicNetworkAccessType string + +const ( + PublicNetworkAccessType_Disabled = PublicNetworkAccessType("Disabled") + PublicNetworkAccessType_Enabled = PublicNetworkAccessType("Enabled") + PublicNetworkAccessType_SecuredByPerimeter = PublicNetworkAccessType("SecuredByPerimeter") +) + +// Mapping from string to PublicNetworkAccessType +var publicNetworkAccessType_Values = map[string]PublicNetworkAccessType{ + "disabled": PublicNetworkAccessType_Disabled, + "enabled": PublicNetworkAccessType_Enabled, + "securedbyperimeter": PublicNetworkAccessType_SecuredByPerimeter, +} + +// The network access type for operating on the Log Analytics Workspace. By default it is Enabled +type PublicNetworkAccessType_STATUS string + +const ( + PublicNetworkAccessType_STATUS_Disabled = PublicNetworkAccessType_STATUS("Disabled") + PublicNetworkAccessType_STATUS_Enabled = PublicNetworkAccessType_STATUS("Enabled") + PublicNetworkAccessType_STATUS_SecuredByPerimeter = PublicNetworkAccessType_STATUS("SecuredByPerimeter") +) + +// Mapping from string to PublicNetworkAccessType_STATUS +var publicNetworkAccessType_STATUS_Values = map[string]PublicNetworkAccessType_STATUS{ + "disabled": PublicNetworkAccessType_STATUS_Disabled, + "enabled": PublicNetworkAccessType_STATUS_Enabled, + "securedbyperimeter": PublicNetworkAccessType_STATUS_SecuredByPerimeter, +} + +// 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 +} + +// The daily volume cap for ingestion. +type WorkspaceCapping struct { + // DailyQuotaGb: The workspace daily quota for ingestion. + DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"` +} + +var _ genruntime.ARMTransformer = &WorkspaceCapping{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (capping *WorkspaceCapping) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if capping == nil { + return nil, nil + } + result := &arm.WorkspaceCapping{} + + // Set property "DailyQuotaGb": + if capping.DailyQuotaGb != nil { + dailyQuotaGb := *capping.DailyQuotaGb + result.DailyQuotaGb = &dailyQuotaGb + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (capping *WorkspaceCapping) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceCapping{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (capping *WorkspaceCapping) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceCapping) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceCapping, got %T", armInput) + } + + // Set property "DailyQuotaGb": + if typedInput.DailyQuotaGb != nil { + dailyQuotaGb := *typedInput.DailyQuotaGb + capping.DailyQuotaGb = &dailyQuotaGb + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceCapping populates our WorkspaceCapping from the provided source WorkspaceCapping +func (capping *WorkspaceCapping) AssignProperties_From_WorkspaceCapping(source *storage.WorkspaceCapping) error { + + // DailyQuotaGb + if source.DailyQuotaGb != nil { + dailyQuotaGb := *source.DailyQuotaGb + capping.DailyQuotaGb = &dailyQuotaGb + } else { + capping.DailyQuotaGb = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceCapping populates the provided destination WorkspaceCapping from our WorkspaceCapping +func (capping *WorkspaceCapping) AssignProperties_To_WorkspaceCapping(destination *storage.WorkspaceCapping) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // DailyQuotaGb + if capping.DailyQuotaGb != nil { + dailyQuotaGb := *capping.DailyQuotaGb + destination.DailyQuotaGb = &dailyQuotaGb + } else { + destination.DailyQuotaGb = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_WorkspaceCapping_STATUS populates our WorkspaceCapping from the provided source WorkspaceCapping_STATUS +func (capping *WorkspaceCapping) Initialize_From_WorkspaceCapping_STATUS(source *WorkspaceCapping_STATUS) error { + + // DailyQuotaGb + if source.DailyQuotaGb != nil { + dailyQuotaGb := *source.DailyQuotaGb + capping.DailyQuotaGb = &dailyQuotaGb + } else { + capping.DailyQuotaGb = nil + } + + // No error + return nil +} + +// The daily volume cap for ingestion. +type WorkspaceCapping_STATUS struct { + // DailyQuotaGb: The workspace daily quota for ingestion. + DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"` + + // DataIngestionStatus: The status of data ingestion for this workspace. + DataIngestionStatus *WorkspaceCapping_DataIngestionStatus_STATUS `json:"dataIngestionStatus,omitempty"` + + // QuotaNextResetTime: The time when the quota will be rest. + QuotaNextResetTime *string `json:"quotaNextResetTime,omitempty"` +} + +var _ genruntime.FromARMConverter = &WorkspaceCapping_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (capping *WorkspaceCapping_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceCapping_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (capping *WorkspaceCapping_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceCapping_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceCapping_STATUS, got %T", armInput) + } + + // Set property "DailyQuotaGb": + if typedInput.DailyQuotaGb != nil { + dailyQuotaGb := *typedInput.DailyQuotaGb + capping.DailyQuotaGb = &dailyQuotaGb + } + + // Set property "DataIngestionStatus": + if typedInput.DataIngestionStatus != nil { + var temp string + temp = string(*typedInput.DataIngestionStatus) + dataIngestionStatus := WorkspaceCapping_DataIngestionStatus_STATUS(temp) + capping.DataIngestionStatus = &dataIngestionStatus + } + + // Set property "QuotaNextResetTime": + if typedInput.QuotaNextResetTime != nil { + quotaNextResetTime := *typedInput.QuotaNextResetTime + capping.QuotaNextResetTime = "aNextResetTime + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceCapping_STATUS populates our WorkspaceCapping_STATUS from the provided source WorkspaceCapping_STATUS +func (capping *WorkspaceCapping_STATUS) AssignProperties_From_WorkspaceCapping_STATUS(source *storage.WorkspaceCapping_STATUS) error { + + // DailyQuotaGb + if source.DailyQuotaGb != nil { + dailyQuotaGb := *source.DailyQuotaGb + capping.DailyQuotaGb = &dailyQuotaGb + } else { + capping.DailyQuotaGb = nil + } + + // DataIngestionStatus + if source.DataIngestionStatus != nil { + dataIngestionStatus := *source.DataIngestionStatus + dataIngestionStatusTemp := genruntime.ToEnum(dataIngestionStatus, workspaceCapping_DataIngestionStatus_STATUS_Values) + capping.DataIngestionStatus = &dataIngestionStatusTemp + } else { + capping.DataIngestionStatus = nil + } + + // QuotaNextResetTime + capping.QuotaNextResetTime = genruntime.ClonePointerToString(source.QuotaNextResetTime) + + // No error + return nil +} + +// AssignProperties_To_WorkspaceCapping_STATUS populates the provided destination WorkspaceCapping_STATUS from our WorkspaceCapping_STATUS +func (capping *WorkspaceCapping_STATUS) AssignProperties_To_WorkspaceCapping_STATUS(destination *storage.WorkspaceCapping_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // DailyQuotaGb + if capping.DailyQuotaGb != nil { + dailyQuotaGb := *capping.DailyQuotaGb + destination.DailyQuotaGb = &dailyQuotaGb + } else { + destination.DailyQuotaGb = nil + } + + // DataIngestionStatus + if capping.DataIngestionStatus != nil { + dataIngestionStatus := string(*capping.DataIngestionStatus) + destination.DataIngestionStatus = &dataIngestionStatus + } else { + destination.DataIngestionStatus = nil + } + + // QuotaNextResetTime + destination.QuotaNextResetTime = genruntime.ClonePointerToString(capping.QuotaNextResetTime) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// The failover state of the replication. +type WorkspaceFailoverProperties_STATUS struct { + // LastModifiedDate: The last time when the failover state was updated. + LastModifiedDate *string `json:"lastModifiedDate,omitempty"` + + // State: The failover state of the replication. + State *WorkspaceFailoverProperties_State_STATUS `json:"state,omitempty"` +} + +var _ genruntime.FromARMConverter = &WorkspaceFailoverProperties_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *WorkspaceFailoverProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceFailoverProperties_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *WorkspaceFailoverProperties_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceFailoverProperties_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceFailoverProperties_STATUS, got %T", armInput) + } + + // Set property "LastModifiedDate": + if typedInput.LastModifiedDate != nil { + lastModifiedDate := *typedInput.LastModifiedDate + properties.LastModifiedDate = &lastModifiedDate + } + + // Set property "State": + if typedInput.State != nil { + var temp string + temp = string(*typedInput.State) + state := WorkspaceFailoverProperties_State_STATUS(temp) + properties.State = &state + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceFailoverProperties_STATUS populates our WorkspaceFailoverProperties_STATUS from the provided source WorkspaceFailoverProperties_STATUS +func (properties *WorkspaceFailoverProperties_STATUS) AssignProperties_From_WorkspaceFailoverProperties_STATUS(source *storage.WorkspaceFailoverProperties_STATUS) error { + + // LastModifiedDate + properties.LastModifiedDate = genruntime.ClonePointerToString(source.LastModifiedDate) + + // State + if source.State != nil { + state := *source.State + stateTemp := genruntime.ToEnum(state, workspaceFailoverProperties_State_STATUS_Values) + properties.State = &stateTemp + } else { + properties.State = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceFailoverProperties_STATUS populates the provided destination WorkspaceFailoverProperties_STATUS from our WorkspaceFailoverProperties_STATUS +func (properties *WorkspaceFailoverProperties_STATUS) AssignProperties_To_WorkspaceFailoverProperties_STATUS(destination *storage.WorkspaceFailoverProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // LastModifiedDate + destination.LastModifiedDate = genruntime.ClonePointerToString(properties.LastModifiedDate) + + // State + if properties.State != nil { + state := string(*properties.State) + destination.State = &state + } else { + destination.State = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Workspace features. +type WorkspaceFeatures struct { + // ClusterResourceReference: Dedicated LA cluster resourceId that is linked to the workspaces. + ClusterResourceReference *genruntime.ResourceReference `armReference:"ClusterResourceId" json:"clusterResourceReference,omitempty"` + + // DisableLocalAuth: Disable Non-AAD based Auth. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // EnableDataExport: Flag that indicate if data should be exported. + EnableDataExport *bool `json:"enableDataExport,omitempty"` + + // EnableLogAccessUsingOnlyResourcePermissions: Flag that indicate which permission to use - resource or workspace or both. + EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"` + + // ImmediatePurgeDataOn30Days: Flag that describes if we want to remove the data after 30 days. + ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"` +} + +var _ genruntime.ARMTransformer = &WorkspaceFeatures{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (features *WorkspaceFeatures) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if features == nil { + return nil, nil + } + result := &arm.WorkspaceFeatures{} + + // Set property "ClusterResourceId": + if features.ClusterResourceReference != nil { + clusterResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*features.ClusterResourceReference) + if err != nil { + return nil, err + } + clusterResourceReference := clusterResourceReferenceARMID + result.ClusterResourceId = &clusterResourceReference + } + + // Set property "DisableLocalAuth": + if features.DisableLocalAuth != nil { + disableLocalAuth := *features.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property "EnableDataExport": + if features.EnableDataExport != nil { + enableDataExport := *features.EnableDataExport + result.EnableDataExport = &enableDataExport + } + + // Set property "EnableLogAccessUsingOnlyResourcePermissions": + if features.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermissions := *features.EnableLogAccessUsingOnlyResourcePermissions + result.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermissions + } + + // Set property "ImmediatePurgeDataOn30Days": + if features.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Days := *features.ImmediatePurgeDataOn30Days + result.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Days + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (features *WorkspaceFeatures) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceFeatures{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (features *WorkspaceFeatures) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceFeatures) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceFeatures, got %T", armInput) + } + + // no assignment for property "ClusterResourceReference" + + // Set property "DisableLocalAuth": + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + features.DisableLocalAuth = &disableLocalAuth + } + + // Set property "EnableDataExport": + if typedInput.EnableDataExport != nil { + enableDataExport := *typedInput.EnableDataExport + features.EnableDataExport = &enableDataExport + } + + // Set property "EnableLogAccessUsingOnlyResourcePermissions": + if typedInput.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermissions := *typedInput.EnableLogAccessUsingOnlyResourcePermissions + features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermissions + } + + // Set property "ImmediatePurgeDataOn30Days": + if typedInput.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Days := *typedInput.ImmediatePurgeDataOn30Days + features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Days + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceFeatures populates our WorkspaceFeatures from the provided source WorkspaceFeatures +func (features *WorkspaceFeatures) AssignProperties_From_WorkspaceFeatures(source *storage.WorkspaceFeatures) error { + + // ClusterResourceReference + if source.ClusterResourceReference != nil { + clusterResourceReference := source.ClusterResourceReference.Copy() + features.ClusterResourceReference = &clusterResourceReference + } else { + features.ClusterResourceReference = nil + } + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + features.DisableLocalAuth = &disableLocalAuth + } else { + features.DisableLocalAuth = nil + } + + // EnableDataExport + if source.EnableDataExport != nil { + enableDataExport := *source.EnableDataExport + features.EnableDataExport = &enableDataExport + } else { + features.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if source.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions + features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + features.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if source.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days + features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + features.ImmediatePurgeDataOn30Days = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceFeatures populates the provided destination WorkspaceFeatures from our WorkspaceFeatures +func (features *WorkspaceFeatures) AssignProperties_To_WorkspaceFeatures(destination *storage.WorkspaceFeatures) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ClusterResourceReference + if features.ClusterResourceReference != nil { + clusterResourceReference := features.ClusterResourceReference.Copy() + destination.ClusterResourceReference = &clusterResourceReference + } else { + destination.ClusterResourceReference = nil + } + + // DisableLocalAuth + if features.DisableLocalAuth != nil { + disableLocalAuth := *features.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // EnableDataExport + if features.EnableDataExport != nil { + enableDataExport := *features.EnableDataExport + destination.EnableDataExport = &enableDataExport + } else { + destination.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if features.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *features.EnableLogAccessUsingOnlyResourcePermissions + destination.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + destination.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if features.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *features.ImmediatePurgeDataOn30Days + destination.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + destination.ImmediatePurgeDataOn30Days = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_WorkspaceFeatures_STATUS populates our WorkspaceFeatures from the provided source WorkspaceFeatures_STATUS +func (features *WorkspaceFeatures) Initialize_From_WorkspaceFeatures_STATUS(source *WorkspaceFeatures_STATUS) error { + + // ClusterResourceReference + if source.ClusterResourceId != nil { + clusterResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterResourceId) + features.ClusterResourceReference = &clusterResourceReference + } else { + features.ClusterResourceReference = nil + } + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + features.DisableLocalAuth = &disableLocalAuth + } else { + features.DisableLocalAuth = nil + } + + // EnableDataExport + if source.EnableDataExport != nil { + enableDataExport := *source.EnableDataExport + features.EnableDataExport = &enableDataExport + } else { + features.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if source.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions + features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + features.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if source.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days + features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + features.ImmediatePurgeDataOn30Days = nil + } + + // No error + return nil +} + +// Workspace features. +type WorkspaceFeatures_STATUS struct { + // Associations: List of associations for the workspace. Indicates if the workspace is associated with any of the following + // experiences: MDC, Sentinel, SentinelGraph, etc. + Associations []string `json:"associations,omitempty"` + + // ClusterResourceId: Dedicated LA cluster resourceId that is linked to the workspaces. + ClusterResourceId *string `json:"clusterResourceId,omitempty"` + + // DisableLocalAuth: Disable Non-AAD based Auth. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // EnableDataExport: Flag that indicate if data should be exported. + EnableDataExport *bool `json:"enableDataExport,omitempty"` + + // EnableLogAccessUsingOnlyResourcePermissions: Flag that indicate which permission to use - resource or workspace or both. + EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"` + + // ImmediatePurgeDataOn30Days: Flag that describes if we want to remove the data after 30 days. + ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"` + + // UnifiedSentinelBillingOnly: An indication if the specify workspace is limited to sentinel's unified billing model only. + UnifiedSentinelBillingOnly *bool `json:"unifiedSentinelBillingOnly,omitempty"` +} + +var _ genruntime.FromARMConverter = &WorkspaceFeatures_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (features *WorkspaceFeatures_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceFeatures_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (features *WorkspaceFeatures_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceFeatures_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceFeatures_STATUS, got %T", armInput) + } + + // Set property "Associations": + for _, item := range typedInput.Associations { + features.Associations = append(features.Associations, item) + } + + // Set property "ClusterResourceId": + if typedInput.ClusterResourceId != nil { + clusterResourceId := *typedInput.ClusterResourceId + features.ClusterResourceId = &clusterResourceId + } + + // Set property "DisableLocalAuth": + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + features.DisableLocalAuth = &disableLocalAuth + } + + // Set property "EnableDataExport": + if typedInput.EnableDataExport != nil { + enableDataExport := *typedInput.EnableDataExport + features.EnableDataExport = &enableDataExport + } + + // Set property "EnableLogAccessUsingOnlyResourcePermissions": + if typedInput.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermissions := *typedInput.EnableLogAccessUsingOnlyResourcePermissions + features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermissions + } + + // Set property "ImmediatePurgeDataOn30Days": + if typedInput.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Days := *typedInput.ImmediatePurgeDataOn30Days + features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Days + } + + // Set property "UnifiedSentinelBillingOnly": + if typedInput.UnifiedSentinelBillingOnly != nil { + unifiedSentinelBillingOnly := *typedInput.UnifiedSentinelBillingOnly + features.UnifiedSentinelBillingOnly = &unifiedSentinelBillingOnly + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceFeatures_STATUS populates our WorkspaceFeatures_STATUS from the provided source WorkspaceFeatures_STATUS +func (features *WorkspaceFeatures_STATUS) AssignProperties_From_WorkspaceFeatures_STATUS(source *storage.WorkspaceFeatures_STATUS) error { + + // Associations + features.Associations = genruntime.CloneSliceOfString(source.Associations) + + // ClusterResourceId + features.ClusterResourceId = genruntime.ClonePointerToString(source.ClusterResourceId) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + features.DisableLocalAuth = &disableLocalAuth + } else { + features.DisableLocalAuth = nil + } + + // EnableDataExport + if source.EnableDataExport != nil { + enableDataExport := *source.EnableDataExport + features.EnableDataExport = &enableDataExport + } else { + features.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if source.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions + features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + features.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if source.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days + features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + features.ImmediatePurgeDataOn30Days = nil + } + + // UnifiedSentinelBillingOnly + if source.UnifiedSentinelBillingOnly != nil { + unifiedSentinelBillingOnly := *source.UnifiedSentinelBillingOnly + features.UnifiedSentinelBillingOnly = &unifiedSentinelBillingOnly + } else { + features.UnifiedSentinelBillingOnly = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceFeatures_STATUS populates the provided destination WorkspaceFeatures_STATUS from our WorkspaceFeatures_STATUS +func (features *WorkspaceFeatures_STATUS) AssignProperties_To_WorkspaceFeatures_STATUS(destination *storage.WorkspaceFeatures_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Associations + destination.Associations = genruntime.CloneSliceOfString(features.Associations) + + // ClusterResourceId + destination.ClusterResourceId = genruntime.ClonePointerToString(features.ClusterResourceId) + + // DisableLocalAuth + if features.DisableLocalAuth != nil { + disableLocalAuth := *features.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // EnableDataExport + if features.EnableDataExport != nil { + enableDataExport := *features.EnableDataExport + destination.EnableDataExport = &enableDataExport + } else { + destination.EnableDataExport = nil + } + + // EnableLogAccessUsingOnlyResourcePermissions + if features.EnableLogAccessUsingOnlyResourcePermissions != nil { + enableLogAccessUsingOnlyResourcePermission := *features.EnableLogAccessUsingOnlyResourcePermissions + destination.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission + } else { + destination.EnableLogAccessUsingOnlyResourcePermissions = nil + } + + // ImmediatePurgeDataOn30Days + if features.ImmediatePurgeDataOn30Days != nil { + immediatePurgeDataOn30Day := *features.ImmediatePurgeDataOn30Days + destination.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day + } else { + destination.ImmediatePurgeDataOn30Days = nil + } + + // UnifiedSentinelBillingOnly + if features.UnifiedSentinelBillingOnly != nil { + unifiedSentinelBillingOnly := *features.UnifiedSentinelBillingOnly + destination.UnifiedSentinelBillingOnly = &unifiedSentinelBillingOnly + } else { + destination.UnifiedSentinelBillingOnly = 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 WorkspaceOperatorSpec 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"` + + // Secrets: configures where to place Azure generated secrets. + Secrets *WorkspaceOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_WorkspaceOperatorSpec populates our WorkspaceOperatorSpec from the provided source WorkspaceOperatorSpec +func (operator *WorkspaceOperatorSpec) AssignProperties_From_WorkspaceOperatorSpec(source *storage.WorkspaceOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + 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 { + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Secrets + if source.Secrets != nil { + var secret WorkspaceOperatorSecrets + err := secret.AssignProperties_From_WorkspaceOperatorSecrets(source.Secrets) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_WorkspaceOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceOperatorSpec populates the provided destination WorkspaceOperatorSpec from our WorkspaceOperatorSpec +func (operator *WorkspaceOperatorSpec) AssignProperties_To_WorkspaceOperatorSpec(destination *storage.WorkspaceOperatorSpec) 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 { + 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 { + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Secrets + if operator.Secrets != nil { + var secret storage.WorkspaceOperatorSecrets + err := operator.Secrets.AssignProperties_To_WorkspaceOperatorSecrets(&secret) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_WorkspaceOperatorSecrets() to populate field Secrets") + } + destination.Secrets = &secret + } else { + destination.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type WorkspaceProperties_ProvisioningState_STATUS string + +const ( + WorkspaceProperties_ProvisioningState_STATUS_Canceled = WorkspaceProperties_ProvisioningState_STATUS("Canceled") + WorkspaceProperties_ProvisioningState_STATUS_Creating = WorkspaceProperties_ProvisioningState_STATUS("Creating") + WorkspaceProperties_ProvisioningState_STATUS_Deleting = WorkspaceProperties_ProvisioningState_STATUS("Deleting") + WorkspaceProperties_ProvisioningState_STATUS_Failed = WorkspaceProperties_ProvisioningState_STATUS("Failed") + WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount = WorkspaceProperties_ProvisioningState_STATUS("ProvisioningAccount") + WorkspaceProperties_ProvisioningState_STATUS_Succeeded = WorkspaceProperties_ProvisioningState_STATUS("Succeeded") + WorkspaceProperties_ProvisioningState_STATUS_Updating = WorkspaceProperties_ProvisioningState_STATUS("Updating") +) + +// Mapping from string to WorkspaceProperties_ProvisioningState_STATUS +var workspaceProperties_ProvisioningState_STATUS_Values = map[string]WorkspaceProperties_ProvisioningState_STATUS{ + "canceled": WorkspaceProperties_ProvisioningState_STATUS_Canceled, + "creating": WorkspaceProperties_ProvisioningState_STATUS_Creating, + "deleting": WorkspaceProperties_ProvisioningState_STATUS_Deleting, + "failed": WorkspaceProperties_ProvisioningState_STATUS_Failed, + "provisioningaccount": WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount, + "succeeded": WorkspaceProperties_ProvisioningState_STATUS_Succeeded, + "updating": WorkspaceProperties_ProvisioningState_STATUS_Updating, +} + +// Workspace replication properties. +type WorkspaceReplicationProperties struct { + // Enabled: Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated + // to the specified location. If replication is been enabled, location must be provided. + Enabled *bool `json:"enabled,omitempty"` + + // Location: The location of the replication. + Location *string `json:"location,omitempty"` +} + +var _ genruntime.ARMTransformer = &WorkspaceReplicationProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *WorkspaceReplicationProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &arm.WorkspaceReplicationProperties{} + + // Set property "Enabled": + if properties.Enabled != nil { + enabled := *properties.Enabled + result.Enabled = &enabled + } + + // Set property "Location": + if properties.Location != nil { + location := *properties.Location + result.Location = &location + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *WorkspaceReplicationProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceReplicationProperties{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *WorkspaceReplicationProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceReplicationProperties) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceReplicationProperties, got %T", armInput) + } + + // Set property "Enabled": + if typedInput.Enabled != nil { + enabled := *typedInput.Enabled + properties.Enabled = &enabled + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + properties.Location = &location + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceReplicationProperties populates our WorkspaceReplicationProperties from the provided source WorkspaceReplicationProperties +func (properties *WorkspaceReplicationProperties) AssignProperties_From_WorkspaceReplicationProperties(source *storage.WorkspaceReplicationProperties) error { + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + properties.Enabled = &enabled + } else { + properties.Enabled = nil + } + + // Location + properties.Location = genruntime.ClonePointerToString(source.Location) + + // No error + return nil +} + +// AssignProperties_To_WorkspaceReplicationProperties populates the provided destination WorkspaceReplicationProperties from our WorkspaceReplicationProperties +func (properties *WorkspaceReplicationProperties) AssignProperties_To_WorkspaceReplicationProperties(destination *storage.WorkspaceReplicationProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Enabled + if properties.Enabled != nil { + enabled := *properties.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(properties.Location) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_WorkspaceReplicationProperties_STATUS populates our WorkspaceReplicationProperties from the provided source WorkspaceReplicationProperties_STATUS +func (properties *WorkspaceReplicationProperties) Initialize_From_WorkspaceReplicationProperties_STATUS(source *WorkspaceReplicationProperties_STATUS) error { + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + properties.Enabled = &enabled + } else { + properties.Enabled = nil + } + + // Location + properties.Location = genruntime.ClonePointerToString(source.Location) + + // No error + return nil +} + +// Workspace replication properties. +type WorkspaceReplicationProperties_STATUS struct { + // CreatedDate: The last time when the replication was enabled. + CreatedDate *string `json:"createdDate,omitempty"` + + // Enabled: Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated + // to the specified location. If replication is been enabled, location must be provided. + Enabled *bool `json:"enabled,omitempty"` + + // LastModifiedDate: The last time when the replication was updated. + LastModifiedDate *string `json:"lastModifiedDate,omitempty"` + + // Location: The location of the replication. + Location *string `json:"location,omitempty"` + + // ProvisioningState: The provisioning state of the replication. + ProvisioningState *WorkspaceReplicationProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"` +} + +var _ genruntime.FromARMConverter = &WorkspaceReplicationProperties_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *WorkspaceReplicationProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceReplicationProperties_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *WorkspaceReplicationProperties_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceReplicationProperties_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceReplicationProperties_STATUS, got %T", armInput) + } + + // Set property "CreatedDate": + if typedInput.CreatedDate != nil { + createdDate := *typedInput.CreatedDate + properties.CreatedDate = &createdDate + } + + // Set property "Enabled": + if typedInput.Enabled != nil { + enabled := *typedInput.Enabled + properties.Enabled = &enabled + } + + // Set property "LastModifiedDate": + if typedInput.LastModifiedDate != nil { + lastModifiedDate := *typedInput.LastModifiedDate + properties.LastModifiedDate = &lastModifiedDate + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + properties.Location = &location + } + + // Set property "ProvisioningState": + if typedInput.ProvisioningState != nil { + var temp string + temp = string(*typedInput.ProvisioningState) + provisioningState := WorkspaceReplicationProperties_ProvisioningState_STATUS(temp) + properties.ProvisioningState = &provisioningState + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceReplicationProperties_STATUS populates our WorkspaceReplicationProperties_STATUS from the provided source WorkspaceReplicationProperties_STATUS +func (properties *WorkspaceReplicationProperties_STATUS) AssignProperties_From_WorkspaceReplicationProperties_STATUS(source *storage.WorkspaceReplicationProperties_STATUS) error { + + // CreatedDate + properties.CreatedDate = genruntime.ClonePointerToString(source.CreatedDate) + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + properties.Enabled = &enabled + } else { + properties.Enabled = nil + } + + // LastModifiedDate + properties.LastModifiedDate = genruntime.ClonePointerToString(source.LastModifiedDate) + + // Location + properties.Location = genruntime.ClonePointerToString(source.Location) + + // ProvisioningState + if source.ProvisioningState != nil { + provisioningState := *source.ProvisioningState + provisioningStateTemp := genruntime.ToEnum(provisioningState, workspaceReplicationProperties_ProvisioningState_STATUS_Values) + properties.ProvisioningState = &provisioningStateTemp + } else { + properties.ProvisioningState = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceReplicationProperties_STATUS populates the provided destination WorkspaceReplicationProperties_STATUS from our WorkspaceReplicationProperties_STATUS +func (properties *WorkspaceReplicationProperties_STATUS) AssignProperties_To_WorkspaceReplicationProperties_STATUS(destination *storage.WorkspaceReplicationProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CreatedDate + destination.CreatedDate = genruntime.ClonePointerToString(properties.CreatedDate) + + // Enabled + if properties.Enabled != nil { + enabled := *properties.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // LastModifiedDate + destination.LastModifiedDate = genruntime.ClonePointerToString(properties.LastModifiedDate) + + // Location + destination.Location = genruntime.ClonePointerToString(properties.Location) + + // ProvisioningState + if properties.ProvisioningState != nil { + provisioningState := string(*properties.ProvisioningState) + destination.ProvisioningState = &provisioningState + } else { + destination.ProvisioningState = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// The SKU (tier) of a workspace. +type WorkspaceSku struct { + // CapacityReservationLevel: The capacity reservation level in GB for this workspace, when CapacityReservation sku is + // selected. + CapacityReservationLevel *int `json:"capacityReservationLevel,omitempty"` + + // +kubebuilder:validation:Required + // Name: The name of the SKU. + Name *WorkspaceSku_Name `json:"name,omitempty"` +} + +var _ genruntime.ARMTransformer = &WorkspaceSku{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (workspaceSku *WorkspaceSku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if workspaceSku == nil { + return nil, nil + } + result := &arm.WorkspaceSku{} + + // Set property "CapacityReservationLevel": + if workspaceSku.CapacityReservationLevel != nil { + capacityReservationLevel := *workspaceSku.CapacityReservationLevel + result.CapacityReservationLevel = &capacityReservationLevel + } + + // Set property "Name": + if workspaceSku.Name != nil { + var temp string + temp = string(*workspaceSku.Name) + name := arm.WorkspaceSku_Name(temp) + result.Name = &name + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (workspaceSku *WorkspaceSku) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceSku{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (workspaceSku *WorkspaceSku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceSku) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceSku, got %T", armInput) + } + + // Set property "CapacityReservationLevel": + if typedInput.CapacityReservationLevel != nil { + capacityReservationLevel := *typedInput.CapacityReservationLevel + workspaceSku.CapacityReservationLevel = &capacityReservationLevel + } + + // Set property "Name": + if typedInput.Name != nil { + var temp string + temp = string(*typedInput.Name) + name := WorkspaceSku_Name(temp) + workspaceSku.Name = &name + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceSku populates our WorkspaceSku from the provided source WorkspaceSku +func (workspaceSku *WorkspaceSku) AssignProperties_From_WorkspaceSku(source *storage.WorkspaceSku) error { + + // CapacityReservationLevel + workspaceSku.CapacityReservationLevel = genruntime.ClonePointerToInt(source.CapacityReservationLevel) + + // Name + if source.Name != nil { + name := *source.Name + nameTemp := genruntime.ToEnum(name, workspaceSku_Name_Values) + workspaceSku.Name = &nameTemp + } else { + workspaceSku.Name = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceSku populates the provided destination WorkspaceSku from our WorkspaceSku +func (workspaceSku *WorkspaceSku) AssignProperties_To_WorkspaceSku(destination *storage.WorkspaceSku) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CapacityReservationLevel + destination.CapacityReservationLevel = genruntime.ClonePointerToInt(workspaceSku.CapacityReservationLevel) + + // Name + if workspaceSku.Name != nil { + name := string(*workspaceSku.Name) + destination.Name = &name + } else { + destination.Name = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_WorkspaceSku_STATUS populates our WorkspaceSku from the provided source WorkspaceSku_STATUS +func (workspaceSku *WorkspaceSku) Initialize_From_WorkspaceSku_STATUS(source *WorkspaceSku_STATUS) error { + + // CapacityReservationLevel + workspaceSku.CapacityReservationLevel = genruntime.ClonePointerToInt(source.CapacityReservationLevel) + + // Name + if source.Name != nil { + name := genruntime.ToEnum(string(*source.Name), workspaceSku_Name_Values) + workspaceSku.Name = &name + } else { + workspaceSku.Name = nil + } + + // No error + return nil +} + +// The SKU (tier) of a workspace. +type WorkspaceSku_STATUS struct { + // CapacityReservationLevel: The capacity reservation level in GB for this workspace, when CapacityReservation sku is + // selected. + CapacityReservationLevel *int `json:"capacityReservationLevel,omitempty"` + + // LastSkuUpdate: The last time when the sku was updated. + LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"` + + // Name: The name of the SKU. + Name *WorkspaceSku_Name_STATUS `json:"name,omitempty"` +} + +var _ genruntime.FromARMConverter = &WorkspaceSku_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (workspaceSku *WorkspaceSku_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.WorkspaceSku_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (workspaceSku *WorkspaceSku_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.WorkspaceSku_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.WorkspaceSku_STATUS, got %T", armInput) + } + + // Set property "CapacityReservationLevel": + if typedInput.CapacityReservationLevel != nil { + capacityReservationLevel := *typedInput.CapacityReservationLevel + workspaceSku.CapacityReservationLevel = &capacityReservationLevel + } + + // Set property "LastSkuUpdate": + if typedInput.LastSkuUpdate != nil { + lastSkuUpdate := *typedInput.LastSkuUpdate + workspaceSku.LastSkuUpdate = &lastSkuUpdate + } + + // Set property "Name": + if typedInput.Name != nil { + var temp string + temp = string(*typedInput.Name) + name := WorkspaceSku_Name_STATUS(temp) + workspaceSku.Name = &name + } + + // No error + return nil +} + +// AssignProperties_From_WorkspaceSku_STATUS populates our WorkspaceSku_STATUS from the provided source WorkspaceSku_STATUS +func (workspaceSku *WorkspaceSku_STATUS) AssignProperties_From_WorkspaceSku_STATUS(source *storage.WorkspaceSku_STATUS) error { + + // CapacityReservationLevel + workspaceSku.CapacityReservationLevel = genruntime.ClonePointerToInt(source.CapacityReservationLevel) + + // LastSkuUpdate + workspaceSku.LastSkuUpdate = genruntime.ClonePointerToString(source.LastSkuUpdate) + + // Name + if source.Name != nil { + name := *source.Name + nameTemp := genruntime.ToEnum(name, workspaceSku_Name_STATUS_Values) + workspaceSku.Name = &nameTemp + } else { + workspaceSku.Name = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceSku_STATUS populates the provided destination WorkspaceSku_STATUS from our WorkspaceSku_STATUS +func (workspaceSku *WorkspaceSku_STATUS) AssignProperties_To_WorkspaceSku_STATUS(destination *storage.WorkspaceSku_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CapacityReservationLevel + destination.CapacityReservationLevel = genruntime.ClonePointerToInt(workspaceSku.CapacityReservationLevel) + + // LastSkuUpdate + destination.LastSkuUpdate = genruntime.ClonePointerToString(workspaceSku.LastSkuUpdate) + + // Name + if workspaceSku.Name != nil { + name := string(*workspaceSku.Name) + destination.Name = &name + } else { + destination.Name = 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 +} + +type WorkspaceCapping_DataIngestionStatus_STATUS string + +const ( + WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota = WorkspaceCapping_DataIngestionStatus_STATUS("ApproachingQuota") + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff = WorkspaceCapping_DataIngestionStatus_STATUS("ForceOff") + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn = WorkspaceCapping_DataIngestionStatus_STATUS("ForceOn") + WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota = WorkspaceCapping_DataIngestionStatus_STATUS("OverQuota") + WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota = WorkspaceCapping_DataIngestionStatus_STATUS("RespectQuota") + WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended = WorkspaceCapping_DataIngestionStatus_STATUS("SubscriptionSuspended") +) + +// Mapping from string to WorkspaceCapping_DataIngestionStatus_STATUS +var workspaceCapping_DataIngestionStatus_STATUS_Values = map[string]WorkspaceCapping_DataIngestionStatus_STATUS{ + "approachingquota": WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota, + "forceoff": WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff, + "forceon": WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn, + "overquota": WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota, + "respectquota": WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota, + "subscriptionsuspended": WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended, +} + +type WorkspaceFailoverProperties_State_STATUS string + +const ( + WorkspaceFailoverProperties_State_STATUS_Activating = WorkspaceFailoverProperties_State_STATUS("Activating") + WorkspaceFailoverProperties_State_STATUS_Active = WorkspaceFailoverProperties_State_STATUS("Active") + WorkspaceFailoverProperties_State_STATUS_Deactivating = WorkspaceFailoverProperties_State_STATUS("Deactivating") + WorkspaceFailoverProperties_State_STATUS_Failed = WorkspaceFailoverProperties_State_STATUS("Failed") + WorkspaceFailoverProperties_State_STATUS_Inactive = WorkspaceFailoverProperties_State_STATUS("Inactive") +) + +// Mapping from string to WorkspaceFailoverProperties_State_STATUS +var workspaceFailoverProperties_State_STATUS_Values = map[string]WorkspaceFailoverProperties_State_STATUS{ + "activating": WorkspaceFailoverProperties_State_STATUS_Activating, + "active": WorkspaceFailoverProperties_State_STATUS_Active, + "deactivating": WorkspaceFailoverProperties_State_STATUS_Deactivating, + "failed": WorkspaceFailoverProperties_State_STATUS_Failed, + "inactive": WorkspaceFailoverProperties_State_STATUS_Inactive, +} + +type WorkspaceOperatorSecrets struct { + // PrimarySharedKey: indicates where the PrimarySharedKey secret should be placed. If omitted, the secret will not be + // retrieved from Azure. + PrimarySharedKey *genruntime.SecretDestination `json:"primarySharedKey,omitempty"` + + // SecondarySharedKey: indicates where the SecondarySharedKey secret should be placed. If omitted, the secret will not be + // retrieved from Azure. + SecondarySharedKey *genruntime.SecretDestination `json:"secondarySharedKey,omitempty"` +} + +// AssignProperties_From_WorkspaceOperatorSecrets populates our WorkspaceOperatorSecrets from the provided source WorkspaceOperatorSecrets +func (secrets *WorkspaceOperatorSecrets) AssignProperties_From_WorkspaceOperatorSecrets(source *storage.WorkspaceOperatorSecrets) error { + + // PrimarySharedKey + if source.PrimarySharedKey != nil { + primarySharedKey := source.PrimarySharedKey.Copy() + secrets.PrimarySharedKey = &primarySharedKey + } else { + secrets.PrimarySharedKey = nil + } + + // SecondarySharedKey + if source.SecondarySharedKey != nil { + secondarySharedKey := source.SecondarySharedKey.Copy() + secrets.SecondarySharedKey = &secondarySharedKey + } else { + secrets.SecondarySharedKey = nil + } + + // No error + return nil +} + +// AssignProperties_To_WorkspaceOperatorSecrets populates the provided destination WorkspaceOperatorSecrets from our WorkspaceOperatorSecrets +func (secrets *WorkspaceOperatorSecrets) AssignProperties_To_WorkspaceOperatorSecrets(destination *storage.WorkspaceOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrimarySharedKey + if secrets.PrimarySharedKey != nil { + primarySharedKey := secrets.PrimarySharedKey.Copy() + destination.PrimarySharedKey = &primarySharedKey + } else { + destination.PrimarySharedKey = nil + } + + // SecondarySharedKey + if secrets.SecondarySharedKey != nil { + secondarySharedKey := secrets.SecondarySharedKey.Copy() + destination.SecondarySharedKey = &secondarySharedKey + } else { + destination.SecondarySharedKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type WorkspaceReplicationProperties_ProvisioningState_STATUS string + +const ( + WorkspaceReplicationProperties_ProvisioningState_STATUS_Canceled = WorkspaceReplicationProperties_ProvisioningState_STATUS("Canceled") + WorkspaceReplicationProperties_ProvisioningState_STATUS_DisableRequested = WorkspaceReplicationProperties_ProvisioningState_STATUS("DisableRequested") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Disabling = WorkspaceReplicationProperties_ProvisioningState_STATUS("Disabling") + WorkspaceReplicationProperties_ProvisioningState_STATUS_EnableRequested = WorkspaceReplicationProperties_ProvisioningState_STATUS("EnableRequested") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Enabling = WorkspaceReplicationProperties_ProvisioningState_STATUS("Enabling") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Failed = WorkspaceReplicationProperties_ProvisioningState_STATUS("Failed") + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollbackRequested = WorkspaceReplicationProperties_ProvisioningState_STATUS("RollbackRequested") + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollingBack = WorkspaceReplicationProperties_ProvisioningState_STATUS("RollingBack") + WorkspaceReplicationProperties_ProvisioningState_STATUS_Succeeded = WorkspaceReplicationProperties_ProvisioningState_STATUS("Succeeded") +) + +// Mapping from string to WorkspaceReplicationProperties_ProvisioningState_STATUS +var workspaceReplicationProperties_ProvisioningState_STATUS_Values = map[string]WorkspaceReplicationProperties_ProvisioningState_STATUS{ + "canceled": WorkspaceReplicationProperties_ProvisioningState_STATUS_Canceled, + "disablerequested": WorkspaceReplicationProperties_ProvisioningState_STATUS_DisableRequested, + "disabling": WorkspaceReplicationProperties_ProvisioningState_STATUS_Disabling, + "enablerequested": WorkspaceReplicationProperties_ProvisioningState_STATUS_EnableRequested, + "enabling": WorkspaceReplicationProperties_ProvisioningState_STATUS_Enabling, + "failed": WorkspaceReplicationProperties_ProvisioningState_STATUS_Failed, + "rollbackrequested": WorkspaceReplicationProperties_ProvisioningState_STATUS_RollbackRequested, + "rollingback": WorkspaceReplicationProperties_ProvisioningState_STATUS_RollingBack, + "succeeded": WorkspaceReplicationProperties_ProvisioningState_STATUS_Succeeded, +} + +// +kubebuilder:validation:Enum={"CapacityReservation","Free","LACluster","PerGB2018","PerNode","Premium","Standalone","Standard"} +type WorkspaceSku_Name string + +const ( + WorkspaceSku_Name_CapacityReservation = WorkspaceSku_Name("CapacityReservation") + WorkspaceSku_Name_Free = WorkspaceSku_Name("Free") + WorkspaceSku_Name_LACluster = WorkspaceSku_Name("LACluster") + WorkspaceSku_Name_PerGB2018 = WorkspaceSku_Name("PerGB2018") + WorkspaceSku_Name_PerNode = WorkspaceSku_Name("PerNode") + WorkspaceSku_Name_Premium = WorkspaceSku_Name("Premium") + WorkspaceSku_Name_Standalone = WorkspaceSku_Name("Standalone") + WorkspaceSku_Name_Standard = WorkspaceSku_Name("Standard") +) + +// Mapping from string to WorkspaceSku_Name +var workspaceSku_Name_Values = map[string]WorkspaceSku_Name{ + "capacityreservation": WorkspaceSku_Name_CapacityReservation, + "free": WorkspaceSku_Name_Free, + "lacluster": WorkspaceSku_Name_LACluster, + "pergb2018": WorkspaceSku_Name_PerGB2018, + "pernode": WorkspaceSku_Name_PerNode, + "premium": WorkspaceSku_Name_Premium, + "standalone": WorkspaceSku_Name_Standalone, + "standard": WorkspaceSku_Name_Standard, +} + +type WorkspaceSku_Name_STATUS string + +const ( + WorkspaceSku_Name_STATUS_CapacityReservation = WorkspaceSku_Name_STATUS("CapacityReservation") + WorkspaceSku_Name_STATUS_Free = WorkspaceSku_Name_STATUS("Free") + WorkspaceSku_Name_STATUS_LACluster = WorkspaceSku_Name_STATUS("LACluster") + WorkspaceSku_Name_STATUS_PerGB2018 = WorkspaceSku_Name_STATUS("PerGB2018") + WorkspaceSku_Name_STATUS_PerNode = WorkspaceSku_Name_STATUS("PerNode") + WorkspaceSku_Name_STATUS_Premium = WorkspaceSku_Name_STATUS("Premium") + WorkspaceSku_Name_STATUS_Standalone = WorkspaceSku_Name_STATUS("Standalone") + WorkspaceSku_Name_STATUS_Standard = WorkspaceSku_Name_STATUS("Standard") +) + +// Mapping from string to WorkspaceSku_Name_STATUS +var workspaceSku_Name_STATUS_Values = map[string]WorkspaceSku_Name_STATUS{ + "capacityreservation": WorkspaceSku_Name_STATUS_CapacityReservation, + "free": WorkspaceSku_Name_STATUS_Free, + "lacluster": WorkspaceSku_Name_STATUS_LACluster, + "pergb2018": WorkspaceSku_Name_STATUS_PerGB2018, + "pernode": WorkspaceSku_Name_STATUS_PerNode, + "premium": WorkspaceSku_Name_STATUS_Premium, + "standalone": WorkspaceSku_Name_STATUS_Standalone, + "standard": WorkspaceSku_Name_STATUS_Standard, +} + +func init() { + SchemeBuilder.Register(&Workspace{}, &WorkspaceList{}) +} diff --git a/v2/api/operationalinsights/v1api20250701/workspace_types_gen_test.go b/v2/api/operationalinsights/v1api20250701/workspace_types_gen_test.go new file mode 100644 index 00000000000..d4c3212118b --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/workspace_types_gen_test.go @@ -0,0 +1,2277 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20250701 + +import ( + "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/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_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 storage.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 storage.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_PrivateLinkScopedResource_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PrivateLinkScopedResource_STATUS to PrivateLinkScopedResource_STATUS via AssignProperties_To_PrivateLinkScopedResource_STATUS & AssignProperties_From_PrivateLinkScopedResource_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForPrivateLinkScopedResource_STATUS, PrivateLinkScopedResource_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPrivateLinkScopedResource_STATUS tests if a specific instance of PrivateLinkScopedResource_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForPrivateLinkScopedResource_STATUS(subject PrivateLinkScopedResource_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 storage.PrivateLinkScopedResource_STATUS + err := copied.AssignProperties_To_PrivateLinkScopedResource_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual PrivateLinkScopedResource_STATUS + err = actual.AssignProperties_From_PrivateLinkScopedResource_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_PrivateLinkScopedResource_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 PrivateLinkScopedResource_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateLinkScopedResource_STATUS, PrivateLinkScopedResource_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateLinkScopedResource_STATUS runs a test to see if a specific instance of PrivateLinkScopedResource_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateLinkScopedResource_STATUS(subject PrivateLinkScopedResource_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateLinkScopedResource_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 PrivateLinkScopedResource_STATUS instances for property testing - lazily instantiated by +// PrivateLinkScopedResource_STATUSGenerator() +var privateLinkScopedResource_STATUSGenerator gopter.Gen + +// PrivateLinkScopedResource_STATUSGenerator returns a generator of PrivateLinkScopedResource_STATUS instances for property testing. +func PrivateLinkScopedResource_STATUSGenerator() gopter.Gen { + if privateLinkScopedResource_STATUSGenerator != nil { + return privateLinkScopedResource_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS(generators) + privateLinkScopedResource_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateLinkScopedResource_STATUS{}), generators) + + return privateLinkScopedResource_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateLinkScopedResource_STATUS(gens map[string]gopter.Gen) { + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["ScopeId"] = gen.PtrOf(gen.AlphaString()) +} + +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 storage.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 storage.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 storage.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()) +} + +func Test_Workspace_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 Workspace to hub returns original", + prop.ForAll(RunResourceConversionTestForWorkspace, WorkspaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForWorkspace tests if a specific instance of Workspace round trips to the hub storage version and back losslessly +func RunResourceConversionTestForWorkspace(subject Workspace) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub storage.Workspace + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual Workspace + 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_Workspace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspace to Workspace via AssignProperties_To_Workspace & AssignProperties_From_Workspace returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspace, WorkspaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspace tests if a specific instance of Workspace can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspace(subject Workspace) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Workspace + err := copied.AssignProperties_To_Workspace(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace + err = actual.AssignProperties_From_Workspace(&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_Workspace_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 Workspace via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace, WorkspaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace runs a test to see if a specific instance of Workspace round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace(subject Workspace) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace + 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 Workspace instances for property testing - lazily instantiated by WorkspaceGenerator() +var workspaceGenerator gopter.Gen + +// WorkspaceGenerator returns a generator of Workspace instances for property testing. +func WorkspaceGenerator() gopter.Gen { + if workspaceGenerator != nil { + return workspaceGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspace(generators) + workspaceGenerator = gen.Struct(reflect.TypeOf(Workspace{}), generators) + + return workspaceGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspace is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace(gens map[string]gopter.Gen) { + gens["Spec"] = Workspace_SpecGenerator() + gens["Status"] = Workspace_STATUSGenerator() +} + +func Test_WorkspaceCapping_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceCapping to WorkspaceCapping via AssignProperties_To_WorkspaceCapping & AssignProperties_From_WorkspaceCapping returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceCapping, WorkspaceCappingGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceCapping tests if a specific instance of WorkspaceCapping can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceCapping(subject WorkspaceCapping) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceCapping + err := copied.AssignProperties_To_WorkspaceCapping(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceCapping + err = actual.AssignProperties_From_WorkspaceCapping(&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_WorkspaceCapping_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 WorkspaceCapping via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceCapping, WorkspaceCappingGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceCapping runs a test to see if a specific instance of WorkspaceCapping round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceCapping(subject WorkspaceCapping) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceCapping + 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 WorkspaceCapping instances for property testing - lazily instantiated by WorkspaceCappingGenerator() +var workspaceCappingGenerator gopter.Gen + +// WorkspaceCappingGenerator returns a generator of WorkspaceCapping instances for property testing. +func WorkspaceCappingGenerator() gopter.Gen { + if workspaceCappingGenerator != nil { + return workspaceCappingGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceCapping(generators) + workspaceCappingGenerator = gen.Struct(reflect.TypeOf(WorkspaceCapping{}), generators) + + return workspaceCappingGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceCapping is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceCapping(gens map[string]gopter.Gen) { + gens["DailyQuotaGb"] = gen.PtrOf(gen.Float64()) +} + +func Test_WorkspaceCapping_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceCapping_STATUS to WorkspaceCapping_STATUS via AssignProperties_To_WorkspaceCapping_STATUS & AssignProperties_From_WorkspaceCapping_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceCapping_STATUS, WorkspaceCapping_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceCapping_STATUS tests if a specific instance of WorkspaceCapping_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceCapping_STATUS(subject WorkspaceCapping_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 storage.WorkspaceCapping_STATUS + err := copied.AssignProperties_To_WorkspaceCapping_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceCapping_STATUS + err = actual.AssignProperties_From_WorkspaceCapping_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_WorkspaceCapping_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 WorkspaceCapping_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceCapping_STATUS, WorkspaceCapping_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceCapping_STATUS runs a test to see if a specific instance of WorkspaceCapping_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceCapping_STATUS(subject WorkspaceCapping_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceCapping_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 WorkspaceCapping_STATUS instances for property testing - lazily instantiated by +// WorkspaceCapping_STATUSGenerator() +var workspaceCapping_STATUSGenerator gopter.Gen + +// WorkspaceCapping_STATUSGenerator returns a generator of WorkspaceCapping_STATUS instances for property testing. +func WorkspaceCapping_STATUSGenerator() gopter.Gen { + if workspaceCapping_STATUSGenerator != nil { + return workspaceCapping_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS(generators) + workspaceCapping_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceCapping_STATUS{}), generators) + + return workspaceCapping_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceCapping_STATUS(gens map[string]gopter.Gen) { + gens["DailyQuotaGb"] = gen.PtrOf(gen.Float64()) + gens["DataIngestionStatus"] = gen.PtrOf(gen.OneConstOf( + WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota, + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff, + WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn, + WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota, + WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota, + WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended)) + gens["QuotaNextResetTime"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceFailoverProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceFailoverProperties_STATUS to WorkspaceFailoverProperties_STATUS via AssignProperties_To_WorkspaceFailoverProperties_STATUS & AssignProperties_From_WorkspaceFailoverProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceFailoverProperties_STATUS, WorkspaceFailoverProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceFailoverProperties_STATUS tests if a specific instance of WorkspaceFailoverProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceFailoverProperties_STATUS(subject WorkspaceFailoverProperties_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 storage.WorkspaceFailoverProperties_STATUS + err := copied.AssignProperties_To_WorkspaceFailoverProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceFailoverProperties_STATUS + err = actual.AssignProperties_From_WorkspaceFailoverProperties_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_WorkspaceFailoverProperties_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 WorkspaceFailoverProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS, WorkspaceFailoverProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS runs a test to see if a specific instance of WorkspaceFailoverProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFailoverProperties_STATUS(subject WorkspaceFailoverProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFailoverProperties_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 WorkspaceFailoverProperties_STATUS instances for property testing - lazily instantiated by +// WorkspaceFailoverProperties_STATUSGenerator() +var workspaceFailoverProperties_STATUSGenerator gopter.Gen + +// WorkspaceFailoverProperties_STATUSGenerator returns a generator of WorkspaceFailoverProperties_STATUS instances for property testing. +func WorkspaceFailoverProperties_STATUSGenerator() gopter.Gen { + if workspaceFailoverProperties_STATUSGenerator != nil { + return workspaceFailoverProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS(generators) + workspaceFailoverProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceFailoverProperties_STATUS{}), generators) + + return workspaceFailoverProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFailoverProperties_STATUS(gens map[string]gopter.Gen) { + gens["LastModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["State"] = gen.PtrOf(gen.OneConstOf( + WorkspaceFailoverProperties_State_STATUS_Activating, + WorkspaceFailoverProperties_State_STATUS_Active, + WorkspaceFailoverProperties_State_STATUS_Deactivating, + WorkspaceFailoverProperties_State_STATUS_Failed, + WorkspaceFailoverProperties_State_STATUS_Inactive)) +} + +func Test_WorkspaceFeatures_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceFeatures to WorkspaceFeatures via AssignProperties_To_WorkspaceFeatures & AssignProperties_From_WorkspaceFeatures returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceFeatures, WorkspaceFeaturesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceFeatures tests if a specific instance of WorkspaceFeatures can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceFeatures(subject WorkspaceFeatures) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceFeatures + err := copied.AssignProperties_To_WorkspaceFeatures(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceFeatures + err = actual.AssignProperties_From_WorkspaceFeatures(&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_WorkspaceFeatures_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 WorkspaceFeatures via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFeatures, WorkspaceFeaturesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFeatures runs a test to see if a specific instance of WorkspaceFeatures round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFeatures(subject WorkspaceFeatures) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFeatures + 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 WorkspaceFeatures instances for property testing - lazily instantiated by WorkspaceFeaturesGenerator() +var workspaceFeaturesGenerator gopter.Gen + +// WorkspaceFeaturesGenerator returns a generator of WorkspaceFeatures instances for property testing. +func WorkspaceFeaturesGenerator() gopter.Gen { + if workspaceFeaturesGenerator != nil { + return workspaceFeaturesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFeatures(generators) + workspaceFeaturesGenerator = gen.Struct(reflect.TypeOf(WorkspaceFeatures{}), generators) + + return workspaceFeaturesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFeatures is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFeatures(gens map[string]gopter.Gen) { + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["EnableDataExport"] = gen.PtrOf(gen.Bool()) + gens["EnableLogAccessUsingOnlyResourcePermissions"] = gen.PtrOf(gen.Bool()) + gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) +} + +func Test_WorkspaceFeatures_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceFeatures_STATUS to WorkspaceFeatures_STATUS via AssignProperties_To_WorkspaceFeatures_STATUS & AssignProperties_From_WorkspaceFeatures_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceFeatures_STATUS, WorkspaceFeatures_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceFeatures_STATUS tests if a specific instance of WorkspaceFeatures_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceFeatures_STATUS(subject WorkspaceFeatures_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 storage.WorkspaceFeatures_STATUS + err := copied.AssignProperties_To_WorkspaceFeatures_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceFeatures_STATUS + err = actual.AssignProperties_From_WorkspaceFeatures_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_WorkspaceFeatures_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 WorkspaceFeatures_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceFeatures_STATUS, WorkspaceFeatures_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceFeatures_STATUS runs a test to see if a specific instance of WorkspaceFeatures_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceFeatures_STATUS(subject WorkspaceFeatures_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceFeatures_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 WorkspaceFeatures_STATUS instances for property testing - lazily instantiated by +// WorkspaceFeatures_STATUSGenerator() +var workspaceFeatures_STATUSGenerator gopter.Gen + +// WorkspaceFeatures_STATUSGenerator returns a generator of WorkspaceFeatures_STATUS instances for property testing. +func WorkspaceFeatures_STATUSGenerator() gopter.Gen { + if workspaceFeatures_STATUSGenerator != nil { + return workspaceFeatures_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS(generators) + workspaceFeatures_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceFeatures_STATUS{}), generators) + + return workspaceFeatures_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceFeatures_STATUS(gens map[string]gopter.Gen) { + gens["Associations"] = gen.SliceOf(gen.AlphaString()) + gens["ClusterResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["EnableDataExport"] = gen.PtrOf(gen.Bool()) + gens["EnableLogAccessUsingOnlyResourcePermissions"] = gen.PtrOf(gen.Bool()) + gens["ImmediatePurgeDataOn30Days"] = gen.PtrOf(gen.Bool()) + gens["UnifiedSentinelBillingOnly"] = gen.PtrOf(gen.Bool()) +} + +func Test_WorkspaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceOperatorSecrets to WorkspaceOperatorSecrets via AssignProperties_To_WorkspaceOperatorSecrets & AssignProperties_From_WorkspaceOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceOperatorSecrets, WorkspaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceOperatorSecrets tests if a specific instance of WorkspaceOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceOperatorSecrets(subject WorkspaceOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceOperatorSecrets + err := copied.AssignProperties_To_WorkspaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceOperatorSecrets + err = actual.AssignProperties_From_WorkspaceOperatorSecrets(&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_WorkspaceOperatorSecrets_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 WorkspaceOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceOperatorSecrets, WorkspaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceOperatorSecrets runs a test to see if a specific instance of WorkspaceOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceOperatorSecrets(subject WorkspaceOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceOperatorSecrets + 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 WorkspaceOperatorSecrets instances for property testing - lazily instantiated by +// WorkspaceOperatorSecretsGenerator() +var workspaceOperatorSecretsGenerator gopter.Gen + +// WorkspaceOperatorSecretsGenerator returns a generator of WorkspaceOperatorSecrets instances for property testing. +func WorkspaceOperatorSecretsGenerator() gopter.Gen { + if workspaceOperatorSecretsGenerator != nil { + return workspaceOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + workspaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(WorkspaceOperatorSecrets{}), generators) + + return workspaceOperatorSecretsGenerator +} + +func Test_WorkspaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceOperatorSpec to WorkspaceOperatorSpec via AssignProperties_To_WorkspaceOperatorSpec & AssignProperties_From_WorkspaceOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceOperatorSpec, WorkspaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceOperatorSpec tests if a specific instance of WorkspaceOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceOperatorSpec(subject WorkspaceOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceOperatorSpec + err := copied.AssignProperties_To_WorkspaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceOperatorSpec + err = actual.AssignProperties_From_WorkspaceOperatorSpec(&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_WorkspaceOperatorSpec_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 WorkspaceOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceOperatorSpec, WorkspaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceOperatorSpec runs a test to see if a specific instance of WorkspaceOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceOperatorSpec(subject WorkspaceOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceOperatorSpec + 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 WorkspaceOperatorSpec instances for property testing - lazily instantiated by +// WorkspaceOperatorSpecGenerator() +var workspaceOperatorSpecGenerator gopter.Gen + +// WorkspaceOperatorSpecGenerator returns a generator of WorkspaceOperatorSpec instances for property testing. +func WorkspaceOperatorSpecGenerator() gopter.Gen { + if workspaceOperatorSpecGenerator != nil { + return workspaceOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspaceOperatorSpec(generators) + workspaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(WorkspaceOperatorSpec{}), generators) + + return workspaceOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspaceOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(WorkspaceOperatorSecretsGenerator()) +} + +func Test_WorkspaceReplicationProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceReplicationProperties to WorkspaceReplicationProperties via AssignProperties_To_WorkspaceReplicationProperties & AssignProperties_From_WorkspaceReplicationProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceReplicationProperties, WorkspaceReplicationPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceReplicationProperties tests if a specific instance of WorkspaceReplicationProperties can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceReplicationProperties(subject WorkspaceReplicationProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceReplicationProperties + err := copied.AssignProperties_To_WorkspaceReplicationProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceReplicationProperties + err = actual.AssignProperties_From_WorkspaceReplicationProperties(&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_WorkspaceReplicationProperties_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 WorkspaceReplicationProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceReplicationProperties, WorkspaceReplicationPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceReplicationProperties runs a test to see if a specific instance of WorkspaceReplicationProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceReplicationProperties(subject WorkspaceReplicationProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceReplicationProperties + 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 WorkspaceReplicationProperties instances for property testing - lazily instantiated by +// WorkspaceReplicationPropertiesGenerator() +var workspaceReplicationPropertiesGenerator gopter.Gen + +// WorkspaceReplicationPropertiesGenerator returns a generator of WorkspaceReplicationProperties instances for property testing. +func WorkspaceReplicationPropertiesGenerator() gopter.Gen { + if workspaceReplicationPropertiesGenerator != nil { + return workspaceReplicationPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties(generators) + workspaceReplicationPropertiesGenerator = gen.Struct(reflect.TypeOf(WorkspaceReplicationProperties{}), generators) + + return workspaceReplicationPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceReplicationProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceReplicationProperties_STATUS to WorkspaceReplicationProperties_STATUS via AssignProperties_To_WorkspaceReplicationProperties_STATUS & AssignProperties_From_WorkspaceReplicationProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceReplicationProperties_STATUS, WorkspaceReplicationProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceReplicationProperties_STATUS tests if a specific instance of WorkspaceReplicationProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceReplicationProperties_STATUS(subject WorkspaceReplicationProperties_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 storage.WorkspaceReplicationProperties_STATUS + err := copied.AssignProperties_To_WorkspaceReplicationProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceReplicationProperties_STATUS + err = actual.AssignProperties_From_WorkspaceReplicationProperties_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_WorkspaceReplicationProperties_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 WorkspaceReplicationProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS, WorkspaceReplicationProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS runs a test to see if a specific instance of WorkspaceReplicationProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceReplicationProperties_STATUS(subject WorkspaceReplicationProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceReplicationProperties_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 WorkspaceReplicationProperties_STATUS instances for property testing - lazily instantiated by +// WorkspaceReplicationProperties_STATUSGenerator() +var workspaceReplicationProperties_STATUSGenerator gopter.Gen + +// WorkspaceReplicationProperties_STATUSGenerator returns a generator of WorkspaceReplicationProperties_STATUS instances for property testing. +func WorkspaceReplicationProperties_STATUSGenerator() gopter.Gen { + if workspaceReplicationProperties_STATUSGenerator != nil { + return workspaceReplicationProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS(generators) + workspaceReplicationProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceReplicationProperties_STATUS{}), generators) + + return workspaceReplicationProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceReplicationProperties_STATUS(gens map[string]gopter.Gen) { + gens["CreatedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["LastModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + WorkspaceReplicationProperties_ProvisioningState_STATUS_Canceled, + WorkspaceReplicationProperties_ProvisioningState_STATUS_DisableRequested, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Disabling, + WorkspaceReplicationProperties_ProvisioningState_STATUS_EnableRequested, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Enabling, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Failed, + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollbackRequested, + WorkspaceReplicationProperties_ProvisioningState_STATUS_RollingBack, + WorkspaceReplicationProperties_ProvisioningState_STATUS_Succeeded)) +} + +func Test_WorkspaceSku_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceSku to WorkspaceSku via AssignProperties_To_WorkspaceSku & AssignProperties_From_WorkspaceSku returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceSku, WorkspaceSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceSku tests if a specific instance of WorkspaceSku can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceSku(subject WorkspaceSku) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.WorkspaceSku + err := copied.AssignProperties_To_WorkspaceSku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceSku + err = actual.AssignProperties_From_WorkspaceSku(&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_WorkspaceSku_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 WorkspaceSku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceSku, WorkspaceSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceSku runs a test to see if a specific instance of WorkspaceSku round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceSku(subject WorkspaceSku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceSku + 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 WorkspaceSku instances for property testing - lazily instantiated by WorkspaceSkuGenerator() +var workspaceSkuGenerator gopter.Gen + +// WorkspaceSkuGenerator returns a generator of WorkspaceSku instances for property testing. +func WorkspaceSkuGenerator() gopter.Gen { + if workspaceSkuGenerator != nil { + return workspaceSkuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceSku(generators) + workspaceSkuGenerator = gen.Struct(reflect.TypeOf(WorkspaceSku{}), generators) + + return workspaceSkuGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceSku(gens map[string]gopter.Gen) { + gens["CapacityReservationLevel"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf( + WorkspaceSku_Name_CapacityReservation, + WorkspaceSku_Name_Free, + WorkspaceSku_Name_LACluster, + WorkspaceSku_Name_PerGB2018, + WorkspaceSku_Name_PerNode, + WorkspaceSku_Name_Premium, + WorkspaceSku_Name_Standalone, + WorkspaceSku_Name_Standard)) +} + +func Test_WorkspaceSku_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceSku_STATUS to WorkspaceSku_STATUS via AssignProperties_To_WorkspaceSku_STATUS & AssignProperties_From_WorkspaceSku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceSku_STATUS, WorkspaceSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceSku_STATUS tests if a specific instance of WorkspaceSku_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceSku_STATUS(subject WorkspaceSku_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 storage.WorkspaceSku_STATUS + err := copied.AssignProperties_To_WorkspaceSku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceSku_STATUS + err = actual.AssignProperties_From_WorkspaceSku_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_WorkspaceSku_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 WorkspaceSku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceSku_STATUS, WorkspaceSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceSku_STATUS runs a test to see if a specific instance of WorkspaceSku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceSku_STATUS(subject WorkspaceSku_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceSku_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 WorkspaceSku_STATUS instances for property testing - lazily instantiated by +// WorkspaceSku_STATUSGenerator() +var workspaceSku_STATUSGenerator gopter.Gen + +// WorkspaceSku_STATUSGenerator returns a generator of WorkspaceSku_STATUS instances for property testing. +func WorkspaceSku_STATUSGenerator() gopter.Gen { + if workspaceSku_STATUSGenerator != nil { + return workspaceSku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS(generators) + workspaceSku_STATUSGenerator = gen.Struct(reflect.TypeOf(WorkspaceSku_STATUS{}), generators) + + return workspaceSku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceSku_STATUS(gens map[string]gopter.Gen) { + gens["CapacityReservationLevel"] = gen.PtrOf(gen.Int()) + gens["LastSkuUpdate"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.OneConstOf( + WorkspaceSku_Name_STATUS_CapacityReservation, + WorkspaceSku_Name_STATUS_Free, + WorkspaceSku_Name_STATUS_LACluster, + WorkspaceSku_Name_STATUS_PerGB2018, + WorkspaceSku_Name_STATUS_PerNode, + WorkspaceSku_Name_STATUS_Premium, + WorkspaceSku_Name_STATUS_Standalone, + WorkspaceSku_Name_STATUS_Standard)) +} + +func Test_Workspace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspace_STATUS to Workspace_STATUS via AssignProperties_To_Workspace_STATUS & AssignProperties_From_Workspace_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspace_STATUS, Workspace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspace_STATUS tests if a specific instance of Workspace_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspace_STATUS(subject Workspace_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 storage.Workspace_STATUS + err := copied.AssignProperties_To_Workspace_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace_STATUS + err = actual.AssignProperties_From_Workspace_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_Workspace_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 Workspace_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace_STATUS, Workspace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace_STATUS runs a test to see if a specific instance of Workspace_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace_STATUS(subject Workspace_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace_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 Workspace_STATUS instances for property testing - lazily instantiated by Workspace_STATUSGenerator() +var workspace_STATUSGenerator gopter.Gen + +// Workspace_STATUSGenerator returns a generator of Workspace_STATUS instances for property testing. +// We first initialize workspace_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 Workspace_STATUSGenerator() gopter.Gen { + if workspace_STATUSGenerator != nil { + return workspace_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_STATUS(generators) + workspace_STATUSGenerator = gen.Struct(reflect.TypeOf(Workspace_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_STATUS(generators) + AddRelatedPropertyGeneratorsForWorkspace_STATUS(generators) + workspace_STATUSGenerator = gen.Struct(reflect.TypeOf(Workspace_STATUS{}), generators) + + return workspace_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspace_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspace_STATUS(gens map[string]gopter.Gen) { + gens["CreatedDate"] = gen.PtrOf(gen.AlphaString()) + gens["CustomerId"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultDataCollectionRuleResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["ForceCmkForQuery"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["ModifiedDate"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + WorkspaceProperties_ProvisioningState_STATUS_Canceled, + WorkspaceProperties_ProvisioningState_STATUS_Creating, + WorkspaceProperties_ProvisioningState_STATUS_Deleting, + WorkspaceProperties_ProvisioningState_STATUS_Failed, + WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount, + WorkspaceProperties_ProvisioningState_STATUS_Succeeded, + WorkspaceProperties_ProvisioningState_STATUS_Updating)) + gens["PublicNetworkAccessForIngestion"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_STATUS_Disabled, PublicNetworkAccessType_STATUS_Enabled, PublicNetworkAccessType_STATUS_SecuredByPerimeter)) + gens["PublicNetworkAccessForQuery"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_STATUS_Disabled, PublicNetworkAccessType_STATUS_Enabled, PublicNetworkAccessType_STATUS_SecuredByPerimeter)) + gens["RetentionInDays"] = gen.PtrOf(gen.Int()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspace_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace_STATUS(gens map[string]gopter.Gen) { + gens["Failover"] = gen.PtrOf(WorkspaceFailoverProperties_STATUSGenerator()) + gens["Features"] = gen.PtrOf(WorkspaceFeatures_STATUSGenerator()) + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["PrivateLinkScopedResources"] = gen.SliceOf(PrivateLinkScopedResource_STATUSGenerator()) + gens["Replication"] = gen.PtrOf(WorkspaceReplicationProperties_STATUSGenerator()) + gens["Sku"] = gen.PtrOf(WorkspaceSku_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) + gens["WorkspaceCapping"] = gen.PtrOf(WorkspaceCapping_STATUSGenerator()) +} + +func Test_Workspace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspace_Spec to Workspace_Spec via AssignProperties_To_Workspace_Spec & AssignProperties_From_Workspace_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspace_Spec, Workspace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspace_Spec tests if a specific instance of Workspace_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForWorkspace_Spec(subject Workspace_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 storage.Workspace_Spec + err := copied.AssignProperties_To_Workspace_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace_Spec + err = actual.AssignProperties_From_Workspace_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_Workspace_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 Workspace_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspace_Spec, Workspace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspace_Spec runs a test to see if a specific instance of Workspace_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspace_Spec(subject Workspace_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace_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 Workspace_Spec instances for property testing - lazily instantiated by Workspace_SpecGenerator() +var workspace_SpecGenerator gopter.Gen + +// Workspace_SpecGenerator returns a generator of Workspace_Spec instances for property testing. +// We first initialize workspace_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 Workspace_SpecGenerator() gopter.Gen { + if workspace_SpecGenerator != nil { + return workspace_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_Spec(generators) + workspace_SpecGenerator = gen.Struct(reflect.TypeOf(Workspace_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspace_Spec(generators) + AddRelatedPropertyGeneratorsForWorkspace_Spec(generators) + workspace_SpecGenerator = gen.Struct(reflect.TypeOf(Workspace_Spec{}), generators) + + return workspace_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspace_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspace_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["Etag"] = gen.PtrOf(gen.AlphaString()) + gens["ForceCmkForQuery"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccessForIngestion"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_Disabled, PublicNetworkAccessType_Enabled, PublicNetworkAccessType_SecuredByPerimeter)) + gens["PublicNetworkAccessForQuery"] = gen.PtrOf(gen.OneConstOf(PublicNetworkAccessType_Disabled, PublicNetworkAccessType_Enabled, PublicNetworkAccessType_SecuredByPerimeter)) + gens["RetentionInDays"] = gen.PtrOf(gen.Int()) + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspace_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspace_Spec(gens map[string]gopter.Gen) { + gens["Features"] = gen.PtrOf(WorkspaceFeaturesGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(WorkspaceOperatorSpecGenerator()) + gens["Replication"] = gen.PtrOf(WorkspaceReplicationPropertiesGenerator()) + gens["Sku"] = gen.PtrOf(WorkspaceSkuGenerator()) + gens["WorkspaceCapping"] = gen.PtrOf(WorkspaceCappingGenerator()) +} diff --git a/v2/api/operationalinsights/v1api20250701/zz_generated.deepcopy.go b/v2/api/operationalinsights/v1api20250701/zz_generated.deepcopy.go new file mode 100644 index 00000000000..f4dfca08ff1 --- /dev/null +++ b/v2/api/operationalinsights/v1api20250701/zz_generated.deepcopy.go @@ -0,0 +1,834 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20250701 + +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 *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 *PrivateLinkScopedResource_STATUS) DeepCopyInto(out *PrivateLinkScopedResource_STATUS) { + *out = *in + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } + if in.ScopeId != nil { + in, out := &in.ScopeId, &out.ScopeId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateLinkScopedResource_STATUS. +func (in *PrivateLinkScopedResource_STATUS) DeepCopy() *PrivateLinkScopedResource_STATUS { + if in == nil { + return nil + } + out := new(PrivateLinkScopedResource_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 *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 +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspace) DeepCopyInto(out *Workspace) { + *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 Workspace. +func (in *Workspace) DeepCopy() *Workspace { + if in == nil { + return nil + } + out := new(Workspace) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Workspace) 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 *WorkspaceCapping) DeepCopyInto(out *WorkspaceCapping) { + *out = *in + if in.DailyQuotaGb != nil { + in, out := &in.DailyQuotaGb, &out.DailyQuotaGb + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceCapping. +func (in *WorkspaceCapping) DeepCopy() *WorkspaceCapping { + if in == nil { + return nil + } + out := new(WorkspaceCapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceCapping_STATUS) DeepCopyInto(out *WorkspaceCapping_STATUS) { + *out = *in + if in.DailyQuotaGb != nil { + in, out := &in.DailyQuotaGb, &out.DailyQuotaGb + *out = new(float64) + **out = **in + } + if in.DataIngestionStatus != nil { + in, out := &in.DataIngestionStatus, &out.DataIngestionStatus + *out = new(WorkspaceCapping_DataIngestionStatus_STATUS) + **out = **in + } + if in.QuotaNextResetTime != nil { + in, out := &in.QuotaNextResetTime, &out.QuotaNextResetTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceCapping_STATUS. +func (in *WorkspaceCapping_STATUS) DeepCopy() *WorkspaceCapping_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceCapping_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 *WorkspaceFailoverProperties_STATUS) DeepCopyInto(out *WorkspaceFailoverProperties_STATUS) { + *out = *in + if in.LastModifiedDate != nil { + in, out := &in.LastModifiedDate, &out.LastModifiedDate + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(WorkspaceFailoverProperties_State_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceFailoverProperties_STATUS. +func (in *WorkspaceFailoverProperties_STATUS) DeepCopy() *WorkspaceFailoverProperties_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceFailoverProperties_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 *WorkspaceFeatures) DeepCopyInto(out *WorkspaceFeatures) { + *out = *in + if in.ClusterResourceReference != nil { + in, out := &in.ClusterResourceReference, &out.ClusterResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.EnableDataExport != nil { + in, out := &in.EnableDataExport, &out.EnableDataExport + *out = new(bool) + **out = **in + } + if in.EnableLogAccessUsingOnlyResourcePermissions != nil { + in, out := &in.EnableLogAccessUsingOnlyResourcePermissions, &out.EnableLogAccessUsingOnlyResourcePermissions + *out = new(bool) + **out = **in + } + if in.ImmediatePurgeDataOn30Days != nil { + in, out := &in.ImmediatePurgeDataOn30Days, &out.ImmediatePurgeDataOn30Days + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceFeatures. +func (in *WorkspaceFeatures) DeepCopy() *WorkspaceFeatures { + if in == nil { + return nil + } + out := new(WorkspaceFeatures) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceFeatures_STATUS) DeepCopyInto(out *WorkspaceFeatures_STATUS) { + *out = *in + if in.Associations != nil { + in, out := &in.Associations, &out.Associations + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ClusterResourceId != nil { + in, out := &in.ClusterResourceId, &out.ClusterResourceId + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.EnableDataExport != nil { + in, out := &in.EnableDataExport, &out.EnableDataExport + *out = new(bool) + **out = **in + } + if in.EnableLogAccessUsingOnlyResourcePermissions != nil { + in, out := &in.EnableLogAccessUsingOnlyResourcePermissions, &out.EnableLogAccessUsingOnlyResourcePermissions + *out = new(bool) + **out = **in + } + if in.ImmediatePurgeDataOn30Days != nil { + in, out := &in.ImmediatePurgeDataOn30Days, &out.ImmediatePurgeDataOn30Days + *out = new(bool) + **out = **in + } + if in.UnifiedSentinelBillingOnly != nil { + in, out := &in.UnifiedSentinelBillingOnly, &out.UnifiedSentinelBillingOnly + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceFeatures_STATUS. +func (in *WorkspaceFeatures_STATUS) DeepCopy() *WorkspaceFeatures_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceFeatures_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 *WorkspaceList) DeepCopyInto(out *WorkspaceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Workspace, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceList. +func (in *WorkspaceList) DeepCopy() *WorkspaceList { + if in == nil { + return nil + } + out := new(WorkspaceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspaceList) 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 *WorkspaceOperatorSecrets) DeepCopyInto(out *WorkspaceOperatorSecrets) { + *out = *in + if in.PrimarySharedKey != nil { + in, out := &in.PrimarySharedKey, &out.PrimarySharedKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondarySharedKey != nil { + in, out := &in.SecondarySharedKey, &out.SecondarySharedKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceOperatorSecrets. +func (in *WorkspaceOperatorSecrets) DeepCopy() *WorkspaceOperatorSecrets { + if in == nil { + return nil + } + out := new(WorkspaceOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceOperatorSpec) DeepCopyInto(out *WorkspaceOperatorSpec) { + *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 + } + } + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(WorkspaceOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceOperatorSpec. +func (in *WorkspaceOperatorSpec) DeepCopy() *WorkspaceOperatorSpec { + if in == nil { + return nil + } + out := new(WorkspaceOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceReplicationProperties) DeepCopyInto(out *WorkspaceReplicationProperties) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceReplicationProperties. +func (in *WorkspaceReplicationProperties) DeepCopy() *WorkspaceReplicationProperties { + if in == nil { + return nil + } + out := new(WorkspaceReplicationProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceReplicationProperties_STATUS) DeepCopyInto(out *WorkspaceReplicationProperties_STATUS) { + *out = *in + if in.CreatedDate != nil { + in, out := &in.CreatedDate, &out.CreatedDate + *out = new(string) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.LastModifiedDate != nil { + in, out := &in.LastModifiedDate, &out.LastModifiedDate + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(WorkspaceReplicationProperties_ProvisioningState_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceReplicationProperties_STATUS. +func (in *WorkspaceReplicationProperties_STATUS) DeepCopy() *WorkspaceReplicationProperties_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceReplicationProperties_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 *WorkspaceSku) DeepCopyInto(out *WorkspaceSku) { + *out = *in + if in.CapacityReservationLevel != nil { + in, out := &in.CapacityReservationLevel, &out.CapacityReservationLevel + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(WorkspaceSku_Name) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceSku. +func (in *WorkspaceSku) DeepCopy() *WorkspaceSku { + if in == nil { + return nil + } + out := new(WorkspaceSku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceSku_STATUS) DeepCopyInto(out *WorkspaceSku_STATUS) { + *out = *in + if in.CapacityReservationLevel != nil { + in, out := &in.CapacityReservationLevel, &out.CapacityReservationLevel + *out = new(int) + **out = **in + } + if in.LastSkuUpdate != nil { + in, out := &in.LastSkuUpdate, &out.LastSkuUpdate + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(WorkspaceSku_Name_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceSku_STATUS. +func (in *WorkspaceSku_STATUS) DeepCopy() *WorkspaceSku_STATUS { + if in == nil { + return nil + } + out := new(WorkspaceSku_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 *Workspace_STATUS) DeepCopyInto(out *Workspace_STATUS) { + *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.CreatedDate != nil { + in, out := &in.CreatedDate, &out.CreatedDate + *out = new(string) + **out = **in + } + if in.CustomerId != nil { + in, out := &in.CustomerId, &out.CustomerId + *out = new(string) + **out = **in + } + if in.DefaultDataCollectionRuleResourceId != nil { + in, out := &in.DefaultDataCollectionRuleResourceId, &out.DefaultDataCollectionRuleResourceId + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Failover != nil { + in, out := &in.Failover, &out.Failover + *out = new(WorkspaceFailoverProperties_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Features != nil { + in, out := &in.Features, &out.Features + *out = new(WorkspaceFeatures_STATUS) + (*in).DeepCopyInto(*out) + } + if in.ForceCmkForQuery != nil { + in, out := &in.ForceCmkForQuery, &out.ForceCmkForQuery + *out = new(bool) + **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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.ModifiedDate != nil { + in, out := &in.ModifiedDate, &out.ModifiedDate + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateLinkScopedResources != nil { + in, out := &in.PrivateLinkScopedResources, &out.PrivateLinkScopedResources + *out = make([]PrivateLinkScopedResource_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(WorkspaceProperties_ProvisioningState_STATUS) + **out = **in + } + if in.PublicNetworkAccessForIngestion != nil { + in, out := &in.PublicNetworkAccessForIngestion, &out.PublicNetworkAccessForIngestion + *out = new(PublicNetworkAccessType_STATUS) + **out = **in + } + if in.PublicNetworkAccessForQuery != nil { + in, out := &in.PublicNetworkAccessForQuery, &out.PublicNetworkAccessForQuery + *out = new(PublicNetworkAccessType_STATUS) + **out = **in + } + if in.Replication != nil { + in, out := &in.Replication, &out.Replication + *out = new(WorkspaceReplicationProperties_STATUS) + (*in).DeepCopyInto(*out) + } + if in.RetentionInDays != nil { + in, out := &in.RetentionInDays, &out.RetentionInDays + *out = new(int) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(WorkspaceSku_STATUS) + (*in).DeepCopyInto(*out) + } + 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.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.WorkspaceCapping != nil { + in, out := &in.WorkspaceCapping, &out.WorkspaceCapping + *out = new(WorkspaceCapping_STATUS) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace_STATUS. +func (in *Workspace_STATUS) DeepCopy() *Workspace_STATUS { + if in == nil { + return nil + } + out := new(Workspace_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 *Workspace_Spec) DeepCopyInto(out *Workspace_Spec) { + *out = *in + if in.DefaultDataCollectionRuleResourceReference != nil { + in, out := &in.DefaultDataCollectionRuleResourceReference, &out.DefaultDataCollectionRuleResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Features != nil { + in, out := &in.Features, &out.Features + *out = new(WorkspaceFeatures) + (*in).DeepCopyInto(*out) + } + if in.ForceCmkForQuery != nil { + in, out := &in.ForceCmkForQuery, &out.ForceCmkForQuery + *out = new(bool) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(WorkspaceOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PublicNetworkAccessForIngestion != nil { + in, out := &in.PublicNetworkAccessForIngestion, &out.PublicNetworkAccessForIngestion + *out = new(PublicNetworkAccessType) + **out = **in + } + if in.PublicNetworkAccessForQuery != nil { + in, out := &in.PublicNetworkAccessForQuery, &out.PublicNetworkAccessForQuery + *out = new(PublicNetworkAccessType) + **out = **in + } + if in.Replication != nil { + in, out := &in.Replication, &out.Replication + *out = new(WorkspaceReplicationProperties) + (*in).DeepCopyInto(*out) + } + if in.RetentionInDays != nil { + in, out := &in.RetentionInDays, &out.RetentionInDays + *out = new(int) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(WorkspaceSku) + (*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.WorkspaceCapping != nil { + in, out := &in.WorkspaceCapping, &out.WorkspaceCapping + *out = new(WorkspaceCapping) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace_Spec. +func (in *Workspace_Spec) DeepCopy() *Workspace_Spec { + if in == nil { + return nil + } + out := new(Workspace_Spec) + in.DeepCopyInto(out) + return out +} diff --git a/v2/api/operationalinsights/versions_matrix.md b/v2/api/operationalinsights/versions_matrix.md index 86d7b96fb21..83e8505ef5e 100644 --- a/v2/api/operationalinsights/versions_matrix.md +++ b/v2/api/operationalinsights/versions_matrix.md @@ -1,24 +1,38 @@ -| Type Definitions in package "operationalinsights" | v1api20210601 | -|---------------------------------------------------|---------------| -| APIVersion | v1api20210601 | -| PrivateLinkScopedResource_STATUS | v1api20210601 | -| PublicNetworkAccessType | v1api20210601 | -| PublicNetworkAccessType_STATUS | v1api20210601 | -| Workspace | v1api20210601 | -| WorkspaceCapping | v1api20210601 | -| WorkspaceCapping_DataIngestionStatus_STATUS | v1api20210601 | -| WorkspaceCapping_STATUS | v1api20210601 | -| WorkspaceFeatures | v1api20210601 | -| WorkspaceFeatures_STATUS | v1api20210601 | -| WorkspaceProperties | v1api20210601 | -| WorkspaceProperties_ProvisioningState | v1api20210601 | -| WorkspaceProperties_ProvisioningState_STATUS | v1api20210601 | -| WorkspaceProperties_STATUS | v1api20210601 | -| WorkspaceSku | v1api20210601 | -| WorkspaceSku_CapacityReservationLevel | v1api20210601 | -| WorkspaceSku_CapacityReservationLevel_STATUS | v1api20210601 | -| WorkspaceSku_Name | v1api20210601 | -| WorkspaceSku_Name_STATUS | v1api20210601 | -| WorkspaceSku_STATUS | v1api20210601 | -| Workspace_STATUS | v1api20210601 | -| Workspace_Spec | v1api20210601 | +| Type Definitions in package "operationalinsights" | v1api20210601 | v1api20250701 | +|---------------------------------------------------------|---------------|---------------| +| APIVersion | v1api20210601 | v1api20250701 | +| Identity | | v1api20250701 | +| Identity_STATUS | | v1api20250701 | +| Identity_Type | | v1api20250701 | +| Identity_Type_STATUS | | v1api20250701 | +| PrivateLinkScopedResource_STATUS | v1api20210601 | v1api20250701 | +| PublicNetworkAccessType | v1api20210601 | v1api20250701 | +| PublicNetworkAccessType_STATUS | v1api20210601 | v1api20250701 | +| SystemData_CreatedByType_STATUS | | v1api20250701 | +| SystemData_LastModifiedByType_STATUS | | v1api20250701 | +| SystemData_STATUS | | v1api20250701 | +| UserAssignedIdentityDetails | | v1api20250701 | +| UserIdentityProperties_STATUS | | v1api20250701 | +| Workspace | v1api20210601 | v1api20250701 | +| WorkspaceCapping | v1api20210601 | v1api20250701 | +| WorkspaceCapping_DataIngestionStatus_STATUS | v1api20210601 | v1api20250701 | +| WorkspaceCapping_STATUS | v1api20210601 | v1api20250701 | +| WorkspaceFailoverProperties_STATUS | | v1api20250701 | +| WorkspaceFailoverProperties_State_STATUS | | v1api20250701 | +| WorkspaceFeatures | v1api20210601 | v1api20250701 | +| WorkspaceFeatures_STATUS | v1api20210601 | v1api20250701 | +| WorkspaceProperties | v1api20210601 | v1api20250701 | +| WorkspaceProperties_ProvisioningState | v1api20210601 | | +| WorkspaceProperties_ProvisioningState_STATUS | v1api20210601 | v1api20250701 | +| WorkspaceProperties_STATUS | v1api20210601 | v1api20250701 | +| WorkspaceReplicationProperties | | v1api20250701 | +| WorkspaceReplicationProperties_ProvisioningState_STATUS | | v1api20250701 | +| WorkspaceReplicationProperties_STATUS | | v1api20250701 | +| WorkspaceSku | v1api20210601 | v1api20250701 | +| WorkspaceSku_CapacityReservationLevel | v1api20210601 | | +| WorkspaceSku_CapacityReservationLevel_STATUS | v1api20210601 | | +| WorkspaceSku_Name | v1api20210601 | v1api20250701 | +| WorkspaceSku_Name_STATUS | v1api20210601 | v1api20250701 | +| WorkspaceSku_STATUS | v1api20210601 | v1api20250701 | +| Workspace_STATUS | v1api20210601 | v1api20250701 | +| Workspace_Spec | v1api20210601 | v1api20250701 | diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 8bb3578a70a..765b8cfbd4c 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -4464,6 +4464,19 @@ objectModelConfiguration: WorkspaceFeatures: ClusterResourceId: $referenceType: arm + 2025-07-01: + Workspace: + $exportAs: Workspace + $supportedFrom: v2.17.0 + $azureGeneratedSecrets: + - PrimarySharedKey + - SecondarySharedKey + WorkspaceProperties: + DefaultDataCollectionRuleResourceId: + $referenceType: arm + WorkspaceFeatures: + ClusterResourceId: + $referenceType: arm quota: 2025-09-01: Quota: diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index 6df6969d5f9..a8f960729dc 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -328,6 +328,9 @@ import ( operationalinsights_v20210601 "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601" operationalinsights_v20210601s "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/storage" operationalinsights_v20210601w "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/webhook" + operationalinsights_v20250701 "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701" + operationalinsights_v20250701s "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/storage" + operationalinsights_v20250701w "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701/webhook" quota_customizations "github.com/Azure/azure-service-operator/v2/api/quota/customizations" quota_v20250901 "github.com/Azure/azure-service-operator/v2/api/quota/v1api20250901" quota_v20250901s "github.com/Azure/azure-service-operator/v2/api/quota/v1api20250901/storage" @@ -2240,7 +2243,7 @@ func getKnownStorageTypes() []*registration.StorageType { }, }) result = append(result, ®istration.StorageType{Obj: new(notificationhubs_v20230901s.NotificationHubsAuthorizationRule)}) - result = append(result, ®istration.StorageType{Obj: new(operationalinsights_v20210601s.Workspace)}) + result = append(result, ®istration.StorageType{Obj: new(operationalinsights_v20250701s.Workspace)}) result = append(result, ®istration.StorageType{Obj: new(quota_v20250901s.Quota)}) result = append(result, ®istration.StorageType{ Obj: new(redhatopenshift_v20231122s.OpenShiftCluster), @@ -5030,6 +5033,12 @@ func getKnownTypes() []*registration.KnownType { Validator: &operationalinsights_v20210601w.Workspace{}, }) result = append(result, ®istration.KnownType{Obj: new(operationalinsights_v20210601s.Workspace)}) + result = append(result, ®istration.KnownType{ + Obj: new(operationalinsights_v20250701.Workspace), + Defaulter: &operationalinsights_v20250701w.Workspace{}, + Validator: &operationalinsights_v20250701w.Workspace{}, + }) + result = append(result, ®istration.KnownType{Obj: new(operationalinsights_v20250701s.Workspace)}) result = append(result, ®istration.KnownType{ Obj: new(quota_v20250901.Quota), Defaulter: "a_v20250901w.Quota{}, @@ -5803,6 +5812,8 @@ func createScheme() *runtime.Scheme { _ = notificationhubs_v20230901s.AddToScheme(scheme) _ = operationalinsights_v20210601.AddToScheme(scheme) _ = operationalinsights_v20210601s.AddToScheme(scheme) + _ = operationalinsights_v20250701.AddToScheme(scheme) + _ = operationalinsights_v20250701s.AddToScheme(scheme) _ = quota_v20250901.AddToScheme(scheme) _ = quota_v20250901s.AddToScheme(scheme) _ = redhatopenshift_v20231122.AddToScheme(scheme) diff --git a/v2/internal/controllers/operationalinsights_workspace_crud_20250701_test.go b/v2/internal/controllers/operationalinsights_workspace_crud_20250701_test.go new file mode 100644 index 00000000000..3e4a3505984 --- /dev/null +++ b/v2/internal/controllers/operationalinsights_workspace_crud_20250701_test.go @@ -0,0 +1,74 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +package controllers_test + +import ( + "testing" + + . "github.com/onsi/gomega" + + operationalinsights "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20250701" + "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_OperationalInsights_Workspace_v1api20250701_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + // Create a workspace + sku := operationalinsights.WorkspaceSku_Name_Standalone + workspace := &operationalinsights.Workspace{ + ObjectMeta: tc.MakeObjectMeta("workspace"), + Spec: operationalinsights.Workspace_Spec{ + Location: tc.AzureRegion, + Owner: testcommon.AsOwner(rg), + Sku: &operationalinsights.WorkspaceSku{ + Name: &sku, + }, + }, + } + + tc.CreateResourceAndWait(workspace) + + tc.Expect(workspace.Status.Location).To(Equal(tc.AzureRegion)) + tc.Expect(workspace.Status.Id).ToNot(BeNil()) + armId := *workspace.Status.Id + + // Perform a simple patch. + old := workspace.DeepCopy() + sharedKeysSecret := "sharedkeys" + workspace.Spec.RetentionInDays = to.Ptr(36) + workspace.Spec.OperatorSpec = &operationalinsights.WorkspaceOperatorSpec{ + Secrets: &operationalinsights.WorkspaceOperatorSecrets{ + PrimarySharedKey: &genruntime.SecretDestination{ + Name: sharedKeysSecret, + Key: "primarySharedKey", + }, + SecondarySharedKey: &genruntime.SecretDestination{ + Name: sharedKeysSecret, + Key: "secondarySharedKey", + }, + }, + } + tc.PatchResourceAndWait(old, workspace) + tc.Expect(workspace.Status.RetentionInDays).To(Equal(to.Ptr(36))) + tc.ExpectSecretHasKeys(sharedKeysSecret, "primarySharedKey", "secondarySharedKey") + + tc.DeleteResourceAndWait(workspace) + + // Ensure that the resource was really deleted in Azure + exists, _, err := tc.AzureClient.CheckExistenceWithGetByID( + tc.Ctx, + armId, + string(operationalinsights.APIVersion_Value)) + tc.Expect(err).ToNot(HaveOccurred()) + tc.Expect(exists).To(BeFalse()) +} diff --git a/v2/samples/operationalinsights/v1api/v1api20250701_workspace.yaml b/v2/samples/operationalinsights/v1api/v1api20250701_workspace.yaml new file mode 100644 index 00000000000..efb19701b89 --- /dev/null +++ b/v2/samples/operationalinsights/v1api/v1api20250701_workspace.yaml @@ -0,0 +1,11 @@ +apiVersion: operationalinsights.azure.com/v1api20250701 +kind: Workspace +metadata: + name: sampleworkspace + namespace: default +spec: + location: westcentralus + owner: + name: aso-sample-rg + sku: + name: Standalone