From dadf1b08b640dc5843444d41953879c2133d5c41 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:43:40 +1200 Subject: [PATCH] Add support for ML service (#2319) Co-authored-by: Harshdeep Singh Co-authored-by: Bevan Arps --- docs/hugo/content/reference/_index.md | 8 + .../customizations/workspace_extension.go | 143 + .../workspace_extension_types_gen.go | 20 + .../workspaces_compute_extension_types_gen.go | 20 + ...rkspaces_connection_extension_types_gen.go | 20 + .../compute_resource__status_arm_types_gen.go | 222 + ...ute_resource__status_arm_types_gen_test.go | 744 ++ .../v1beta20210701/doc.go | 10 + .../v1beta20210701/groupversion_info_gen.go | 31 + .../workspace__status_arm_types_gen.go | 203 + .../workspace__status_arm_types_gen_test.go | 872 ++ ...kspace_connection__status_arm_types_gen.go | 39 + ...e_connection__status_arm_types_gen_test.go | 158 + .../v1beta20210701/workspace_types_gen.go | 4997 ++++++++++ .../workspace_types_gen_test.go | 3014 ++++++ .../workspaces__spec_arm_types_gen.go | 139 + .../workspaces__spec_arm_types_gen_test.go | 641 ++ .../workspaces_compute_types_gen.go | 8108 +++++++++++++++++ .../workspaces_compute_types_gen_test.go | 4636 ++++++++++ ...workspaces_computes__spec_arm_types_gen.go | 817 ++ ...paces_computes__spec_arm_types_gen_test.go | 2586 ++++++ .../workspaces_connection_types_gen.go | 909 ++ .../workspaces_connection_types_gen_test.go | 382 + ...kspaces_connections__spec_arm_types_gen.go | 55 + ...es_connections__spec_arm_types_gen_test.go | 158 + .../v1beta20210701/zz_generated.deepcopy.go | 5551 +++++++++++ .../groupversion_info_gen.go | 31 + .../workspace_types_gen.go | 471 + .../workspace_types_gen_test.go | 1797 ++++ .../workspaces_compute_types_gen.go | 620 ++ .../workspaces_compute_types_gen_test.go | 2855 ++++++ .../workspaces_connection_types_gen.go | 211 + .../workspaces_connection_types_gen_test.go | 214 + .../zz_generated.deepcopy.go | 3367 +++++++ .../versions_matrix.md | 113 + v2/azure-arm.yaml | 77 + .../v1beta20210701_workspace.yaml | 47 + .../v1beta20210701_workspacescompute.yaml | 25 + .../v1beta20210701_workspacesconnection.yaml | 14 + v2/go.mod | 1 + v2/go.sum | 2 + v2/internal/config/vars.go | 1 + .../controllers/controller_resources_gen.go | 147 + .../controllers/crd_compute_vmss_test.go | 13 +- v2/internal/controllers/crd_keyvault_test.go | 15 +- .../crd_machinelearningservices_test.go | 255 + .../recordings/Test_KeyVault_Vault_CRUD.yaml | 286 +- .../Test_MachineLearning_Workspaces_CRUD.yaml | 3293 +++++++ .../genericarmclient/generic_client.go | 3 +- v2/internal/testcommon/creds.go | 27 +- v2/internal/testcommon/test_context.go | 45 +- .../pipeline/resource_registration_file.go | 3 + 52 files changed, 48140 insertions(+), 276 deletions(-) create mode 100644 v2/api/machinelearningservices/customizations/workspace_extension.go create mode 100644 v2/api/machinelearningservices/customizations/workspace_extension_types_gen.go create mode 100644 v2/api/machinelearningservices/customizations/workspaces_compute_extension_types_gen.go create mode 100644 v2/api/machinelearningservices/customizations/workspaces_connection_extension_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/doc.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/groupversion_info_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspace_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspace_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701/zz_generated.deepcopy.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/groupversion_info_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/workspace_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/workspace_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen_test.go create mode 100644 v2/api/machinelearningservices/v1beta20210701storage/zz_generated.deepcopy.go create mode 100644 v2/api/machinelearningservices/versions_matrix.md create mode 100644 v2/config/samples/machinelearningservices/v1beta20210701_workspace.yaml create mode 100644 v2/config/samples/machinelearningservices/v1beta20210701_workspacescompute.yaml create mode 100644 v2/config/samples/machinelearningservices/v1beta20210701_workspacesconnection.yaml create mode 100644 v2/internal/controllers/crd_machinelearningservices_test.go create mode 100644 v2/internal/controllers/recordings/Test_MachineLearning_Workspaces_CRUD.yaml diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index ff115e6eb3..692ea28b2b 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -193,6 +193,14 @@ grouped by the originating ARM service. |----------|--------------------|-----------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------| | Vault | 2021-04-01-preview | v1beta20210401preview | v2.0.0-beta.1 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/keyvault/v1beta20210401preview_vault.yaml) | +## Machinelearningservices + +| Resource | ARM Version | CRD Version | Supported From | Sample | +|----------------------|-------------|----------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------| +| Workspace | 2021-07-01 | v1beta20210701 | v2.0.0-beta.2 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/machinelearningservices/v1beta20210701_workspace.yaml) | +| WorkspacesCompute | 2021-07-01 | v1beta20210701 | v2.0.0-beta.2 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/machinelearningservices/v1beta20210701_workspacescompute.yaml) | +| WorkspacesConnection | 2021-07-01 | v1beta20210701 | v2.0.0-beta.2 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/config/samples/machinelearningservices/v1beta20210701_workspacesconnection.yaml) | + ## Managedidentity | Resource | ARM Version | CRD Version | Supported From | Sample | diff --git a/v2/api/machinelearningservices/customizations/workspace_extension.go b/v2/api/machinelearningservices/customizations/workspace_extension.go new file mode 100644 index 0000000000..4fc4e4cbbe --- /dev/null +++ b/v2/api/machinelearningservices/customizations/workspace_extension.go @@ -0,0 +1,143 @@ +/* +* Copyright (c) Microsoft Corporation. +* Licensed under the MIT license. + */ + +package customizations + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning" + storage "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "github.com/Azure/go-autorest/autorest/to" + "github.com/go-logr/logr" + "github.com/pkg/errors" + "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/conversion" + + "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" + . "github.com/Azure/azure-service-operator/v2/internal/logging" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/extensions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" +) + +var _ extensions.SecretsRetriever = &WorkspaceExtension{} + +func (ext *WorkspaceExtension) RetrieveSecrets( + ctx context.Context, + obj genruntime.ARMMetaObject, + armClient *genericarmclient.GenericClient, + log logr.Logger) ([]*v1.Secret, error) { + + // This has to be the current hub storage version. It will need to be updated + // if the hub storage version changes. + typedObj, ok := obj.(*storage.Workspace) + if !ok { + return nil, errors.Errorf("cannot run on unknown resource type %T, expected *storage.Workspace", obj) + } + + // Type assert that we are the hub type. This will fail to compile if + // the hub type has been changed but this extension has not + var _ conversion.Hub = typedObj + + hasSecrets := secretsSpecified(typedObj) + if !hasSecrets { + log.V(Debug).Info("No secrets retrieval to perform as operatorSpec is empty") + return nil, nil + } + + id, err := genruntime.GetAndParseResourceID(obj) + if err != nil { + return nil, err + } + + var keys armmachinelearning.ListWorkspaceKeysResult + // Only bother calling ListKeys if there are secrets to retrieve + if hasSecrets { + subscription := armClient.SubscriptionID() + // Using armClient.ClientOptions() here ensures we share the same HTTP connection, so this is not opening a new + // connection each time through + var workspacesClient *armmachinelearning.WorkspacesClient + workspacesClient, err = armmachinelearning.NewWorkspacesClient(subscription, armClient.Creds(), armClient.ClientOptions()) + if err != nil { + return nil, errors.Wrapf(err, "failed to create new workspaceClient") + } + + var resp armmachinelearning.WorkspacesClientListKeysResponse + resp, err = workspacesClient.ListKeys(ctx, id.ResourceGroupName, obj.AzureName(), nil) + if err != nil { + return nil, errors.Wrapf(err, "failed listing keys") + } + keys = resp.ListWorkspaceKeysResult + } + + secretSlice, err := secretsToWrite(typedObj, keys) + if err != nil { + return nil, err + } + + return secretSlice, nil +} + +func secretsSpecified(obj *storage.Workspace) bool { + if obj.Spec.OperatorSpec == nil || obj.Spec.OperatorSpec.Secrets == nil { + return false + } + + operatorSecrets := obj.Spec.OperatorSpec.Secrets + + if operatorSecrets.AppInsightsInstrumentationKey != nil || + operatorSecrets.PrimaryNotebookAccessKey != nil || + operatorSecrets.SecondaryNotebookAccessKey != nil || + operatorSecrets.UserStorageKey != nil || + operatorSecrets.ContainerRegistryPassword != nil || + operatorSecrets.ContainerRegistryPassword2 != nil || + operatorSecrets.ContainerRegistryUserName != nil { + return true + } + + return false +} + +func secretsToWrite(obj *storage.Workspace, keysResp armmachinelearning.ListWorkspaceKeysResult) ([]*v1.Secret, error) { + operatorSpecSecrets := obj.Spec.OperatorSpec.Secrets + if operatorSpecSecrets == nil { + return nil, errors.Errorf("unexpected nil operatorspec") + } + + collector := secrets.NewSecretCollector(obj.Namespace) + + creds, crUsername := getContainerRegCreds(keysResp) + + collector.AddSecretValue(operatorSpecSecrets.ContainerRegistryPassword, creds["password"]) + collector.AddSecretValue(operatorSpecSecrets.ContainerRegistryPassword2, creds["password2"]) + collector.AddSecretValue(operatorSpecSecrets.ContainerRegistryUserName, crUsername) + collector.AddSecretValue(operatorSpecSecrets.UserStorageKey, to.String(keysResp.UserStorageKey)) + collector.AddSecretValue(operatorSpecSecrets.AppInsightsInstrumentationKey, to.String(keysResp.AppInsightsInstrumentationKey)) + + if keysResp.NotebookAccessKeys != nil { + collector.AddSecretValue(operatorSpecSecrets.PrimaryNotebookAccessKey, to.String(keysResp.NotebookAccessKeys.PrimaryAccessKey)) + collector.AddSecretValue(operatorSpecSecrets.SecondaryNotebookAccessKey, to.String(keysResp.NotebookAccessKeys.SecondaryAccessKey)) + } + if keysResp.ContainerRegistryCredentials != nil { + } + + return collector.Secrets(), nil +} + +func getContainerRegCreds(keysResp armmachinelearning.ListWorkspaceKeysResult) (map[string]string, string) { + creds := make(map[string]string) + + if keysResp.ContainerRegistryCredentials == nil { + return creds, "" + } + + for _, password := range keysResp.ContainerRegistryCredentials.Passwords { + if password.Name != nil && password.Value != nil { + creds[to.String(password.Name)] = to.String(password.Value) + } + } + return creds, to.String(keysResp.ContainerRegistryCredentials.Username) +} diff --git a/v2/api/machinelearningservices/customizations/workspace_extension_types_gen.go b/v2/api/machinelearningservices/customizations/workspace_extension_types_gen.go new file mode 100644 index 0000000000..c543f474fa --- /dev/null +++ b/v2/api/machinelearningservices/customizations/workspace_extension_types_gen.go @@ -0,0 +1,20 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package customizations + +import ( + v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +type WorkspaceExtension struct { +} + +// GetExtendedResources Returns the KubernetesResource slice for Resource versions +func (extension *WorkspaceExtension) GetExtendedResources() []genruntime.KubernetesResource { + return []genruntime.KubernetesResource{ + &v20210701.Workspace{}, + &v20210701s.Workspace{}} +} diff --git a/v2/api/machinelearningservices/customizations/workspaces_compute_extension_types_gen.go b/v2/api/machinelearningservices/customizations/workspaces_compute_extension_types_gen.go new file mode 100644 index 0000000000..37e5927926 --- /dev/null +++ b/v2/api/machinelearningservices/customizations/workspaces_compute_extension_types_gen.go @@ -0,0 +1,20 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package customizations + +import ( + v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +type WorkspacesComputeExtension struct { +} + +// GetExtendedResources Returns the KubernetesResource slice for Resource versions +func (extension *WorkspacesComputeExtension) GetExtendedResources() []genruntime.KubernetesResource { + return []genruntime.KubernetesResource{ + &v20210701.WorkspacesCompute{}, + &v20210701s.WorkspacesCompute{}} +} diff --git a/v2/api/machinelearningservices/customizations/workspaces_connection_extension_types_gen.go b/v2/api/machinelearningservices/customizations/workspaces_connection_extension_types_gen.go new file mode 100644 index 0000000000..594e6963b3 --- /dev/null +++ b/v2/api/machinelearningservices/customizations/workspaces_connection_extension_types_gen.go @@ -0,0 +1,20 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package customizations + +import ( + v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +type WorkspacesConnectionExtension struct { +} + +// GetExtendedResources Returns the KubernetesResource slice for Resource versions +func (extension *WorkspacesConnectionExtension) GetExtendedResources() []genruntime.KubernetesResource { + return []genruntime.KubernetesResource{ + &v20210701.WorkspacesConnection{}, + &v20210701s.WorkspacesConnection{}} +} diff --git a/v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen.go new file mode 100644 index 0000000000..5821848817 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen.go @@ -0,0 +1,222 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + +type ComputeResource_StatusARM struct { + // 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_StatusARM `json:"identity,omitempty"` + + // Location: Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: Compute properties + Properties *Compute_StatusARM `json:"properties,omitempty"` + + // Sku: The sku of the workspace. + Sku *Sku_StatusARM `json:"sku,omitempty"` + + // SystemData: System data + SystemData *SystemData_StatusARM `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + 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"` +} + +type Compute_StatusARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // ComputeType: The type of compute + ComputeType *ComputeType_Status `json:"computeType,omitempty"` + + // CreatedOn: The time at which the compute was created. + CreatedOn *string `json:"createdOn,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // IsAttachedCompute: Indicating whether the compute was provisioned by user and brought from outside if true, or machine + // learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + + // ModifiedOn: The time at which the compute was last modified. + ModifiedOn *string `json:"modifiedOn,omitempty"` + + // ProvisioningErrors: Errors during provisioning + ProvisioningErrors []ErrorResponse_StatusARM `json:"provisioningErrors,omitempty"` + + // ProvisioningState: The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and + // Failed. + ProvisioningState *ComputeStatusProvisioningState `json:"provisioningState,omitempty"` + + // ResourceId: ARM resource id of the underlying compute + ResourceId *string `json:"resourceId,omitempty"` +} + +type Identity_StatusARM 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: The identity type. + Type *IdentityStatusType `json:"type,omitempty"` + + // UserAssignedIdentities: The user assigned identities associated with the resource. + UserAssignedIdentities map[string]UserAssignedIdentity_StatusARM `json:"userAssignedIdentities,omitempty"` +} + +type Sku_StatusARM struct { + // Name: Name of the sku + Name *string `json:"name,omitempty"` + + // Tier: Tier of the sku like Basic or Enterprise + Tier *string `json:"tier,omitempty"` +} + +type SystemData_StatusARM 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 *SystemDataStatusCreatedByType `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 *SystemDataStatusLastModifiedByType `json:"lastModifiedByType,omitempty"` +} + +type ComputeStatusProvisioningState string + +const ( + ComputeStatusProvisioningStateCanceled = ComputeStatusProvisioningState("Canceled") + ComputeStatusProvisioningStateCreating = ComputeStatusProvisioningState("Creating") + ComputeStatusProvisioningStateDeleting = ComputeStatusProvisioningState("Deleting") + ComputeStatusProvisioningStateFailed = ComputeStatusProvisioningState("Failed") + ComputeStatusProvisioningStateSucceeded = ComputeStatusProvisioningState("Succeeded") + ComputeStatusProvisioningStateUnknown = ComputeStatusProvisioningState("Unknown") + ComputeStatusProvisioningStateUpdating = ComputeStatusProvisioningState("Updating") +) + +type ComputeType_Status string + +const ( + ComputeType_StatusAKS = ComputeType_Status("AKS") + ComputeType_StatusAmlCompute = ComputeType_Status("AmlCompute") + ComputeType_StatusComputeInstance = ComputeType_Status("ComputeInstance") + ComputeType_StatusDataFactory = ComputeType_Status("DataFactory") + ComputeType_StatusDataLakeAnalytics = ComputeType_Status("DataLakeAnalytics") + ComputeType_StatusDatabricks = ComputeType_Status("Databricks") + ComputeType_StatusHDInsight = ComputeType_Status("HDInsight") + ComputeType_StatusKubernetes = ComputeType_Status("Kubernetes") + ComputeType_StatusSynapseSpark = ComputeType_Status("SynapseSpark") + ComputeType_StatusVirtualMachine = ComputeType_Status("VirtualMachine") +) + +type ErrorResponse_StatusARM struct { + // Error: The error object. + Error *ErrorDetail_StatusARM `json:"error,omitempty"` +} + +type IdentityStatusType string + +const ( + IdentityStatusTypeNone = IdentityStatusType("None") + IdentityStatusTypeSystemAssigned = IdentityStatusType("SystemAssigned") + IdentityStatusTypeSystemAssignedUserAssigned = IdentityStatusType("SystemAssigned,UserAssigned") + IdentityStatusTypeUserAssigned = IdentityStatusType("UserAssigned") +) + +type SystemDataStatusCreatedByType string + +const ( + SystemDataStatusCreatedByTypeApplication = SystemDataStatusCreatedByType("Application") + SystemDataStatusCreatedByTypeKey = SystemDataStatusCreatedByType("Key") + SystemDataStatusCreatedByTypeManagedIdentity = SystemDataStatusCreatedByType("ManagedIdentity") + SystemDataStatusCreatedByTypeUser = SystemDataStatusCreatedByType("User") +) + +type SystemDataStatusLastModifiedByType string + +const ( + SystemDataStatusLastModifiedByTypeApplication = SystemDataStatusLastModifiedByType("Application") + SystemDataStatusLastModifiedByTypeKey = SystemDataStatusLastModifiedByType("Key") + SystemDataStatusLastModifiedByTypeManagedIdentity = SystemDataStatusLastModifiedByType("ManagedIdentity") + SystemDataStatusLastModifiedByTypeUser = SystemDataStatusLastModifiedByType("User") +) + +type UserAssignedIdentity_StatusARM struct { + // ClientId: The clientId(aka appId) of the user assigned identity. + ClientId *string `json:"clientId,omitempty"` + + // PrincipalId: The principal ID of the user assigned identity. + PrincipalId *string `json:"principalId,omitempty"` + + // TenantId: The tenant ID of the user assigned identity. + TenantId *string `json:"tenantId,omitempty"` +} + +type ErrorDetail_StatusARM struct { + // AdditionalInfo: The error additional info. + AdditionalInfo []ErrorAdditionalInfo_StatusARM `json:"additionalInfo,omitempty"` + + // Code: The error code. + Code *string `json:"code,omitempty"` + + // Details: The error details. + Details []ErrorDetail_Status_UnrolledARM `json:"details,omitempty"` + + // Message: The error message. + Message *string `json:"message,omitempty"` + + // Target: The error target. + Target *string `json:"target,omitempty"` +} + +type ErrorAdditionalInfo_StatusARM struct { + // Info: The additional info. + Info map[string]v1.JSON `json:"info,omitempty"` + + // Type: The additional info type. + Type *string `json:"type,omitempty"` +} + +type ErrorDetail_Status_UnrolledARM struct { + // AdditionalInfo: The error additional info. + AdditionalInfo []ErrorAdditionalInfo_StatusARM `json:"additionalInfo,omitempty"` + + // Code: The error code. + Code *string `json:"code,omitempty"` + + // Message: The error message. + Message *string `json:"message,omitempty"` + + // Target: The error target. + Target *string `json:"target,omitempty"` +} diff --git a/v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen_test.go new file mode 100644 index 0000000000..bdda9c3c6e --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/compute_resource__status_arm_types_gen_test.go @@ -0,0 +1,744 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +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_ComputeResource_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeResource_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeResourceStatusARM, ComputeResourceStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeResourceStatusARM runs a test to see if a specific instance of ComputeResource_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeResourceStatusARM(subject ComputeResource_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeResource_StatusARM + 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 ComputeResource_StatusARM instances for property testing - lazily instantiated by +// ComputeResourceStatusARMGenerator() +var computeResourceStatusARMGenerator gopter.Gen + +// ComputeResourceStatusARMGenerator returns a generator of ComputeResource_StatusARM instances for property testing. +// We first initialize computeResourceStatusARMGenerator 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 ComputeResourceStatusARMGenerator() gopter.Gen { + if computeResourceStatusARMGenerator != nil { + return computeResourceStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeResourceStatusARM(generators) + computeResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(ComputeResource_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeResourceStatusARM(generators) + AddRelatedPropertyGeneratorsForComputeResourceStatusARM(generators) + computeResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(ComputeResource_StatusARM{}), generators) + + return computeResourceStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeResourceStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeResourceStatusARM(gens map[string]gopter.Gen) { + 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()) +} + +// AddRelatedPropertyGeneratorsForComputeResourceStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeResourceStatusARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityStatusARMGenerator()) + gens["Properties"] = gen.PtrOf(ComputeStatusARMGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusARMGenerator()) +} + +func Test_Compute_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeStatusARM, ComputeStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeStatusARM runs a test to see if a specific instance of Compute_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeStatusARM(subject Compute_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_StatusARM + 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 Compute_StatusARM instances for property testing - lazily instantiated by ComputeStatusARMGenerator() +var computeStatusARMGenerator gopter.Gen + +// ComputeStatusARMGenerator returns a generator of Compute_StatusARM instances for property testing. +// We first initialize computeStatusARMGenerator 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 ComputeStatusARMGenerator() gopter.Gen { + if computeStatusARMGenerator != nil { + return computeStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeStatusARM(generators) + computeStatusARMGenerator = gen.Struct(reflect.TypeOf(Compute_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeStatusARM(generators) + AddRelatedPropertyGeneratorsForComputeStatusARM(generators) + computeStatusARMGenerator = gen.Struct(reflect.TypeOf(Compute_StatusARM{}), generators) + + return computeStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeStatusARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf( + ComputeType_StatusAKS, + ComputeType_StatusAmlCompute, + ComputeType_StatusComputeInstance, + ComputeType_StatusDataFactory, + ComputeType_StatusDataLakeAnalytics, + ComputeType_StatusDatabricks, + ComputeType_StatusHDInsight, + ComputeType_StatusKubernetes, + ComputeType_StatusSynapseSpark, + ComputeType_StatusVirtualMachine)) + gens["CreatedOn"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["IsAttachedCompute"] = gen.PtrOf(gen.Bool()) + gens["ModifiedOn"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + ComputeStatusProvisioningStateCanceled, + ComputeStatusProvisioningStateCreating, + ComputeStatusProvisioningStateDeleting, + ComputeStatusProvisioningStateFailed, + ComputeStatusProvisioningStateSucceeded, + ComputeStatusProvisioningStateUnknown, + ComputeStatusProvisioningStateUpdating)) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeStatusARM(gens map[string]gopter.Gen) { + gens["ProvisioningErrors"] = gen.SliceOf(ErrorResponseStatusARMGenerator()) +} + +func Test_Identity_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityStatusARM, IdentityStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityStatusARM runs a test to see if a specific instance of Identity_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityStatusARM(subject Identity_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_StatusARM + 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_StatusARM instances for property testing - lazily instantiated by IdentityStatusARMGenerator() +var identityStatusARMGenerator gopter.Gen + +// IdentityStatusARMGenerator returns a generator of Identity_StatusARM instances for property testing. +// We first initialize identityStatusARMGenerator 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 IdentityStatusARMGenerator() gopter.Gen { + if identityStatusARMGenerator != nil { + return identityStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityStatusARM(generators) + identityStatusARMGenerator = gen.Struct(reflect.TypeOf(Identity_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityStatusARM(generators) + AddRelatedPropertyGeneratorsForIdentityStatusARM(generators) + identityStatusARMGenerator = gen.Struct(reflect.TypeOf(Identity_StatusARM{}), generators) + + return identityStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityStatusARM(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.OneConstOf( + IdentityStatusTypeNone, + IdentityStatusTypeSystemAssigned, + IdentityStatusTypeSystemAssignedUserAssigned, + IdentityStatusTypeUserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentityStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentityStatusARM(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentityStatusARMGenerator()) +} + +func Test_Sku_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSkuStatusARM, SkuStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSkuStatusARM runs a test to see if a specific instance of Sku_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSkuStatusARM(subject Sku_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Sku_StatusARM + 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 Sku_StatusARM instances for property testing - lazily instantiated by SkuStatusARMGenerator() +var skuStatusARMGenerator gopter.Gen + +// SkuStatusARMGenerator returns a generator of Sku_StatusARM instances for property testing. +func SkuStatusARMGenerator() gopter.Gen { + if skuStatusARMGenerator != nil { + return skuStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSkuStatusARM(generators) + skuStatusARMGenerator = gen.Struct(reflect.TypeOf(Sku_StatusARM{}), generators) + + return skuStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForSkuStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSkuStatusARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tier"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SystemData_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemDataStatusARM, SystemDataStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemDataStatusARM runs a test to see if a specific instance of SystemData_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemDataStatusARM(subject SystemData_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_StatusARM + 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_StatusARM instances for property testing - lazily instantiated by +// SystemDataStatusARMGenerator() +var systemDataStatusARMGenerator gopter.Gen + +// SystemDataStatusARMGenerator returns a generator of SystemData_StatusARM instances for property testing. +func SystemDataStatusARMGenerator() gopter.Gen { + if systemDataStatusARMGenerator != nil { + return systemDataStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemDataStatusARM(generators) + systemDataStatusARMGenerator = gen.Struct(reflect.TypeOf(SystemData_StatusARM{}), generators) + + return systemDataStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForSystemDataStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemDataStatusARM(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataStatusCreatedByTypeApplication, + SystemDataStatusCreatedByTypeKey, + SystemDataStatusCreatedByTypeManagedIdentity, + SystemDataStatusCreatedByTypeUser)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataStatusLastModifiedByTypeApplication, + SystemDataStatusLastModifiedByTypeKey, + SystemDataStatusLastModifiedByTypeManagedIdentity, + SystemDataStatusLastModifiedByTypeUser)) +} + +func Test_ErrorResponse_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorResponse_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorResponseStatusARM, ErrorResponseStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorResponseStatusARM runs a test to see if a specific instance of ErrorResponse_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorResponseStatusARM(subject ErrorResponse_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorResponse_StatusARM + 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 ErrorResponse_StatusARM instances for property testing - lazily instantiated by +// ErrorResponseStatusARMGenerator() +var errorResponseStatusARMGenerator gopter.Gen + +// ErrorResponseStatusARMGenerator returns a generator of ErrorResponse_StatusARM instances for property testing. +func ErrorResponseStatusARMGenerator() gopter.Gen { + if errorResponseStatusARMGenerator != nil { + return errorResponseStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForErrorResponseStatusARM(generators) + errorResponseStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorResponse_StatusARM{}), generators) + + return errorResponseStatusARMGenerator +} + +// AddRelatedPropertyGeneratorsForErrorResponseStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorResponseStatusARM(gens map[string]gopter.Gen) { + gens["Error"] = gen.PtrOf(ErrorDetailStatusARMGenerator()) +} + +func Test_UserAssignedIdentity_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentity_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityStatusARM, UserAssignedIdentityStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityStatusARM runs a test to see if a specific instance of UserAssignedIdentity_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityStatusARM(subject UserAssignedIdentity_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentity_StatusARM + 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 UserAssignedIdentity_StatusARM instances for property testing - lazily instantiated by +// UserAssignedIdentityStatusARMGenerator() +var userAssignedIdentityStatusARMGenerator gopter.Gen + +// UserAssignedIdentityStatusARMGenerator returns a generator of UserAssignedIdentity_StatusARM instances for property testing. +func UserAssignedIdentityStatusARMGenerator() gopter.Gen { + if userAssignedIdentityStatusARMGenerator != nil { + return userAssignedIdentityStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentityStatusARM(generators) + userAssignedIdentityStatusARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_StatusARM{}), generators) + + return userAssignedIdentityStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityStatusARM(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ErrorDetail_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorDetail_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorDetailStatusARM, ErrorDetailStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorDetailStatusARM runs a test to see if a specific instance of ErrorDetail_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorDetailStatusARM(subject ErrorDetail_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorDetail_StatusARM + 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 ErrorDetail_StatusARM instances for property testing - lazily instantiated by +// ErrorDetailStatusARMGenerator() +var errorDetailStatusARMGenerator gopter.Gen + +// ErrorDetailStatusARMGenerator returns a generator of ErrorDetail_StatusARM instances for property testing. +// We first initialize errorDetailStatusARMGenerator 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 ErrorDetailStatusARMGenerator() gopter.Gen { + if errorDetailStatusARMGenerator != nil { + return errorDetailStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusARM(generators) + errorDetailStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusARM(generators) + AddRelatedPropertyGeneratorsForErrorDetailStatusARM(generators) + errorDetailStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_StatusARM{}), generators) + + return errorDetailStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForErrorDetailStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorDetailStatusARM(gens map[string]gopter.Gen) { + gens["Code"] = gen.PtrOf(gen.AlphaString()) + gens["Message"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForErrorDetailStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorDetailStatusARM(gens map[string]gopter.Gen) { + gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusARMGenerator()) + gens["Details"] = gen.SliceOf(ErrorDetailStatusUnrolledARMGenerator()) +} + +func Test_ErrorAdditionalInfo_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorAdditionalInfo_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorAdditionalInfoStatusARM, ErrorAdditionalInfoStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorAdditionalInfoStatusARM runs a test to see if a specific instance of ErrorAdditionalInfo_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorAdditionalInfoStatusARM(subject ErrorAdditionalInfo_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorAdditionalInfo_StatusARM + 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 ErrorAdditionalInfo_StatusARM instances for property testing - lazily instantiated by +// ErrorAdditionalInfoStatusARMGenerator() +var errorAdditionalInfoStatusARMGenerator gopter.Gen + +// ErrorAdditionalInfoStatusARMGenerator returns a generator of ErrorAdditionalInfo_StatusARM instances for property testing. +func ErrorAdditionalInfoStatusARMGenerator() gopter.Gen { + if errorAdditionalInfoStatusARMGenerator != nil { + return errorAdditionalInfoStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatusARM(generators) + errorAdditionalInfoStatusARMGenerator = gen.Struct(reflect.TypeOf(ErrorAdditionalInfo_StatusARM{}), generators) + + return errorAdditionalInfoStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatusARM(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ErrorDetail_Status_UnrolledARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorDetail_Status_UnrolledARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorDetailStatusUnrolledARM, ErrorDetailStatusUnrolledARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorDetailStatusUnrolledARM runs a test to see if a specific instance of ErrorDetail_Status_UnrolledARM round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorDetailStatusUnrolledARM(subject ErrorDetail_Status_UnrolledARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorDetail_Status_UnrolledARM + 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 ErrorDetail_Status_UnrolledARM instances for property testing - lazily instantiated by +// ErrorDetailStatusUnrolledARMGenerator() +var errorDetailStatusUnrolledARMGenerator gopter.Gen + +// ErrorDetailStatusUnrolledARMGenerator returns a generator of ErrorDetail_Status_UnrolledARM instances for property testing. +// We first initialize errorDetailStatusUnrolledARMGenerator 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 ErrorDetailStatusUnrolledARMGenerator() gopter.Gen { + if errorDetailStatusUnrolledARMGenerator != nil { + return errorDetailStatusUnrolledARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM(generators) + errorDetailStatusUnrolledARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_UnrolledARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM(generators) + AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolledARM(generators) + errorDetailStatusUnrolledARMGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_UnrolledARM{}), generators) + + return errorDetailStatusUnrolledARMGenerator +} + +// AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolledARM(gens map[string]gopter.Gen) { + gens["Code"] = gen.PtrOf(gen.AlphaString()) + gens["Message"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolledARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolledARM(gens map[string]gopter.Gen) { + gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusARMGenerator()) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/doc.go b/v2/api/machinelearningservices/v1beta20210701/doc.go new file mode 100644 index 0000000000..e859469ac3 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/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 v1beta20210701 contains API Schema definitions for the machinelearningservices v1beta20210701 API group +// +groupName=machinelearningservices.azure.com +package v1beta20210701 diff --git a/v2/api/machinelearningservices/v1beta20210701/groupversion_info_gen.go b/v2/api/machinelearningservices/v1beta20210701/groupversion_info_gen.go new file mode 100644 index 0000000000..28d2f545e4 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/groupversion_info_gen.go @@ -0,0 +1,31 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1beta20210701 contains API Schema definitions for the machinelearningservices v1beta20210701 API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=machinelearningservices.azure.com +package v1beta20210701 + +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: "machinelearningservices.azure.com", Version: "v1beta20210701"} + + // 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/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen.go new file mode 100644 index 0000000000..34ffb95177 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen.go @@ -0,0 +1,203 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +type Workspace_StatusARM struct { + // 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_StatusARM `json:"identity,omitempty"` + + // Location: Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: The properties of the machine learning workspace. + Properties *WorkspaceProperties_StatusARM `json:"properties,omitempty"` + + // Sku: The sku of the workspace. + Sku *Sku_StatusARM `json:"sku,omitempty"` + + // SystemData: System data + SystemData *SystemData_StatusARM `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + 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"` +} + +type WorkspaceProperties_StatusARM struct { + // AllowPublicAccessWhenBehindVnet: The flag to indicate whether to allow public access when behind VNet. + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + + // ApplicationInsights: ARM id of the application insights associated with this workspace. This cannot be changed once the + // workspace has been created + ApplicationInsights *string `json:"applicationInsights,omitempty"` + + // ContainerRegistry: ARM id of the container registry associated with this workspace. This cannot be changed once the + // workspace has been created + ContainerRegistry *string `json:"containerRegistry,omitempty"` + + // Description: The description of this workspace. + Description *string `json:"description,omitempty"` + + // DiscoveryUrl: Url for the discovery service to identify regional endpoints for machine learning experimentation services + DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + + // Encryption: The encryption settings of Azure ML workspace. + Encryption *EncryptionProperty_StatusARM `json:"encryption,omitempty"` + + // FriendlyName: The friendly name for this workspace. This name in mutable + FriendlyName *string `json:"friendlyName,omitempty"` + + // HbiWorkspace: The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + + // ImageBuildCompute: The compute name for image build + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + + // KeyVault: ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been + // created + KeyVault *string `json:"keyVault,omitempty"` + + // MlFlowTrackingUri: The URI associated with this workspace that machine learning flow must point at to set up tracking. + MlFlowTrackingUri *string `json:"mlFlowTrackingUri,omitempty"` + + // NotebookInfo: The notebook info of Azure ML workspace. + NotebookInfo *NotebookResourceInfo_StatusARM `json:"notebookInfo,omitempty"` + + // PrimaryUserAssignedIdentity: The user assigned identity resource id that represents the workspace identity. + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + + // PrivateEndpointConnections: The list of private endpoint connections in the workspace. + PrivateEndpointConnections []PrivateEndpointConnection_Status_SubResourceEmbeddedARM `json:"privateEndpointConnections,omitempty"` + + // PrivateLinkCount: Count of private connections in the workspace + PrivateLinkCount *int `json:"privateLinkCount,omitempty"` + + // ProvisioningState: The current deployment state of workspace resource. The provisioningState is to indicate states for + // resource provisioning. + ProvisioningState *WorkspacePropertiesStatusProvisioningState `json:"provisioningState,omitempty"` + + // PublicNetworkAccess: Whether requests from Public Network are allowed. + PublicNetworkAccess *WorkspacePropertiesStatusPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + + // ServiceManagedResourcesSettings: The service managed resource settings. + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings_StatusARM `json:"serviceManagedResourcesSettings,omitempty"` + + // ServiceProvisionedResourceGroup: The name of the managed resource group created by workspace RP in customer subscription + // if the workspace is CMK workspace + ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"` + + // SharedPrivateLinkResources: The list of shared private link resources in this workspace. + SharedPrivateLinkResources []SharedPrivateLinkResource_StatusARM `json:"sharedPrivateLinkResources,omitempty"` + + // StorageAccount: ARM id of the storage account associated with this workspace. This cannot be changed once the workspace + // has been created + StorageAccount *string `json:"storageAccount,omitempty"` + + // StorageHnsEnabled: If the storage associated with the workspace has hierarchical namespace(HNS) enabled. + StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty"` + + // TenantId: The tenant id associated with this workspace. + TenantId *string `json:"tenantId,omitempty"` + + // WorkspaceId: The immutable id associated with this workspace. + WorkspaceId *string `json:"workspaceId,omitempty"` +} + +type EncryptionProperty_StatusARM struct { + // Identity: The identity that will be used to access the key vault for encryption at rest. + Identity *IdentityForCmk_StatusARM `json:"identity,omitempty"` + + // KeyVaultProperties: Customer Key vault properties. + KeyVaultProperties *KeyVaultProperties_StatusARM `json:"keyVaultProperties,omitempty"` + + // Status: Indicates whether or not the encryption is enabled for the workspace. + Status *EncryptionPropertyStatusStatus `json:"status,omitempty"` +} + +type NotebookResourceInfo_StatusARM struct { + Fqdn *string `json:"fqdn,omitempty"` + + // NotebookPreparationError: The error that occurs when preparing notebook. + NotebookPreparationError *NotebookPreparationError_StatusARM `json:"notebookPreparationError,omitempty"` + + // ResourceId: the data plane resourceId that used to initialize notebook component + ResourceId *string `json:"resourceId,omitempty"` +} + +type PrivateEndpointConnection_Status_SubResourceEmbeddedARM struct { + // 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_StatusARM `json:"identity,omitempty"` + + // Sku: The sku of the workspace. + Sku *Sku_StatusARM `json:"sku,omitempty"` + + // SystemData: System data + SystemData *SystemData_StatusARM `json:"systemData,omitempty"` +} + +type ServiceManagedResourcesSettings_StatusARM struct { + // CosmosDb: The settings for the service managed cosmosdb account. + CosmosDb *CosmosDbSettings_StatusARM `json:"cosmosDb,omitempty"` +} + +type SharedPrivateLinkResource_StatusARM struct { + // Name: Unique name of the private link. + Name *string `json:"name,omitempty"` + + // Properties: Resource properties. + Properties *SharedPrivateLinkResourceProperty_StatusARM `json:"properties,omitempty"` +} + +type CosmosDbSettings_StatusARM struct { + // CollectionsThroughput: The throughput of the collections in cosmosdb database + CollectionsThroughput *int `json:"collectionsThroughput,omitempty"` +} + +type IdentityForCmk_StatusARM struct { + // UserAssignedIdentity: The ArmId of the user assigned identity that will be used to access the customer managed key vault + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +type KeyVaultProperties_StatusARM struct { + // IdentityClientId: For future use - The client id of the identity which will be used to access key vault. + IdentityClientId *string `json:"identityClientId,omitempty"` + + // KeyIdentifier: Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + + // KeyVaultArmId: The ArmId of the keyVault where the customer owned encryption key is present. + KeyVaultArmId *string `json:"keyVaultArmId,omitempty"` +} + +type NotebookPreparationError_StatusARM struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +type SharedPrivateLinkResourceProperty_StatusARM struct { + // GroupId: The private link resource group id. + GroupId *string `json:"groupId,omitempty"` + + // PrivateLinkResourceId: The resource id that private link links to. + PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"` + + // RequestMessage: Request message. + RequestMessage *string `json:"requestMessage,omitempty"` + + // Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus_Status `json:"status,omitempty"` +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen_test.go new file mode 100644 index 0000000000..ea0598a9a4 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspace__status_arm_types_gen_test.go @@ -0,0 +1,872 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +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_Workspace_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspace_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceStatusARM, WorkspaceStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceStatusARM runs a test to see if a specific instance of Workspace_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceStatusARM(subject Workspace_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspace_StatusARM + 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_StatusARM instances for property testing - lazily instantiated by WorkspaceStatusARMGenerator() +var workspaceStatusARMGenerator gopter.Gen + +// WorkspaceStatusARMGenerator returns a generator of Workspace_StatusARM instances for property testing. +// We first initialize workspaceStatusARMGenerator 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 WorkspaceStatusARMGenerator() gopter.Gen { + if workspaceStatusARMGenerator != nil { + return workspaceStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceStatusARM(generators) + workspaceStatusARMGenerator = gen.Struct(reflect.TypeOf(Workspace_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceStatusARM(generators) + AddRelatedPropertyGeneratorsForWorkspaceStatusARM(generators) + workspaceStatusARMGenerator = gen.Struct(reflect.TypeOf(Workspace_StatusARM{}), generators) + + return workspaceStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceStatusARM(gens map[string]gopter.Gen) { + 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()) +} + +// AddRelatedPropertyGeneratorsForWorkspaceStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceStatusARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityStatusARMGenerator()) + gens["Properties"] = gen.PtrOf(WorkspacePropertiesStatusARMGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusARMGenerator()) +} + +func Test_WorkspaceProperties_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspaceProperties_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacePropertiesStatusARM, WorkspacePropertiesStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacePropertiesStatusARM runs a test to see if a specific instance of WorkspaceProperties_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacePropertiesStatusARM(subject WorkspaceProperties_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceProperties_StatusARM + 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_StatusARM instances for property testing - lazily instantiated by +// WorkspacePropertiesStatusARMGenerator() +var workspacePropertiesStatusARMGenerator gopter.Gen + +// WorkspacePropertiesStatusARMGenerator returns a generator of WorkspaceProperties_StatusARM instances for property testing. +// We first initialize workspacePropertiesStatusARMGenerator 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 WorkspacePropertiesStatusARMGenerator() gopter.Gen { + if workspacePropertiesStatusARMGenerator != nil { + return workspacePropertiesStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM(generators) + workspacePropertiesStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM(generators) + AddRelatedPropertyGeneratorsForWorkspacePropertiesStatusARM(generators) + workspacePropertiesStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceProperties_StatusARM{}), generators) + + return workspacePropertiesStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacePropertiesStatusARM(gens map[string]gopter.Gen) { + gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool()) + gens["ApplicationInsights"] = gen.PtrOf(gen.AlphaString()) + gens["ContainerRegistry"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString()) + gens["FriendlyName"] = gen.PtrOf(gen.AlphaString()) + gens["HbiWorkspace"] = gen.PtrOf(gen.Bool()) + gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVault"] = gen.PtrOf(gen.AlphaString()) + gens["MlFlowTrackingUri"] = gen.PtrOf(gen.AlphaString()) + gens["PrimaryUserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateLinkCount"] = gen.PtrOf(gen.Int()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + WorkspacePropertiesStatusProvisioningStateCanceled, + WorkspacePropertiesStatusProvisioningStateCreating, + WorkspacePropertiesStatusProvisioningStateDeleting, + WorkspacePropertiesStatusProvisioningStateFailed, + WorkspacePropertiesStatusProvisioningStateSucceeded, + WorkspacePropertiesStatusProvisioningStateUnknown, + WorkspacePropertiesStatusProvisioningStateUpdating)) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(WorkspacePropertiesStatusPublicNetworkAccessDisabled, WorkspacePropertiesStatusPublicNetworkAccessEnabled)) + gens["ServiceProvisionedResourceGroup"] = gen.PtrOf(gen.AlphaString()) + gens["StorageAccount"] = gen.PtrOf(gen.AlphaString()) + gens["StorageHnsEnabled"] = gen.PtrOf(gen.Bool()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacePropertiesStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacePropertiesStatusARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionPropertyStatusARMGenerator()) + gens["NotebookInfo"] = gen.PtrOf(NotebookResourceInfoStatusARMGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator()) + gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsStatusARMGenerator()) + gens["SharedPrivateLinkResources"] = gen.SliceOf(SharedPrivateLinkResourceStatusARMGenerator()) +} + +func Test_EncryptionProperty_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of EncryptionProperty_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryptionPropertyStatusARM, EncryptionPropertyStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryptionPropertyStatusARM runs a test to see if a specific instance of EncryptionProperty_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryptionPropertyStatusARM(subject EncryptionProperty_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual EncryptionProperty_StatusARM + 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 EncryptionProperty_StatusARM instances for property testing - lazily instantiated by +// EncryptionPropertyStatusARMGenerator() +var encryptionPropertyStatusARMGenerator gopter.Gen + +// EncryptionPropertyStatusARMGenerator returns a generator of EncryptionProperty_StatusARM instances for property testing. +// We first initialize encryptionPropertyStatusARMGenerator 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 EncryptionPropertyStatusARMGenerator() gopter.Gen { + if encryptionPropertyStatusARMGenerator != nil { + return encryptionPropertyStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM(generators) + encryptionPropertyStatusARMGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM(generators) + AddRelatedPropertyGeneratorsForEncryptionPropertyStatusARM(generators) + encryptionPropertyStatusARMGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_StatusARM{}), generators) + + return encryptionPropertyStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryptionPropertyStatusARM(gens map[string]gopter.Gen) { + gens["Status"] = gen.PtrOf(gen.OneConstOf(EncryptionPropertyStatusStatusDisabled, EncryptionPropertyStatusStatusEnabled)) +} + +// AddRelatedPropertyGeneratorsForEncryptionPropertyStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryptionPropertyStatusARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityForCmkStatusARMGenerator()) + gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesStatusARMGenerator()) +} + +func Test_NotebookResourceInfo_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NotebookResourceInfo_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNotebookResourceInfoStatusARM, NotebookResourceInfoStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNotebookResourceInfoStatusARM runs a test to see if a specific instance of NotebookResourceInfo_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNotebookResourceInfoStatusARM(subject NotebookResourceInfo_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NotebookResourceInfo_StatusARM + 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 NotebookResourceInfo_StatusARM instances for property testing - lazily instantiated by +// NotebookResourceInfoStatusARMGenerator() +var notebookResourceInfoStatusARMGenerator gopter.Gen + +// NotebookResourceInfoStatusARMGenerator returns a generator of NotebookResourceInfo_StatusARM instances for property testing. +// We first initialize notebookResourceInfoStatusARMGenerator 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 NotebookResourceInfoStatusARMGenerator() gopter.Gen { + if notebookResourceInfoStatusARMGenerator != nil { + return notebookResourceInfoStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM(generators) + notebookResourceInfoStatusARMGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM(generators) + AddRelatedPropertyGeneratorsForNotebookResourceInfoStatusARM(generators) + notebookResourceInfoStatusARMGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_StatusARM{}), generators) + + return notebookResourceInfoStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNotebookResourceInfoStatusARM(gens map[string]gopter.Gen) { + gens["Fqdn"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNotebookResourceInfoStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNotebookResourceInfoStatusARM(gens map[string]gopter.Gen) { + gens["NotebookPreparationError"] = gen.PtrOf(NotebookPreparationErrorStatusARMGenerator()) +} + +func Test_PrivateEndpointConnection_Status_SubResourceEmbeddedARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PrivateEndpointConnection_Status_SubResourceEmbeddedARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbeddedARM, PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbeddedARM runs a test to see if a specific instance of PrivateEndpointConnection_Status_SubResourceEmbeddedARM round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(subject PrivateEndpointConnection_Status_SubResourceEmbeddedARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateEndpointConnection_Status_SubResourceEmbeddedARM + 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 PrivateEndpointConnection_Status_SubResourceEmbeddedARM instances for property testing - lazily +// instantiated by PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator() +var privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator gopter.Gen + +// PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator returns a generator of PrivateEndpointConnection_Status_SubResourceEmbeddedARM instances for property testing. +// We first initialize privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator 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 PrivateEndpointConnectionStatusSubResourceEmbeddedARMGenerator() gopter.Gen { + if privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator != nil { + return privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(generators) + privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbeddedARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(generators) + AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(generators) + privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbeddedARM{}), generators) + + return privateEndpointConnectionStatusSubResourceEmbeddedARMGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbeddedARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityStatusARMGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusARMGenerator()) +} + +func Test_ServiceManagedResourcesSettings_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ServiceManagedResourcesSettings_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettingsStatusARM, ServiceManagedResourcesSettingsStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForServiceManagedResourcesSettingsStatusARM runs a test to see if a specific instance of ServiceManagedResourcesSettings_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForServiceManagedResourcesSettingsStatusARM(subject ServiceManagedResourcesSettings_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ServiceManagedResourcesSettings_StatusARM + 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 ServiceManagedResourcesSettings_StatusARM instances for property testing - lazily instantiated by +// ServiceManagedResourcesSettingsStatusARMGenerator() +var serviceManagedResourcesSettingsStatusARMGenerator gopter.Gen + +// ServiceManagedResourcesSettingsStatusARMGenerator returns a generator of ServiceManagedResourcesSettings_StatusARM instances for property testing. +func ServiceManagedResourcesSettingsStatusARMGenerator() gopter.Gen { + if serviceManagedResourcesSettingsStatusARMGenerator != nil { + return serviceManagedResourcesSettingsStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatusARM(generators) + serviceManagedResourcesSettingsStatusARMGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings_StatusARM{}), generators) + + return serviceManagedResourcesSettingsStatusARMGenerator +} + +// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatusARM(gens map[string]gopter.Gen) { + gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsStatusARMGenerator()) +} + +func Test_SharedPrivateLinkResource_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SharedPrivateLinkResource_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourceStatusARM, SharedPrivateLinkResourceStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSharedPrivateLinkResourceStatusARM runs a test to see if a specific instance of SharedPrivateLinkResource_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSharedPrivateLinkResourceStatusARM(subject SharedPrivateLinkResource_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SharedPrivateLinkResource_StatusARM + 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 SharedPrivateLinkResource_StatusARM instances for property testing - lazily instantiated by +// SharedPrivateLinkResourceStatusARMGenerator() +var sharedPrivateLinkResourceStatusARMGenerator gopter.Gen + +// SharedPrivateLinkResourceStatusARMGenerator returns a generator of SharedPrivateLinkResource_StatusARM instances for property testing. +// We first initialize sharedPrivateLinkResourceStatusARMGenerator 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 SharedPrivateLinkResourceStatusARMGenerator() gopter.Gen { + if sharedPrivateLinkResourceStatusARMGenerator != nil { + return sharedPrivateLinkResourceStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(generators) + sharedPrivateLinkResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResource_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(generators) + AddRelatedPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(generators) + sharedPrivateLinkResourceStatusARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResource_StatusARM{}), generators) + + return sharedPrivateLinkResourceStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSharedPrivateLinkResourceStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSharedPrivateLinkResourceStatusARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SharedPrivateLinkResourcePropertyStatusARMGenerator()) +} + +func Test_CosmosDbSettings_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CosmosDbSettings_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCosmosDbSettingsStatusARM, CosmosDbSettingsStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCosmosDbSettingsStatusARM runs a test to see if a specific instance of CosmosDbSettings_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCosmosDbSettingsStatusARM(subject CosmosDbSettings_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CosmosDbSettings_StatusARM + 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 CosmosDbSettings_StatusARM instances for property testing - lazily instantiated by +// CosmosDbSettingsStatusARMGenerator() +var cosmosDbSettingsStatusARMGenerator gopter.Gen + +// CosmosDbSettingsStatusARMGenerator returns a generator of CosmosDbSettings_StatusARM instances for property testing. +func CosmosDbSettingsStatusARMGenerator() gopter.Gen { + if cosmosDbSettingsStatusARMGenerator != nil { + return cosmosDbSettingsStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCosmosDbSettingsStatusARM(generators) + cosmosDbSettingsStatusARMGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings_StatusARM{}), generators) + + return cosmosDbSettingsStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForCosmosDbSettingsStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCosmosDbSettingsStatusARM(gens map[string]gopter.Gen) { + gens["CollectionsThroughput"] = gen.PtrOf(gen.Int()) +} + +func Test_IdentityForCmk_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of IdentityForCmk_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityForCmkStatusARM, IdentityForCmkStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityForCmkStatusARM runs a test to see if a specific instance of IdentityForCmk_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityForCmkStatusARM(subject IdentityForCmk_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual IdentityForCmk_StatusARM + 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 IdentityForCmk_StatusARM instances for property testing - lazily instantiated by +// IdentityForCmkStatusARMGenerator() +var identityForCmkStatusARMGenerator gopter.Gen + +// IdentityForCmkStatusARMGenerator returns a generator of IdentityForCmk_StatusARM instances for property testing. +func IdentityForCmkStatusARMGenerator() gopter.Gen { + if identityForCmkStatusARMGenerator != nil { + return identityForCmkStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityForCmkStatusARM(generators) + identityForCmkStatusARMGenerator = gen.Struct(reflect.TypeOf(IdentityForCmk_StatusARM{}), generators) + + return identityForCmkStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityForCmkStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityForCmkStatusARM(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultProperties_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultPropertiesStatusARM, KeyVaultPropertiesStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultPropertiesStatusARM runs a test to see if a specific instance of KeyVaultProperties_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultPropertiesStatusARM(subject KeyVaultProperties_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties_StatusARM + 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 KeyVaultProperties_StatusARM instances for property testing - lazily instantiated by +// KeyVaultPropertiesStatusARMGenerator() +var keyVaultPropertiesStatusARMGenerator gopter.Gen + +// KeyVaultPropertiesStatusARMGenerator returns a generator of KeyVaultProperties_StatusARM instances for property testing. +func KeyVaultPropertiesStatusARMGenerator() gopter.Gen { + if keyVaultPropertiesStatusARMGenerator != nil { + return keyVaultPropertiesStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatusARM(generators) + keyVaultPropertiesStatusARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_StatusARM{}), generators) + + return keyVaultPropertiesStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatusARM(gens map[string]gopter.Gen) { + gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString()) + gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_NotebookPreparationError_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NotebookPreparationError_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNotebookPreparationErrorStatusARM, NotebookPreparationErrorStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNotebookPreparationErrorStatusARM runs a test to see if a specific instance of NotebookPreparationError_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNotebookPreparationErrorStatusARM(subject NotebookPreparationError_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NotebookPreparationError_StatusARM + 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 NotebookPreparationError_StatusARM instances for property testing - lazily instantiated by +// NotebookPreparationErrorStatusARMGenerator() +var notebookPreparationErrorStatusARMGenerator gopter.Gen + +// NotebookPreparationErrorStatusARMGenerator returns a generator of NotebookPreparationError_StatusARM instances for property testing. +func NotebookPreparationErrorStatusARMGenerator() gopter.Gen { + if notebookPreparationErrorStatusARMGenerator != nil { + return notebookPreparationErrorStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatusARM(generators) + notebookPreparationErrorStatusARMGenerator = gen.Struct(reflect.TypeOf(NotebookPreparationError_StatusARM{}), generators) + + return notebookPreparationErrorStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatusARM(gens map[string]gopter.Gen) { + gens["ErrorMessage"] = gen.PtrOf(gen.AlphaString()) + gens["StatusCode"] = gen.PtrOf(gen.Int()) +} + +func Test_SharedPrivateLinkResourceProperty_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SharedPrivateLinkResourceProperty_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourcePropertyStatusARM, SharedPrivateLinkResourcePropertyStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSharedPrivateLinkResourcePropertyStatusARM runs a test to see if a specific instance of SharedPrivateLinkResourceProperty_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSharedPrivateLinkResourcePropertyStatusARM(subject SharedPrivateLinkResourceProperty_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SharedPrivateLinkResourceProperty_StatusARM + 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 SharedPrivateLinkResourceProperty_StatusARM instances for property testing - lazily instantiated by +// SharedPrivateLinkResourcePropertyStatusARMGenerator() +var sharedPrivateLinkResourcePropertyStatusARMGenerator gopter.Gen + +// SharedPrivateLinkResourcePropertyStatusARMGenerator returns a generator of SharedPrivateLinkResourceProperty_StatusARM instances for property testing. +func SharedPrivateLinkResourcePropertyStatusARMGenerator() gopter.Gen { + if sharedPrivateLinkResourcePropertyStatusARMGenerator != nil { + return sharedPrivateLinkResourcePropertyStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyStatusARM(generators) + sharedPrivateLinkResourcePropertyStatusARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResourceProperty_StatusARM{}), generators) + + return sharedPrivateLinkResourcePropertyStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyStatusARM(gens map[string]gopter.Gen) { + gens["GroupId"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateLinkResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["RequestMessage"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + PrivateEndpointServiceConnectionStatus_StatusApproved, + PrivateEndpointServiceConnectionStatus_StatusDisconnected, + PrivateEndpointServiceConnectionStatus_StatusPending, + PrivateEndpointServiceConnectionStatus_StatusRejected, + PrivateEndpointServiceConnectionStatus_StatusTimeout)) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen.go new file mode 100644 index 0000000000..056467a3ca --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen.go @@ -0,0 +1,39 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +type WorkspaceConnection_StatusARM struct { + // Id: ResourceId of the workspace connection. + Id *string `json:"id,omitempty"` + + // Name: Friendly name of the workspace connection. + Name *string `json:"name,omitempty"` + + // Properties: Properties of workspace connection. + Properties *WorkspaceConnectionProps_StatusARM `json:"properties,omitempty"` + + // Type: Resource type of workspace connection. + Type *string `json:"type,omitempty"` +} + +type WorkspaceConnectionProps_StatusARM struct { + // AuthType: Authorization type of the workspace connection. + AuthType *string `json:"authType,omitempty"` + + // Category: Category of the workspace connection. + Category *string `json:"category,omitempty"` + + // Target: Target of the workspace connection. + Target *string `json:"target,omitempty"` + + // Value: Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // ValueFormat: format for the workspace connection value + ValueFormat *WorkspaceConnectionPropsStatusValueFormat `json:"valueFormat,omitempty"` +} + +type WorkspaceConnectionPropsStatusValueFormat string + +const WorkspaceConnectionPropsStatusValueFormatJSON = WorkspaceConnectionPropsStatusValueFormat("JSON") diff --git a/v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen_test.go new file mode 100644 index 0000000000..9c04c5eb24 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspace_connection__status_arm_types_gen_test.go @@ -0,0 +1,158 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +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_WorkspaceConnection_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspaceConnection_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionStatusARM, WorkspaceConnectionStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceConnectionStatusARM runs a test to see if a specific instance of WorkspaceConnection_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceConnectionStatusARM(subject WorkspaceConnection_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceConnection_StatusARM + 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 WorkspaceConnection_StatusARM instances for property testing - lazily instantiated by +// WorkspaceConnectionStatusARMGenerator() +var workspaceConnectionStatusARMGenerator gopter.Gen + +// WorkspaceConnectionStatusARMGenerator returns a generator of WorkspaceConnection_StatusARM instances for property testing. +// We first initialize workspaceConnectionStatusARMGenerator 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 WorkspaceConnectionStatusARMGenerator() gopter.Gen { + if workspaceConnectionStatusARMGenerator != nil { + return workspaceConnectionStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM(generators) + workspaceConnectionStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_StatusARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM(generators) + AddRelatedPropertyGeneratorsForWorkspaceConnectionStatusARM(generators) + workspaceConnectionStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_StatusARM{}), generators) + + return workspaceConnectionStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceConnectionStatusARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspaceConnectionStatusARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceConnectionStatusARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(WorkspaceConnectionPropsStatusARMGenerator()) +} + +func Test_WorkspaceConnectionProps_StatusARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspaceConnectionProps_StatusARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionPropsStatusARM, WorkspaceConnectionPropsStatusARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceConnectionPropsStatusARM runs a test to see if a specific instance of WorkspaceConnectionProps_StatusARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceConnectionPropsStatusARM(subject WorkspaceConnectionProps_StatusARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceConnectionProps_StatusARM + 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 WorkspaceConnectionProps_StatusARM instances for property testing - lazily instantiated by +// WorkspaceConnectionPropsStatusARMGenerator() +var workspaceConnectionPropsStatusARMGenerator gopter.Gen + +// WorkspaceConnectionPropsStatusARMGenerator returns a generator of WorkspaceConnectionProps_StatusARM instances for property testing. +func WorkspaceConnectionPropsStatusARMGenerator() gopter.Gen { + if workspaceConnectionPropsStatusARMGenerator != nil { + return workspaceConnectionPropsStatusARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsStatusARM(generators) + workspaceConnectionPropsStatusARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnectionProps_StatusARM{}), generators) + + return workspaceConnectionPropsStatusARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsStatusARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsStatusARM(gens map[string]gopter.Gen) { + gens["AuthType"] = gen.PtrOf(gen.AlphaString()) + gens["Category"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) + gens["Value"] = gen.PtrOf(gen.AlphaString()) + gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsStatusValueFormatJSON)) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspace_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspace_types_gen.go new file mode 100644 index 0000000000..cc62094c1e --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspace_types_gen.go @@ -0,0 +1,4997 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import ( + "fmt" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + kerrors "k8s.io/apimachinery/pkg/util/errors" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces +type Workspace struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Workspaces_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.(*v20210701s.Workspace) + if !ok { + return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/Workspace but received %T instead", hub) + } + + return workspace.AssignPropertiesFromWorkspace(source) +} + +// ConvertTo populates the provided hub Workspace from our Workspace +func (workspace *Workspace) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20210701s.Workspace) + if !ok { + return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/Workspace but received %T instead", hub) + } + + return workspace.AssignPropertiesToWorkspace(destination) +} + +// +kubebuilder:webhook:path=/mutate-machinelearningservices-azure-com-v1beta20210701-workspace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspaces,verbs=create;update,versions=v1beta20210701,name=default.v1beta20210701.workspaces.machinelearningservices.azure.com,admissionReviewVersions=v1beta1 + +var _ admission.Defaulter = &Workspace{} + +// Default applies defaults to the Workspace resource +func (workspace *Workspace) Default() { + workspace.defaultImpl() + var temp interface{} = workspace + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (workspace *Workspace) defaultAzureName() { + if workspace.Spec.AzureName == "" { + workspace.Spec.AzureName = workspace.Name + } +} + +// defaultImpl applies the code generated defaults to the Workspace resource +func (workspace *Workspace) defaultImpl() { workspace.defaultAzureName() } + +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 "2021-07-01" +func (workspace Workspace) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetResourceKind returns the kind of the resource +func (workspace *Workspace) GetResourceKind() genruntime.ResourceKind { + return genruntime.ResourceKindNormal +} + +// 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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces" +func (workspace *Workspace) GetType() string { + return "Microsoft.MachineLearningServices/workspaces" +} + +// NewEmptyStatus returns a new empty (blank) status +func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Workspace_Status{} +} + +// Owner returns the ResourceReference of the owner, or nil if there is no owner +func (workspace *Workspace) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: workspace.Spec.Owner.Name, + } +} + +// 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 errors.Wrap(err, "failed to convert status") + } + + workspace.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-machinelearningservices-azure-com-v1beta20210701-workspace,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspaces,verbs=create;update,versions=v1beta20210701,name=validate.v1beta20210701.workspaces.machinelearningservices.azure.com,admissionReviewVersions=v1beta1 + +var _ admission.Validator = &Workspace{} + +// ValidateCreate validates the creation of the resource +func (workspace *Workspace) ValidateCreate() error { + validations := workspace.createValidations() + var temp interface{} = workspace + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation() + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// ValidateDelete validates the deletion of the resource +func (workspace *Workspace) ValidateDelete() error { + validations := workspace.deleteValidations() + var temp interface{} = workspace + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation() + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// ValidateUpdate validates an update of the resource +func (workspace *Workspace) ValidateUpdate(old runtime.Object) error { + validations := workspace.updateValidations() + var temp interface{} = workspace + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation(old) + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// createValidations validates the creation of the resource +func (workspace *Workspace) createValidations() []func() error { + return []func() error{workspace.validateResourceReferences, workspace.validateSecretDestinations} +} + +// deleteValidations validates the deletion of the resource +func (workspace *Workspace) deleteValidations() []func() error { + return nil +} + +// updateValidations validates the update of the resource +func (workspace *Workspace) updateValidations() []func(old runtime.Object) error { + return []func(old runtime.Object) error{ + func(old runtime.Object) error { + return workspace.validateResourceReferences() + }, + workspace.validateWriteOnceProperties, + func(old runtime.Object) error { + return workspace.validateSecretDestinations() + }, + } +} + +// validateResourceReferences validates all resource references +func (workspace *Workspace) validateResourceReferences() error { + refs, err := reflecthelpers.FindResourceReferences(&workspace.Spec) + if err != nil { + return err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (workspace *Workspace) validateSecretDestinations() error { + if workspace.Spec.OperatorSpec == nil { + return nil + } + if workspace.Spec.OperatorSpec.Secrets == nil { + return nil + } + secrets := []*genruntime.SecretDestination{ + workspace.Spec.OperatorSpec.Secrets.AppInsightsInstrumentationKey, + workspace.Spec.OperatorSpec.Secrets.ContainerRegistryPassword, + workspace.Spec.OperatorSpec.Secrets.ContainerRegistryPassword2, + workspace.Spec.OperatorSpec.Secrets.ContainerRegistryUserName, + workspace.Spec.OperatorSpec.Secrets.PrimaryNotebookAccessKey, + workspace.Spec.OperatorSpec.Secrets.SecondaryNotebookAccessKey, + workspace.Spec.OperatorSpec.Secrets.UserStorageKey, + } + return genruntime.ValidateSecretDestinations(secrets) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (workspace *Workspace) validateWriteOnceProperties(old runtime.Object) error { + oldObj, ok := old.(*Workspace) + if !ok { + return nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, workspace) +} + +// AssignPropertiesFromWorkspace populates our Workspace from the provided source Workspace +func (workspace *Workspace) AssignPropertiesFromWorkspace(source *v20210701s.Workspace) error { + + // ObjectMeta + workspace.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Workspaces_Spec + err := spec.AssignPropertiesFromWorkspacesSpec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspacesSpec() to populate field Spec") + } + workspace.Spec = spec + + // Status + var status Workspace_Status + err = status.AssignPropertiesFromWorkspaceStatus(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspaceStatus() to populate field Status") + } + workspace.Status = status + + // No error + return nil +} + +// AssignPropertiesToWorkspace populates the provided destination Workspace from our Workspace +func (workspace *Workspace) AssignPropertiesToWorkspace(destination *v20210701s.Workspace) error { + + // ObjectMeta + destination.ObjectMeta = *workspace.ObjectMeta.DeepCopy() + + // Spec + var spec v20210701s.Workspaces_Spec + err := workspace.Spec.AssignPropertiesToWorkspacesSpec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspacesSpec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20210701s.Workspace_Status + err = workspace.Status.AssignPropertiesToWorkspaceStatus(&status) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspaceStatus() 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 +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces +type WorkspaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Workspace `json:"items"` +} + +// +kubebuilder:validation:Enum={"2021-07-01"} +type APIVersion string + +const APIVersionValue = APIVersion("2021-07-01") + +type Workspace_Status struct { + // AllowPublicAccessWhenBehindVnet: The flag to indicate whether to allow public access when behind VNet. + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + + // ApplicationInsights: ARM id of the application insights associated with this workspace. This cannot be changed once the + // workspace has been created + ApplicationInsights *string `json:"applicationInsights,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // ContainerRegistry: ARM id of the container registry associated with this workspace. This cannot be changed once the + // workspace has been created + ContainerRegistry *string `json:"containerRegistry,omitempty"` + + // Description: The description of this workspace. + Description *string `json:"description,omitempty"` + + // DiscoveryUrl: Url for the discovery service to identify regional endpoints for machine learning experimentation services + DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + + // Encryption: The encryption settings of Azure ML workspace. + Encryption *EncryptionProperty_Status `json:"encryption,omitempty"` + + // FriendlyName: The friendly name for this workspace. This name in mutable + FriendlyName *string `json:"friendlyName,omitempty"` + + // HbiWorkspace: The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + HbiWorkspace *bool `json:"hbiWorkspace,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"` + + // ImageBuildCompute: The compute name for image build + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + + // KeyVault: ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been + // created + KeyVault *string `json:"keyVault,omitempty"` + + // Location: Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // MlFlowTrackingUri: The URI associated with this workspace that machine learning flow must point at to set up tracking. + MlFlowTrackingUri *string `json:"mlFlowTrackingUri,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // NotebookInfo: The notebook info of Azure ML workspace. + NotebookInfo *NotebookResourceInfo_Status `json:"notebookInfo,omitempty"` + + // PrimaryUserAssignedIdentity: The user assigned identity resource id that represents the workspace identity. + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + + // PrivateEndpointConnections: The list of private endpoint connections in the workspace. + PrivateEndpointConnections []PrivateEndpointConnection_Status_SubResourceEmbedded `json:"privateEndpointConnections,omitempty"` + + // PrivateLinkCount: Count of private connections in the workspace + PrivateLinkCount *int `json:"privateLinkCount,omitempty"` + + // ProvisioningState: The current deployment state of workspace resource. The provisioningState is to indicate states for + // resource provisioning. + ProvisioningState *WorkspacePropertiesStatusProvisioningState `json:"provisioningState,omitempty"` + + // PublicNetworkAccess: Whether requests from Public Network are allowed. + PublicNetworkAccess *WorkspacePropertiesStatusPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + + // ServiceManagedResourcesSettings: The service managed resource settings. + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings_Status `json:"serviceManagedResourcesSettings,omitempty"` + + // ServiceProvisionedResourceGroup: The name of the managed resource group created by workspace RP in customer subscription + // if the workspace is CMK workspace + ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"` + + // SharedPrivateLinkResources: The list of shared private link resources in this workspace. + SharedPrivateLinkResources []SharedPrivateLinkResource_Status `json:"sharedPrivateLinkResources,omitempty"` + + // Sku: The sku of the workspace. + Sku *Sku_Status `json:"sku,omitempty"` + + // StorageAccount: ARM id of the storage account associated with this workspace. This cannot be changed once the workspace + // has been created + StorageAccount *string `json:"storageAccount,omitempty"` + + // StorageHnsEnabled: If the storage associated with the workspace has hierarchical namespace(HNS) enabled. + StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty"` + + // SystemData: System data + SystemData *SystemData_Status `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + Tags map[string]string `json:"tags,omitempty"` + + // TenantId: The tenant id associated with this workspace. + TenantId *string `json:"tenantId,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + + // WorkspaceId: The immutable id associated with this workspace. + WorkspaceId *string `json:"workspaceId,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.(*v20210701s.Workspace_Status) + if ok { + // Populate our instance from source + return workspace.AssignPropertiesFromWorkspaceStatus(src) + } + + // Convert to an intermediate form + src = &v20210701s.Workspace_Status{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = workspace.AssignPropertiesFromWorkspaceStatus(src) + if err != nil { + return errors.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.(*v20210701s.Workspace_Status) + if ok { + // Populate destination from our instance + return workspace.AssignPropertiesToWorkspaceStatus(dst) + } + + // Convert to an intermediate form + dst = &v20210701s.Workspace_Status{} + err := workspace.AssignPropertiesToWorkspaceStatus(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return errors.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 &Workspace_StatusARM{} +} + +// 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.(Workspace_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Workspace_StatusARM, got %T", armInput) + } + + // Set property ‘AllowPublicAccessWhenBehindVnet’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AllowPublicAccessWhenBehindVnet != nil { + allowPublicAccessWhenBehindVnet := *typedInput.Properties.AllowPublicAccessWhenBehindVnet + workspace.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet + } + } + + // Set property ‘ApplicationInsights’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ApplicationInsights != nil { + applicationInsights := *typedInput.Properties.ApplicationInsights + workspace.ApplicationInsights = &applicationInsights + } + } + + // no assignment for property ‘Conditions’ + + // Set property ‘ContainerRegistry’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ContainerRegistry != nil { + containerRegistry := *typedInput.Properties.ContainerRegistry + workspace.ContainerRegistry = &containerRegistry + } + } + + // Set property ‘Description’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Description != nil { + description := *typedInput.Properties.Description + workspace.Description = &description + } + } + + // Set property ‘DiscoveryUrl’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DiscoveryUrl != nil { + discoveryUrl := *typedInput.Properties.DiscoveryUrl + workspace.DiscoveryUrl = &discoveryUrl + } + } + + // Set property ‘Encryption’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Encryption != nil { + var encryption1 EncryptionProperty_Status + err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption) + if err != nil { + return err + } + encryption := encryption1 + workspace.Encryption = &encryption + } + } + + // Set property ‘FriendlyName’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.FriendlyName != nil { + friendlyName := *typedInput.Properties.FriendlyName + workspace.FriendlyName = &friendlyName + } + } + + // Set property ‘HbiWorkspace’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.HbiWorkspace != nil { + hbiWorkspace := *typedInput.Properties.HbiWorkspace + workspace.HbiWorkspace = &hbiWorkspace + } + } + + // 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 ‘ImageBuildCompute’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ImageBuildCompute != nil { + imageBuildCompute := *typedInput.Properties.ImageBuildCompute + workspace.ImageBuildCompute = &imageBuildCompute + } + } + + // Set property ‘KeyVault’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.KeyVault != nil { + keyVault := *typedInput.Properties.KeyVault + workspace.KeyVault = &keyVault + } + } + + // Set property ‘Location’: + if typedInput.Location != nil { + location := *typedInput.Location + workspace.Location = &location + } + + // Set property ‘MlFlowTrackingUri’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MlFlowTrackingUri != nil { + mlFlowTrackingUri := *typedInput.Properties.MlFlowTrackingUri + workspace.MlFlowTrackingUri = &mlFlowTrackingUri + } + } + + // Set property ‘Name’: + if typedInput.Name != nil { + name := *typedInput.Name + workspace.Name = &name + } + + // Set property ‘NotebookInfo’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.NotebookInfo != nil { + var notebookInfo1 NotebookResourceInfo_Status + err := notebookInfo1.PopulateFromARM(owner, *typedInput.Properties.NotebookInfo) + if err != nil { + return err + } + notebookInfo := notebookInfo1 + workspace.NotebookInfo = ¬ebookInfo + } + } + + // Set property ‘PrimaryUserAssignedIdentity’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PrimaryUserAssignedIdentity != nil { + primaryUserAssignedIdentity := *typedInput.Properties.PrimaryUserAssignedIdentity + workspace.PrimaryUserAssignedIdentity = &primaryUserAssignedIdentity + } + } + + // Set property ‘PrivateEndpointConnections’: + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.PrivateEndpointConnections { + var item1 PrivateEndpointConnection_Status_SubResourceEmbedded + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + workspace.PrivateEndpointConnections = append(workspace.PrivateEndpointConnections, item1) + } + } + + // Set property ‘PrivateLinkCount’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PrivateLinkCount != nil { + privateLinkCount := *typedInput.Properties.PrivateLinkCount + workspace.PrivateLinkCount = &privateLinkCount + } + } + + // Set property ‘ProvisioningState’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ProvisioningState != nil { + provisioningState := *typedInput.Properties.ProvisioningState + workspace.ProvisioningState = &provisioningState + } + } + + // Set property ‘PublicNetworkAccess’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccess != nil { + publicNetworkAccess := *typedInput.Properties.PublicNetworkAccess + workspace.PublicNetworkAccess = &publicNetworkAccess + } + } + + // Set property ‘ServiceManagedResourcesSettings’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ServiceManagedResourcesSettings != nil { + var serviceManagedResourcesSettings1 ServiceManagedResourcesSettings_Status + err := serviceManagedResourcesSettings1.PopulateFromARM(owner, *typedInput.Properties.ServiceManagedResourcesSettings) + if err != nil { + return err + } + serviceManagedResourcesSettings := serviceManagedResourcesSettings1 + workspace.ServiceManagedResourcesSettings = &serviceManagedResourcesSettings + } + } + + // Set property ‘ServiceProvisionedResourceGroup’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ServiceProvisionedResourceGroup != nil { + serviceProvisionedResourceGroup := *typedInput.Properties.ServiceProvisionedResourceGroup + workspace.ServiceProvisionedResourceGroup = &serviceProvisionedResourceGroup + } + } + + // Set property ‘SharedPrivateLinkResources’: + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.SharedPrivateLinkResources { + var item1 SharedPrivateLinkResource_Status + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + workspace.SharedPrivateLinkResources = append(workspace.SharedPrivateLinkResources, item1) + } + } + + // Set property ‘Sku’: + if typedInput.Sku != nil { + var sku1 Sku_Status + err := sku1.PopulateFromARM(owner, *typedInput.Sku) + if err != nil { + return err + } + sku := sku1 + workspace.Sku = &sku + } + + // Set property ‘StorageAccount’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.StorageAccount != nil { + storageAccount := *typedInput.Properties.StorageAccount + workspace.StorageAccount = &storageAccount + } + } + + // Set property ‘StorageHnsEnabled’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.StorageHnsEnabled != nil { + storageHnsEnabled := *typedInput.Properties.StorageHnsEnabled + workspace.StorageHnsEnabled = &storageHnsEnabled + } + } + + // 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 ‘TenantId’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.TenantId != nil { + tenantId := *typedInput.Properties.TenantId + workspace.TenantId = &tenantId + } + } + + // Set property ‘Type’: + if typedInput.Type != nil { + typeVar := *typedInput.Type + workspace.Type = &typeVar + } + + // Set property ‘WorkspaceId’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.WorkspaceId != nil { + workspaceId := *typedInput.Properties.WorkspaceId + workspace.WorkspaceId = &workspaceId + } + } + + // No error + return nil +} + +// AssignPropertiesFromWorkspaceStatus populates our Workspace_Status from the provided source Workspace_Status +func (workspace *Workspace_Status) AssignPropertiesFromWorkspaceStatus(source *v20210701s.Workspace_Status) error { + + // AllowPublicAccessWhenBehindVnet + if source.AllowPublicAccessWhenBehindVnet != nil { + allowPublicAccessWhenBehindVnet := *source.AllowPublicAccessWhenBehindVnet + workspace.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet + } else { + workspace.AllowPublicAccessWhenBehindVnet = nil + } + + // ApplicationInsights + workspace.ApplicationInsights = genruntime.ClonePointerToString(source.ApplicationInsights) + + // Conditions + workspace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // ContainerRegistry + workspace.ContainerRegistry = genruntime.ClonePointerToString(source.ContainerRegistry) + + // Description + workspace.Description = genruntime.ClonePointerToString(source.Description) + + // DiscoveryUrl + workspace.DiscoveryUrl = genruntime.ClonePointerToString(source.DiscoveryUrl) + + // Encryption + if source.Encryption != nil { + var encryption EncryptionProperty_Status + err := encryption.AssignPropertiesFromEncryptionPropertyStatus(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromEncryptionPropertyStatus() to populate field Encryption") + } + workspace.Encryption = &encryption + } else { + workspace.Encryption = nil + } + + // FriendlyName + workspace.FriendlyName = genruntime.ClonePointerToString(source.FriendlyName) + + // HbiWorkspace + if source.HbiWorkspace != nil { + hbiWorkspace := *source.HbiWorkspace + workspace.HbiWorkspace = &hbiWorkspace + } else { + workspace.HbiWorkspace = nil + } + + // Id + workspace.Id = genruntime.ClonePointerToString(source.Id) + + // Identity + if source.Identity != nil { + var identity Identity_Status + err := identity.AssignPropertiesFromIdentityStatus(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromIdentityStatus() to populate field Identity") + } + workspace.Identity = &identity + } else { + workspace.Identity = nil + } + + // ImageBuildCompute + workspace.ImageBuildCompute = genruntime.ClonePointerToString(source.ImageBuildCompute) + + // KeyVault + workspace.KeyVault = genruntime.ClonePointerToString(source.KeyVault) + + // Location + workspace.Location = genruntime.ClonePointerToString(source.Location) + + // MlFlowTrackingUri + workspace.MlFlowTrackingUri = genruntime.ClonePointerToString(source.MlFlowTrackingUri) + + // Name + workspace.Name = genruntime.ClonePointerToString(source.Name) + + // NotebookInfo + if source.NotebookInfo != nil { + var notebookInfo NotebookResourceInfo_Status + err := notebookInfo.AssignPropertiesFromNotebookResourceInfoStatus(source.NotebookInfo) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromNotebookResourceInfoStatus() to populate field NotebookInfo") + } + workspace.NotebookInfo = ¬ebookInfo + } else { + workspace.NotebookInfo = nil + } + + // PrimaryUserAssignedIdentity + workspace.PrimaryUserAssignedIdentity = genruntime.ClonePointerToString(source.PrimaryUserAssignedIdentity) + + // PrivateEndpointConnections + if source.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]PrivateEndpointConnection_Status_SubResourceEmbedded, len(source.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range source.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection PrivateEndpointConnection_Status_SubResourceEmbedded + err := privateEndpointConnection.AssignPropertiesFromPrivateEndpointConnectionStatusSubResourceEmbedded(&privateEndpointConnectionItem) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromPrivateEndpointConnectionStatusSubResourceEmbedded() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + workspace.PrivateEndpointConnections = privateEndpointConnectionList + } else { + workspace.PrivateEndpointConnections = nil + } + + // PrivateLinkCount + workspace.PrivateLinkCount = genruntime.ClonePointerToInt(source.PrivateLinkCount) + + // ProvisioningState + if source.ProvisioningState != nil { + provisioningState := WorkspacePropertiesStatusProvisioningState(*source.ProvisioningState) + workspace.ProvisioningState = &provisioningState + } else { + workspace.ProvisioningState = nil + } + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + publicNetworkAccess := WorkspacePropertiesStatusPublicNetworkAccess(*source.PublicNetworkAccess) + workspace.PublicNetworkAccess = &publicNetworkAccess + } else { + workspace.PublicNetworkAccess = nil + } + + // ServiceManagedResourcesSettings + if source.ServiceManagedResourcesSettings != nil { + var serviceManagedResourcesSetting ServiceManagedResourcesSettings_Status + err := serviceManagedResourcesSetting.AssignPropertiesFromServiceManagedResourcesSettingsStatus(source.ServiceManagedResourcesSettings) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromServiceManagedResourcesSettingsStatus() to populate field ServiceManagedResourcesSettings") + } + workspace.ServiceManagedResourcesSettings = &serviceManagedResourcesSetting + } else { + workspace.ServiceManagedResourcesSettings = nil + } + + // ServiceProvisionedResourceGroup + workspace.ServiceProvisionedResourceGroup = genruntime.ClonePointerToString(source.ServiceProvisionedResourceGroup) + + // SharedPrivateLinkResources + if source.SharedPrivateLinkResources != nil { + sharedPrivateLinkResourceList := make([]SharedPrivateLinkResource_Status, len(source.SharedPrivateLinkResources)) + for sharedPrivateLinkResourceIndex, sharedPrivateLinkResourceItem := range source.SharedPrivateLinkResources { + // Shadow the loop variable to avoid aliasing + sharedPrivateLinkResourceItem := sharedPrivateLinkResourceItem + var sharedPrivateLinkResource SharedPrivateLinkResource_Status + err := sharedPrivateLinkResource.AssignPropertiesFromSharedPrivateLinkResourceStatus(&sharedPrivateLinkResourceItem) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSharedPrivateLinkResourceStatus() to populate field SharedPrivateLinkResources") + } + sharedPrivateLinkResourceList[sharedPrivateLinkResourceIndex] = sharedPrivateLinkResource + } + workspace.SharedPrivateLinkResources = sharedPrivateLinkResourceList + } else { + workspace.SharedPrivateLinkResources = nil + } + + // Sku + if source.Sku != nil { + var sku Sku_Status + err := sku.AssignPropertiesFromSkuStatus(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSkuStatus() to populate field Sku") + } + workspace.Sku = &sku + } else { + workspace.Sku = nil + } + + // StorageAccount + workspace.StorageAccount = genruntime.ClonePointerToString(source.StorageAccount) + + // StorageHnsEnabled + if source.StorageHnsEnabled != nil { + storageHnsEnabled := *source.StorageHnsEnabled + workspace.StorageHnsEnabled = &storageHnsEnabled + } else { + workspace.StorageHnsEnabled = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_Status + err := systemDatum.AssignPropertiesFromSystemDataStatus(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSystemDataStatus() to populate field SystemData") + } + workspace.SystemData = &systemDatum + } else { + workspace.SystemData = nil + } + + // Tags + workspace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // TenantId + workspace.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // Type + workspace.Type = genruntime.ClonePointerToString(source.Type) + + // WorkspaceId + workspace.WorkspaceId = genruntime.ClonePointerToString(source.WorkspaceId) + + // No error + return nil +} + +// AssignPropertiesToWorkspaceStatus populates the provided destination Workspace_Status from our Workspace_Status +func (workspace *Workspace_Status) AssignPropertiesToWorkspaceStatus(destination *v20210701s.Workspace_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AllowPublicAccessWhenBehindVnet + if workspace.AllowPublicAccessWhenBehindVnet != nil { + allowPublicAccessWhenBehindVnet := *workspace.AllowPublicAccessWhenBehindVnet + destination.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet + } else { + destination.AllowPublicAccessWhenBehindVnet = nil + } + + // ApplicationInsights + destination.ApplicationInsights = genruntime.ClonePointerToString(workspace.ApplicationInsights) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(workspace.Conditions) + + // ContainerRegistry + destination.ContainerRegistry = genruntime.ClonePointerToString(workspace.ContainerRegistry) + + // Description + destination.Description = genruntime.ClonePointerToString(workspace.Description) + + // DiscoveryUrl + destination.DiscoveryUrl = genruntime.ClonePointerToString(workspace.DiscoveryUrl) + + // Encryption + if workspace.Encryption != nil { + var encryption v20210701s.EncryptionProperty_Status + err := workspace.Encryption.AssignPropertiesToEncryptionPropertyStatus(&encryption) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToEncryptionPropertyStatus() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // FriendlyName + destination.FriendlyName = genruntime.ClonePointerToString(workspace.FriendlyName) + + // HbiWorkspace + if workspace.HbiWorkspace != nil { + hbiWorkspace := *workspace.HbiWorkspace + destination.HbiWorkspace = &hbiWorkspace + } else { + destination.HbiWorkspace = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(workspace.Id) + + // Identity + if workspace.Identity != nil { + var identity v20210701s.Identity_Status + err := workspace.Identity.AssignPropertiesToIdentityStatus(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToIdentityStatus() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // ImageBuildCompute + destination.ImageBuildCompute = genruntime.ClonePointerToString(workspace.ImageBuildCompute) + + // KeyVault + destination.KeyVault = genruntime.ClonePointerToString(workspace.KeyVault) + + // Location + destination.Location = genruntime.ClonePointerToString(workspace.Location) + + // MlFlowTrackingUri + destination.MlFlowTrackingUri = genruntime.ClonePointerToString(workspace.MlFlowTrackingUri) + + // Name + destination.Name = genruntime.ClonePointerToString(workspace.Name) + + // NotebookInfo + if workspace.NotebookInfo != nil { + var notebookInfo v20210701s.NotebookResourceInfo_Status + err := workspace.NotebookInfo.AssignPropertiesToNotebookResourceInfoStatus(¬ebookInfo) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToNotebookResourceInfoStatus() to populate field NotebookInfo") + } + destination.NotebookInfo = ¬ebookInfo + } else { + destination.NotebookInfo = nil + } + + // PrimaryUserAssignedIdentity + destination.PrimaryUserAssignedIdentity = genruntime.ClonePointerToString(workspace.PrimaryUserAssignedIdentity) + + // PrivateEndpointConnections + if workspace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]v20210701s.PrivateEndpointConnection_Status_SubResourceEmbedded, len(workspace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range workspace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection v20210701s.PrivateEndpointConnection_Status_SubResourceEmbedded + err := privateEndpointConnectionItem.AssignPropertiesToPrivateEndpointConnectionStatusSubResourceEmbedded(&privateEndpointConnection) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToPrivateEndpointConnectionStatusSubResourceEmbedded() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + destination.PrivateEndpointConnections = privateEndpointConnectionList + } else { + destination.PrivateEndpointConnections = nil + } + + // PrivateLinkCount + destination.PrivateLinkCount = genruntime.ClonePointerToInt(workspace.PrivateLinkCount) + + // ProvisioningState + if workspace.ProvisioningState != nil { + provisioningState := string(*workspace.ProvisioningState) + destination.ProvisioningState = &provisioningState + } else { + destination.ProvisioningState = nil + } + + // PublicNetworkAccess + if workspace.PublicNetworkAccess != nil { + publicNetworkAccess := string(*workspace.PublicNetworkAccess) + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // ServiceManagedResourcesSettings + if workspace.ServiceManagedResourcesSettings != nil { + var serviceManagedResourcesSetting v20210701s.ServiceManagedResourcesSettings_Status + err := workspace.ServiceManagedResourcesSettings.AssignPropertiesToServiceManagedResourcesSettingsStatus(&serviceManagedResourcesSetting) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToServiceManagedResourcesSettingsStatus() to populate field ServiceManagedResourcesSettings") + } + destination.ServiceManagedResourcesSettings = &serviceManagedResourcesSetting + } else { + destination.ServiceManagedResourcesSettings = nil + } + + // ServiceProvisionedResourceGroup + destination.ServiceProvisionedResourceGroup = genruntime.ClonePointerToString(workspace.ServiceProvisionedResourceGroup) + + // SharedPrivateLinkResources + if workspace.SharedPrivateLinkResources != nil { + sharedPrivateLinkResourceList := make([]v20210701s.SharedPrivateLinkResource_Status, len(workspace.SharedPrivateLinkResources)) + for sharedPrivateLinkResourceIndex, sharedPrivateLinkResourceItem := range workspace.SharedPrivateLinkResources { + // Shadow the loop variable to avoid aliasing + sharedPrivateLinkResourceItem := sharedPrivateLinkResourceItem + var sharedPrivateLinkResource v20210701s.SharedPrivateLinkResource_Status + err := sharedPrivateLinkResourceItem.AssignPropertiesToSharedPrivateLinkResourceStatus(&sharedPrivateLinkResource) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSharedPrivateLinkResourceStatus() to populate field SharedPrivateLinkResources") + } + sharedPrivateLinkResourceList[sharedPrivateLinkResourceIndex] = sharedPrivateLinkResource + } + destination.SharedPrivateLinkResources = sharedPrivateLinkResourceList + } else { + destination.SharedPrivateLinkResources = nil + } + + // Sku + if workspace.Sku != nil { + var sku v20210701s.Sku_Status + err := workspace.Sku.AssignPropertiesToSkuStatus(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSkuStatus() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // StorageAccount + destination.StorageAccount = genruntime.ClonePointerToString(workspace.StorageAccount) + + // StorageHnsEnabled + if workspace.StorageHnsEnabled != nil { + storageHnsEnabled := *workspace.StorageHnsEnabled + destination.StorageHnsEnabled = &storageHnsEnabled + } else { + destination.StorageHnsEnabled = nil + } + + // SystemData + if workspace.SystemData != nil { + var systemDatum v20210701s.SystemData_Status + err := workspace.SystemData.AssignPropertiesToSystemDataStatus(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSystemDataStatus() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(workspace.Tags) + + // TenantId + destination.TenantId = genruntime.ClonePointerToString(workspace.TenantId) + + // Type + destination.Type = genruntime.ClonePointerToString(workspace.Type) + + // WorkspaceId + destination.WorkspaceId = genruntime.ClonePointerToString(workspace.WorkspaceId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Workspaces_Spec struct { + // AllowPublicAccessWhenBehindVnet: The flag to indicate whether to allow public access when behind VNet. + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + + // ApplicationInsightsReference: ARM id of the application insights associated with this workspace. This cannot be changed + // once the workspace has been created + ApplicationInsightsReference *genruntime.ResourceReference `armReference:"ApplicationInsights" json:"applicationInsightsReference,omitempty"` + + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + + // ContainerRegistryReference: ARM id of the container registry associated with this workspace. This cannot be changed once + // the workspace has been created + ContainerRegistryReference *genruntime.ResourceReference `armReference:"ContainerRegistry" json:"containerRegistryReference,omitempty"` + + // Description: The description of this workspace. + Description *string `json:"description,omitempty"` + + // DiscoveryUrl: Url for the discovery service to identify regional endpoints for machine learning experimentation services + DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + Encryption *EncryptionProperty `json:"encryption,omitempty"` + + // FriendlyName: The friendly name for this workspace. This name in mutable + FriendlyName *string `json:"friendlyName,omitempty"` + + // HbiWorkspace: The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + + // Identity: Identity for the resource. + Identity *Identity `json:"identity,omitempty"` + + // ImageBuildCompute: The compute name for image build + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + + // KeyVaultReference: ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has + // been created + KeyVaultReference *genruntime.ResourceReference `armReference:"KeyVault" json:"keyVaultReference,omitempty"` + + // Location: Specifies the location of the resource. + 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"` + + // PrimaryUserAssignedIdentityReference: The user assigned identity resource id that represents the workspace identity. + PrimaryUserAssignedIdentityReference *genruntime.ResourceReference `armReference:"PrimaryUserAssignedIdentity" json:"primaryUserAssignedIdentityReference,omitempty"` + + // PublicNetworkAccess: Whether requests from Public Network are allowed. + PublicNetworkAccess *WorkspacesSpecPropertiesPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` + + // SharedPrivateLinkResources: The list of shared private link resources in this workspace. + SharedPrivateLinkResources []Workspaces_Spec_Properties_SharedPrivateLinkResources `json:"sharedPrivateLinkResources,omitempty"` + + // Sku: Sku of the resource + Sku *Sku `json:"sku,omitempty"` + + // StorageAccountReference: ARM id of the storage account associated with this workspace. This cannot be changed once the + // workspace has been created + StorageAccountReference *genruntime.ResourceReference `armReference:"StorageAccount" json:"storageAccountReference,omitempty"` + + // SystemData: Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMTransformer = &Workspaces_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (workspaces *Workspaces_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if workspaces == nil { + return nil, nil + } + result := &Workspaces_SpecARM{} + + // Set property ‘Identity’: + if workspaces.Identity != nil { + identityARM, err := (*workspaces.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identityARM.(*IdentityARM) + result.Identity = &identity + } + + // Set property ‘Location’: + if workspaces.Location != nil { + location := *workspaces.Location + result.Location = &location + } + + // Set property ‘Name’: + result.Name = resolved.Name + + // Set property ‘Properties’: + if workspaces.AllowPublicAccessWhenBehindVnet != nil || + workspaces.ApplicationInsightsReference != nil || + workspaces.ContainerRegistryReference != nil || + workspaces.Description != nil || + workspaces.DiscoveryUrl != nil || + workspaces.Encryption != nil || + workspaces.FriendlyName != nil || + workspaces.HbiWorkspace != nil || + workspaces.ImageBuildCompute != nil || + workspaces.KeyVaultReference != nil || + workspaces.PrimaryUserAssignedIdentityReference != nil || + workspaces.PublicNetworkAccess != nil || + workspaces.ServiceManagedResourcesSettings != nil || + workspaces.SharedPrivateLinkResources != nil || + workspaces.StorageAccountReference != nil { + result.Properties = &Workspaces_Spec_PropertiesARM{} + } + if workspaces.AllowPublicAccessWhenBehindVnet != nil { + allowPublicAccessWhenBehindVnet := *workspaces.AllowPublicAccessWhenBehindVnet + result.Properties.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet + } + if workspaces.ApplicationInsightsReference != nil { + applicationInsightsARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*workspaces.ApplicationInsightsReference) + if err != nil { + return nil, err + } + applicationInsights := applicationInsightsARMID + result.Properties.ApplicationInsights = &applicationInsights + } + if workspaces.ContainerRegistryReference != nil { + containerRegistryARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*workspaces.ContainerRegistryReference) + if err != nil { + return nil, err + } + containerRegistry := containerRegistryARMID + result.Properties.ContainerRegistry = &containerRegistry + } + if workspaces.Description != nil { + description := *workspaces.Description + result.Properties.Description = &description + } + if workspaces.DiscoveryUrl != nil { + discoveryUrl := *workspaces.DiscoveryUrl + result.Properties.DiscoveryUrl = &discoveryUrl + } + if workspaces.Encryption != nil { + encryptionARM, err := (*workspaces.Encryption).ConvertToARM(resolved) + if err != nil { + return nil, err + } + encryption := *encryptionARM.(*EncryptionPropertyARM) + result.Properties.Encryption = &encryption + } + if workspaces.FriendlyName != nil { + friendlyName := *workspaces.FriendlyName + result.Properties.FriendlyName = &friendlyName + } + if workspaces.HbiWorkspace != nil { + hbiWorkspace := *workspaces.HbiWorkspace + result.Properties.HbiWorkspace = &hbiWorkspace + } + if workspaces.ImageBuildCompute != nil { + imageBuildCompute := *workspaces.ImageBuildCompute + result.Properties.ImageBuildCompute = &imageBuildCompute + } + if workspaces.KeyVaultReference != nil { + keyVaultARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*workspaces.KeyVaultReference) + if err != nil { + return nil, err + } + keyVault := keyVaultARMID + result.Properties.KeyVault = &keyVault + } + if workspaces.PrimaryUserAssignedIdentityReference != nil { + primaryUserAssignedIdentityARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*workspaces.PrimaryUserAssignedIdentityReference) + if err != nil { + return nil, err + } + primaryUserAssignedIdentity := primaryUserAssignedIdentityARMID + result.Properties.PrimaryUserAssignedIdentity = &primaryUserAssignedIdentity + } + if workspaces.PublicNetworkAccess != nil { + publicNetworkAccess := *workspaces.PublicNetworkAccess + result.Properties.PublicNetworkAccess = &publicNetworkAccess + } + if workspaces.ServiceManagedResourcesSettings != nil { + serviceManagedResourcesSettingsARM, err := (*workspaces.ServiceManagedResourcesSettings).ConvertToARM(resolved) + if err != nil { + return nil, err + } + serviceManagedResourcesSettings := *serviceManagedResourcesSettingsARM.(*ServiceManagedResourcesSettingsARM) + result.Properties.ServiceManagedResourcesSettings = &serviceManagedResourcesSettings + } + for _, item := range workspaces.SharedPrivateLinkResources { + itemARM, err := item.ConvertToARM(resolved) + if err != nil { + return nil, err + } + result.Properties.SharedPrivateLinkResources = append(result.Properties.SharedPrivateLinkResources, *itemARM.(*Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM)) + } + if workspaces.StorageAccountReference != nil { + storageAccountARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*workspaces.StorageAccountReference) + if err != nil { + return nil, err + } + storageAccount := storageAccountARMID + result.Properties.StorageAccount = &storageAccount + } + + // Set property ‘Sku’: + if workspaces.Sku != nil { + skuARM, err := (*workspaces.Sku).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sku := *skuARM.(*SkuARM) + result.Sku = &sku + } + + // Set property ‘SystemData’: + if workspaces.SystemData != nil { + systemDataARM, err := (*workspaces.SystemData).ConvertToARM(resolved) + if err != nil { + return nil, err + } + systemData := *systemDataARM.(*SystemDataARM) + result.SystemData = &systemData + } + + // Set property ‘Tags’: + if workspaces.Tags != nil { + result.Tags = make(map[string]string, len(workspaces.Tags)) + for key, value := range workspaces.Tags { + result.Tags[key] = value + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (workspaces *Workspaces_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Workspaces_SpecARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (workspaces *Workspaces_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Workspaces_SpecARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Workspaces_SpecARM, got %T", armInput) + } + + // Set property ‘AllowPublicAccessWhenBehindVnet’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AllowPublicAccessWhenBehindVnet != nil { + allowPublicAccessWhenBehindVnet := *typedInput.Properties.AllowPublicAccessWhenBehindVnet + workspaces.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet + } + } + + // no assignment for property ‘ApplicationInsightsReference’ + + // Set property ‘AzureName’: + workspaces.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // no assignment for property ‘ContainerRegistryReference’ + + // Set property ‘Description’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Description != nil { + description := *typedInput.Properties.Description + workspaces.Description = &description + } + } + + // Set property ‘DiscoveryUrl’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DiscoveryUrl != nil { + discoveryUrl := *typedInput.Properties.DiscoveryUrl + workspaces.DiscoveryUrl = &discoveryUrl + } + } + + // Set property ‘Encryption’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Encryption != nil { + var encryption1 EncryptionProperty + err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption) + if err != nil { + return err + } + encryption := encryption1 + workspaces.Encryption = &encryption + } + } + + // Set property ‘FriendlyName’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.FriendlyName != nil { + friendlyName := *typedInput.Properties.FriendlyName + workspaces.FriendlyName = &friendlyName + } + } + + // Set property ‘HbiWorkspace’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.HbiWorkspace != nil { + hbiWorkspace := *typedInput.Properties.HbiWorkspace + workspaces.HbiWorkspace = &hbiWorkspace + } + } + + // Set property ‘Identity’: + if typedInput.Identity != nil { + var identity1 Identity + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + workspaces.Identity = &identity + } + + // Set property ‘ImageBuildCompute’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ImageBuildCompute != nil { + imageBuildCompute := *typedInput.Properties.ImageBuildCompute + workspaces.ImageBuildCompute = &imageBuildCompute + } + } + + // no assignment for property ‘KeyVaultReference’ + + // Set property ‘Location’: + if typedInput.Location != nil { + location := *typedInput.Location + workspaces.Location = &location + } + + // no assignment for property ‘OperatorSpec’ + + // Set property ‘Owner’: + workspaces.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + } + + // no assignment for property ‘PrimaryUserAssignedIdentityReference’ + + // Set property ‘PublicNetworkAccess’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccess != nil { + publicNetworkAccess := *typedInput.Properties.PublicNetworkAccess + workspaces.PublicNetworkAccess = &publicNetworkAccess + } + } + + // Set property ‘ServiceManagedResourcesSettings’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ServiceManagedResourcesSettings != nil { + var serviceManagedResourcesSettings1 ServiceManagedResourcesSettings + err := serviceManagedResourcesSettings1.PopulateFromARM(owner, *typedInput.Properties.ServiceManagedResourcesSettings) + if err != nil { + return err + } + serviceManagedResourcesSettings := serviceManagedResourcesSettings1 + workspaces.ServiceManagedResourcesSettings = &serviceManagedResourcesSettings + } + } + + // Set property ‘SharedPrivateLinkResources’: + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.SharedPrivateLinkResources { + var item1 Workspaces_Spec_Properties_SharedPrivateLinkResources + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + workspaces.SharedPrivateLinkResources = append(workspaces.SharedPrivateLinkResources, item1) + } + } + + // Set property ‘Sku’: + if typedInput.Sku != nil { + var sku1 Sku + err := sku1.PopulateFromARM(owner, *typedInput.Sku) + if err != nil { + return err + } + sku := sku1 + workspaces.Sku = &sku + } + + // no assignment for property ‘StorageAccountReference’ + + // Set property ‘SystemData’: + if typedInput.SystemData != nil { + var systemData1 SystemData + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + workspaces.SystemData = &systemData + } + + // Set property ‘Tags’: + if typedInput.Tags != nil { + workspaces.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + workspaces.Tags[key] = value + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Workspaces_Spec{} + +// ConvertSpecFrom populates our Workspaces_Spec from the provided source +func (workspaces *Workspaces_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20210701s.Workspaces_Spec) + if ok { + // Populate our instance from source + return workspaces.AssignPropertiesFromWorkspacesSpec(src) + } + + // Convert to an intermediate form + src = &v20210701s.Workspaces_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = workspaces.AssignPropertiesFromWorkspacesSpec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our Workspaces_Spec +func (workspaces *Workspaces_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20210701s.Workspaces_Spec) + if ok { + // Populate destination from our instance + return workspaces.AssignPropertiesToWorkspacesSpec(dst) + } + + // Convert to an intermediate form + dst = &v20210701s.Workspaces_Spec{} + err := workspaces.AssignPropertiesToWorkspacesSpec(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignPropertiesFromWorkspacesSpec populates our Workspaces_Spec from the provided source Workspaces_Spec +func (workspaces *Workspaces_Spec) AssignPropertiesFromWorkspacesSpec(source *v20210701s.Workspaces_Spec) error { + + // AllowPublicAccessWhenBehindVnet + if source.AllowPublicAccessWhenBehindVnet != nil { + allowPublicAccessWhenBehindVnet := *source.AllowPublicAccessWhenBehindVnet + workspaces.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet + } else { + workspaces.AllowPublicAccessWhenBehindVnet = nil + } + + // ApplicationInsightsReference + if source.ApplicationInsightsReference != nil { + applicationInsightsReference := source.ApplicationInsightsReference.Copy() + workspaces.ApplicationInsightsReference = &applicationInsightsReference + } else { + workspaces.ApplicationInsightsReference = nil + } + + // AzureName + workspaces.AzureName = source.AzureName + + // ContainerRegistryReference + if source.ContainerRegistryReference != nil { + containerRegistryReference := source.ContainerRegistryReference.Copy() + workspaces.ContainerRegistryReference = &containerRegistryReference + } else { + workspaces.ContainerRegistryReference = nil + } + + // Description + workspaces.Description = genruntime.ClonePointerToString(source.Description) + + // DiscoveryUrl + workspaces.DiscoveryUrl = genruntime.ClonePointerToString(source.DiscoveryUrl) + + // Encryption + if source.Encryption != nil { + var encryption EncryptionProperty + err := encryption.AssignPropertiesFromEncryptionProperty(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromEncryptionProperty() to populate field Encryption") + } + workspaces.Encryption = &encryption + } else { + workspaces.Encryption = nil + } + + // FriendlyName + workspaces.FriendlyName = genruntime.ClonePointerToString(source.FriendlyName) + + // HbiWorkspace + if source.HbiWorkspace != nil { + hbiWorkspace := *source.HbiWorkspace + workspaces.HbiWorkspace = &hbiWorkspace + } else { + workspaces.HbiWorkspace = nil + } + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.AssignPropertiesFromIdentity(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromIdentity() to populate field Identity") + } + workspaces.Identity = &identity + } else { + workspaces.Identity = nil + } + + // ImageBuildCompute + workspaces.ImageBuildCompute = genruntime.ClonePointerToString(source.ImageBuildCompute) + + // KeyVaultReference + if source.KeyVaultReference != nil { + keyVaultReference := source.KeyVaultReference.Copy() + workspaces.KeyVaultReference = &keyVaultReference + } else { + workspaces.KeyVaultReference = nil + } + + // Location + workspaces.Location = genruntime.ClonePointerToString(source.Location) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec WorkspaceOperatorSpec + err := operatorSpec.AssignPropertiesFromWorkspaceOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspaceOperatorSpec() to populate field OperatorSpec") + } + workspaces.OperatorSpec = &operatorSpec + } else { + workspaces.OperatorSpec = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + workspaces.Owner = &owner + } else { + workspaces.Owner = nil + } + + // PrimaryUserAssignedIdentityReference + if source.PrimaryUserAssignedIdentityReference != nil { + primaryUserAssignedIdentityReference := source.PrimaryUserAssignedIdentityReference.Copy() + workspaces.PrimaryUserAssignedIdentityReference = &primaryUserAssignedIdentityReference + } else { + workspaces.PrimaryUserAssignedIdentityReference = nil + } + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + publicNetworkAccess := WorkspacesSpecPropertiesPublicNetworkAccess(*source.PublicNetworkAccess) + workspaces.PublicNetworkAccess = &publicNetworkAccess + } else { + workspaces.PublicNetworkAccess = nil + } + + // ServiceManagedResourcesSettings + if source.ServiceManagedResourcesSettings != nil { + var serviceManagedResourcesSetting ServiceManagedResourcesSettings + err := serviceManagedResourcesSetting.AssignPropertiesFromServiceManagedResourcesSettings(source.ServiceManagedResourcesSettings) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromServiceManagedResourcesSettings() to populate field ServiceManagedResourcesSettings") + } + workspaces.ServiceManagedResourcesSettings = &serviceManagedResourcesSetting + } else { + workspaces.ServiceManagedResourcesSettings = nil + } + + // SharedPrivateLinkResources + if source.SharedPrivateLinkResources != nil { + sharedPrivateLinkResourceList := make([]Workspaces_Spec_Properties_SharedPrivateLinkResources, len(source.SharedPrivateLinkResources)) + for sharedPrivateLinkResourceIndex, sharedPrivateLinkResourceItem := range source.SharedPrivateLinkResources { + // Shadow the loop variable to avoid aliasing + sharedPrivateLinkResourceItem := sharedPrivateLinkResourceItem + var sharedPrivateLinkResource Workspaces_Spec_Properties_SharedPrivateLinkResources + err := sharedPrivateLinkResource.AssignPropertiesFromWorkspacesSpecPropertiesSharedPrivateLinkResources(&sharedPrivateLinkResourceItem) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspacesSpecPropertiesSharedPrivateLinkResources() to populate field SharedPrivateLinkResources") + } + sharedPrivateLinkResourceList[sharedPrivateLinkResourceIndex] = sharedPrivateLinkResource + } + workspaces.SharedPrivateLinkResources = sharedPrivateLinkResourceList + } else { + workspaces.SharedPrivateLinkResources = nil + } + + // Sku + if source.Sku != nil { + var sku Sku + err := sku.AssignPropertiesFromSku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSku() to populate field Sku") + } + workspaces.Sku = &sku + } else { + workspaces.Sku = nil + } + + // StorageAccountReference + if source.StorageAccountReference != nil { + storageAccountReference := source.StorageAccountReference.Copy() + workspaces.StorageAccountReference = &storageAccountReference + } else { + workspaces.StorageAccountReference = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData + err := systemDatum.AssignPropertiesFromSystemData(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSystemData() to populate field SystemData") + } + workspaces.SystemData = &systemDatum + } else { + workspaces.SystemData = nil + } + + // Tags + workspaces.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // No error + return nil +} + +// AssignPropertiesToWorkspacesSpec populates the provided destination Workspaces_Spec from our Workspaces_Spec +func (workspaces *Workspaces_Spec) AssignPropertiesToWorkspacesSpec(destination *v20210701s.Workspaces_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AllowPublicAccessWhenBehindVnet + if workspaces.AllowPublicAccessWhenBehindVnet != nil { + allowPublicAccessWhenBehindVnet := *workspaces.AllowPublicAccessWhenBehindVnet + destination.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet + } else { + destination.AllowPublicAccessWhenBehindVnet = nil + } + + // ApplicationInsightsReference + if workspaces.ApplicationInsightsReference != nil { + applicationInsightsReference := workspaces.ApplicationInsightsReference.Copy() + destination.ApplicationInsightsReference = &applicationInsightsReference + } else { + destination.ApplicationInsightsReference = nil + } + + // AzureName + destination.AzureName = workspaces.AzureName + + // ContainerRegistryReference + if workspaces.ContainerRegistryReference != nil { + containerRegistryReference := workspaces.ContainerRegistryReference.Copy() + destination.ContainerRegistryReference = &containerRegistryReference + } else { + destination.ContainerRegistryReference = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(workspaces.Description) + + // DiscoveryUrl + destination.DiscoveryUrl = genruntime.ClonePointerToString(workspaces.DiscoveryUrl) + + // Encryption + if workspaces.Encryption != nil { + var encryption v20210701s.EncryptionProperty + err := workspaces.Encryption.AssignPropertiesToEncryptionProperty(&encryption) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToEncryptionProperty() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // FriendlyName + destination.FriendlyName = genruntime.ClonePointerToString(workspaces.FriendlyName) + + // HbiWorkspace + if workspaces.HbiWorkspace != nil { + hbiWorkspace := *workspaces.HbiWorkspace + destination.HbiWorkspace = &hbiWorkspace + } else { + destination.HbiWorkspace = nil + } + + // Identity + if workspaces.Identity != nil { + var identity v20210701s.Identity + err := workspaces.Identity.AssignPropertiesToIdentity(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToIdentity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // ImageBuildCompute + destination.ImageBuildCompute = genruntime.ClonePointerToString(workspaces.ImageBuildCompute) + + // KeyVaultReference + if workspaces.KeyVaultReference != nil { + keyVaultReference := workspaces.KeyVaultReference.Copy() + destination.KeyVaultReference = &keyVaultReference + } else { + destination.KeyVaultReference = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(workspaces.Location) + + // OperatorSpec + if workspaces.OperatorSpec != nil { + var operatorSpec v20210701s.WorkspaceOperatorSpec + err := workspaces.OperatorSpec.AssignPropertiesToWorkspaceOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspaceOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = workspaces.OriginalVersion() + + // Owner + if workspaces.Owner != nil { + owner := workspaces.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // PrimaryUserAssignedIdentityReference + if workspaces.PrimaryUserAssignedIdentityReference != nil { + primaryUserAssignedIdentityReference := workspaces.PrimaryUserAssignedIdentityReference.Copy() + destination.PrimaryUserAssignedIdentityReference = &primaryUserAssignedIdentityReference + } else { + destination.PrimaryUserAssignedIdentityReference = nil + } + + // PublicNetworkAccess + if workspaces.PublicNetworkAccess != nil { + publicNetworkAccess := string(*workspaces.PublicNetworkAccess) + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // ServiceManagedResourcesSettings + if workspaces.ServiceManagedResourcesSettings != nil { + var serviceManagedResourcesSetting v20210701s.ServiceManagedResourcesSettings + err := workspaces.ServiceManagedResourcesSettings.AssignPropertiesToServiceManagedResourcesSettings(&serviceManagedResourcesSetting) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToServiceManagedResourcesSettings() to populate field ServiceManagedResourcesSettings") + } + destination.ServiceManagedResourcesSettings = &serviceManagedResourcesSetting + } else { + destination.ServiceManagedResourcesSettings = nil + } + + // SharedPrivateLinkResources + if workspaces.SharedPrivateLinkResources != nil { + sharedPrivateLinkResourceList := make([]v20210701s.Workspaces_Spec_Properties_SharedPrivateLinkResources, len(workspaces.SharedPrivateLinkResources)) + for sharedPrivateLinkResourceIndex, sharedPrivateLinkResourceItem := range workspaces.SharedPrivateLinkResources { + // Shadow the loop variable to avoid aliasing + sharedPrivateLinkResourceItem := sharedPrivateLinkResourceItem + var sharedPrivateLinkResource v20210701s.Workspaces_Spec_Properties_SharedPrivateLinkResources + err := sharedPrivateLinkResourceItem.AssignPropertiesToWorkspacesSpecPropertiesSharedPrivateLinkResources(&sharedPrivateLinkResource) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspacesSpecPropertiesSharedPrivateLinkResources() to populate field SharedPrivateLinkResources") + } + sharedPrivateLinkResourceList[sharedPrivateLinkResourceIndex] = sharedPrivateLinkResource + } + destination.SharedPrivateLinkResources = sharedPrivateLinkResourceList + } else { + destination.SharedPrivateLinkResources = nil + } + + // Sku + if workspaces.Sku != nil { + var sku v20210701s.Sku + err := workspaces.Sku.AssignPropertiesToSku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSku() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // StorageAccountReference + if workspaces.StorageAccountReference != nil { + storageAccountReference := workspaces.StorageAccountReference.Copy() + destination.StorageAccountReference = &storageAccountReference + } else { + destination.StorageAccountReference = nil + } + + // SystemData + if workspaces.SystemData != nil { + var systemDatum v20210701s.SystemData + err := workspaces.SystemData.AssignPropertiesToSystemData(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSystemData() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(workspaces.Tags) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (workspaces *Workspaces_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (workspaces *Workspaces_Spec) SetAzureName(azureName string) { workspaces.AzureName = azureName } + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/EncryptionProperty +type EncryptionProperty struct { + // Identity: Identity that will be used to access key vault for encryption at rest + Identity *IdentityForCmk `json:"identity,omitempty"` + + // +kubebuilder:validation:Required + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + + // +kubebuilder:validation:Required + // Status: Indicates whether or not the encryption is enabled for the workspace. + Status *EncryptionPropertyStatus `json:"status,omitempty"` +} + +var _ genruntime.ARMTransformer = &EncryptionProperty{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (property *EncryptionProperty) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if property == nil { + return nil, nil + } + result := &EncryptionPropertyARM{} + + // Set property ‘Identity’: + if property.Identity != nil { + identityARM, err := (*property.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identityARM.(*IdentityForCmkARM) + result.Identity = &identity + } + + // Set property ‘KeyVaultProperties’: + if property.KeyVaultProperties != nil { + keyVaultPropertiesARM, err := (*property.KeyVaultProperties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + keyVaultProperties := *keyVaultPropertiesARM.(*KeyVaultPropertiesARM) + result.KeyVaultProperties = &keyVaultProperties + } + + // Set property ‘Status’: + if property.Status != nil { + status := *property.Status + result.Status = &status + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (property *EncryptionProperty) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &EncryptionPropertyARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (property *EncryptionProperty) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(EncryptionPropertyARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected EncryptionPropertyARM, got %T", armInput) + } + + // Set property ‘Identity’: + if typedInput.Identity != nil { + var identity1 IdentityForCmk + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + property.Identity = &identity + } + + // Set property ‘KeyVaultProperties’: + if typedInput.KeyVaultProperties != nil { + var keyVaultProperties1 KeyVaultProperties + err := keyVaultProperties1.PopulateFromARM(owner, *typedInput.KeyVaultProperties) + if err != nil { + return err + } + keyVaultProperties := keyVaultProperties1 + property.KeyVaultProperties = &keyVaultProperties + } + + // Set property ‘Status’: + if typedInput.Status != nil { + status := *typedInput.Status + property.Status = &status + } + + // No error + return nil +} + +// AssignPropertiesFromEncryptionProperty populates our EncryptionProperty from the provided source EncryptionProperty +func (property *EncryptionProperty) AssignPropertiesFromEncryptionProperty(source *v20210701s.EncryptionProperty) error { + + // Identity + if source.Identity != nil { + var identity IdentityForCmk + err := identity.AssignPropertiesFromIdentityForCmk(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromIdentityForCmk() to populate field Identity") + } + property.Identity = &identity + } else { + property.Identity = nil + } + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + var keyVaultProperty KeyVaultProperties + err := keyVaultProperty.AssignPropertiesFromKeyVaultProperties(source.KeyVaultProperties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromKeyVaultProperties() to populate field KeyVaultProperties") + } + property.KeyVaultProperties = &keyVaultProperty + } else { + property.KeyVaultProperties = nil + } + + // Status + if source.Status != nil { + status := EncryptionPropertyStatus(*source.Status) + property.Status = &status + } else { + property.Status = nil + } + + // No error + return nil +} + +// AssignPropertiesToEncryptionProperty populates the provided destination EncryptionProperty from our EncryptionProperty +func (property *EncryptionProperty) AssignPropertiesToEncryptionProperty(destination *v20210701s.EncryptionProperty) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if property.Identity != nil { + var identity v20210701s.IdentityForCmk + err := property.Identity.AssignPropertiesToIdentityForCmk(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToIdentityForCmk() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // KeyVaultProperties + if property.KeyVaultProperties != nil { + var keyVaultProperty v20210701s.KeyVaultProperties + err := property.KeyVaultProperties.AssignPropertiesToKeyVaultProperties(&keyVaultProperty) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToKeyVaultProperties() to populate field KeyVaultProperties") + } + destination.KeyVaultProperties = &keyVaultProperty + } else { + destination.KeyVaultProperties = nil + } + + // Status + if property.Status != nil { + status := string(*property.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type EncryptionProperty_Status struct { + // Identity: The identity that will be used to access the key vault for encryption at rest. + Identity *IdentityForCmk_Status `json:"identity,omitempty"` + + // KeyVaultProperties: Customer Key vault properties. + KeyVaultProperties *KeyVaultProperties_Status `json:"keyVaultProperties,omitempty"` + + // Status: Indicates whether or not the encryption is enabled for the workspace. + Status *EncryptionPropertyStatusStatus `json:"status,omitempty"` +} + +var _ genruntime.FromARMConverter = &EncryptionProperty_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (property *EncryptionProperty_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &EncryptionProperty_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (property *EncryptionProperty_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(EncryptionProperty_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected EncryptionProperty_StatusARM, got %T", armInput) + } + + // Set property ‘Identity’: + if typedInput.Identity != nil { + var identity1 IdentityForCmk_Status + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + property.Identity = &identity + } + + // Set property ‘KeyVaultProperties’: + if typedInput.KeyVaultProperties != nil { + var keyVaultProperties1 KeyVaultProperties_Status + err := keyVaultProperties1.PopulateFromARM(owner, *typedInput.KeyVaultProperties) + if err != nil { + return err + } + keyVaultProperties := keyVaultProperties1 + property.KeyVaultProperties = &keyVaultProperties + } + + // Set property ‘Status’: + if typedInput.Status != nil { + status := *typedInput.Status + property.Status = &status + } + + // No error + return nil +} + +// AssignPropertiesFromEncryptionPropertyStatus populates our EncryptionProperty_Status from the provided source EncryptionProperty_Status +func (property *EncryptionProperty_Status) AssignPropertiesFromEncryptionPropertyStatus(source *v20210701s.EncryptionProperty_Status) error { + + // Identity + if source.Identity != nil { + var identity IdentityForCmk_Status + err := identity.AssignPropertiesFromIdentityForCmkStatus(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromIdentityForCmkStatus() to populate field Identity") + } + property.Identity = &identity + } else { + property.Identity = nil + } + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + var keyVaultProperty KeyVaultProperties_Status + err := keyVaultProperty.AssignPropertiesFromKeyVaultPropertiesStatus(source.KeyVaultProperties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromKeyVaultPropertiesStatus() to populate field KeyVaultProperties") + } + property.KeyVaultProperties = &keyVaultProperty + } else { + property.KeyVaultProperties = nil + } + + // Status + if source.Status != nil { + status := EncryptionPropertyStatusStatus(*source.Status) + property.Status = &status + } else { + property.Status = nil + } + + // No error + return nil +} + +// AssignPropertiesToEncryptionPropertyStatus populates the provided destination EncryptionProperty_Status from our EncryptionProperty_Status +func (property *EncryptionProperty_Status) AssignPropertiesToEncryptionPropertyStatus(destination *v20210701s.EncryptionProperty_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if property.Identity != nil { + var identity v20210701s.IdentityForCmk_Status + err := property.Identity.AssignPropertiesToIdentityForCmkStatus(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToIdentityForCmkStatus() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // KeyVaultProperties + if property.KeyVaultProperties != nil { + var keyVaultProperty v20210701s.KeyVaultProperties_Status + err := property.KeyVaultProperties.AssignPropertiesToKeyVaultPropertiesStatus(&keyVaultProperty) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToKeyVaultPropertiesStatus() to populate field KeyVaultProperties") + } + destination.KeyVaultProperties = &keyVaultProperty + } else { + destination.KeyVaultProperties = nil + } + + // Status + if property.Status != nil { + status := string(*property.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Identity +type Identity struct { + // Type: The identity type. + Type *IdentityType `json:"type,omitempty"` + + // UserAssignedIdentities: dictionary containing all the user assigned identities, with resourceId of the UAI as key. + UserAssignedIdentities map[string]v1.JSON `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 := &IdentityARM{} + + // Set property ‘Type’: + if identity.Type != nil { + typeVar := *identity.Type + result.Type = &typeVar + } + + // Set property ‘UserAssignedIdentities’: + if identity.UserAssignedIdentities != nil { + result.UserAssignedIdentities = make(map[string]v1.JSON, len(identity.UserAssignedIdentities)) + for key, value := range identity.UserAssignedIdentities { + result.UserAssignedIdentities[key] = *value.DeepCopy() + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &IdentityARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *Identity) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(IdentityARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected IdentityARM, got %T", armInput) + } + + // Set property ‘Type’: + if typedInput.Type != nil { + typeVar := *typedInput.Type + identity.Type = &typeVar + } + + // Set property ‘UserAssignedIdentities’: + if typedInput.UserAssignedIdentities != nil { + identity.UserAssignedIdentities = make(map[string]v1.JSON, len(typedInput.UserAssignedIdentities)) + for key, value := range typedInput.UserAssignedIdentities { + identity.UserAssignedIdentities[key] = *value.DeepCopy() + } + } + + // No error + return nil +} + +// AssignPropertiesFromIdentity populates our Identity from the provided source Identity +func (identity *Identity) AssignPropertiesFromIdentity(source *v20210701s.Identity) error { + + // Type + if source.Type != nil { + typeVar := IdentityType(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityMap := make(map[string]v1.JSON, len(source.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + userAssignedIdentityMap[userAssignedIdentityKey] = *userAssignedIdentityValue.DeepCopy() + } + identity.UserAssignedIdentities = userAssignedIdentityMap + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// AssignPropertiesToIdentity populates the provided destination Identity from our Identity +func (identity *Identity) AssignPropertiesToIdentity(destination *v20210701s.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 { + userAssignedIdentityMap := make(map[string]v1.JSON, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + userAssignedIdentityMap[userAssignedIdentityKey] = *userAssignedIdentityValue.DeepCopy() + } + 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 +} + +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: The identity type. + Type *IdentityStatusType `json:"type,omitempty"` + + // UserAssignedIdentities: The user assigned identities associated with the resource. + UserAssignedIdentities map[string]UserAssignedIdentity_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 &Identity_StatusARM{} +} + +// 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.(Identity_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Identity_StatusARM, 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 { + typeVar := *typedInput.Type + identity.Type = &typeVar + } + + // Set property ‘UserAssignedIdentities’: + if typedInput.UserAssignedIdentities != nil { + identity.UserAssignedIdentities = make(map[string]UserAssignedIdentity_Status, len(typedInput.UserAssignedIdentities)) + for key, value := range typedInput.UserAssignedIdentities { + var value1 UserAssignedIdentity_Status + err := value1.PopulateFromARM(owner, value) + if err != nil { + return err + } + identity.UserAssignedIdentities[key] = value1 + } + } + + // No error + return nil +} + +// AssignPropertiesFromIdentityStatus populates our Identity_Status from the provided source Identity_Status +func (identity *Identity_Status) AssignPropertiesFromIdentityStatus(source *v20210701s.Identity_Status) error { + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // TenantId + identity.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // Type + if source.Type != nil { + typeVar := IdentityStatusType(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityMap := make(map[string]UserAssignedIdentity_Status, len(source.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity UserAssignedIdentity_Status + err := userAssignedIdentity.AssignPropertiesFromUserAssignedIdentityStatus(&userAssignedIdentityValue) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromUserAssignedIdentityStatus() to populate field UserAssignedIdentities") + } + userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityMap + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// AssignPropertiesToIdentityStatus populates the provided destination Identity_Status from our Identity_Status +func (identity *Identity_Status) AssignPropertiesToIdentityStatus(destination *v20210701s.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]v20210701s.UserAssignedIdentity_Status, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity v20210701s.UserAssignedIdentity_Status + err := userAssignedIdentityValue.AssignPropertiesToUserAssignedIdentityStatus(&userAssignedIdentity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToUserAssignedIdentityStatus() 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 +} + +type NotebookResourceInfo_Status struct { + Fqdn *string `json:"fqdn,omitempty"` + + // NotebookPreparationError: The error that occurs when preparing notebook. + NotebookPreparationError *NotebookPreparationError_Status `json:"notebookPreparationError,omitempty"` + + // ResourceId: the data plane resourceId that used to initialize notebook component + ResourceId *string `json:"resourceId,omitempty"` +} + +var _ genruntime.FromARMConverter = &NotebookResourceInfo_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (info *NotebookResourceInfo_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &NotebookResourceInfo_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (info *NotebookResourceInfo_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(NotebookResourceInfo_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected NotebookResourceInfo_StatusARM, got %T", armInput) + } + + // Set property ‘Fqdn’: + if typedInput.Fqdn != nil { + fqdn := *typedInput.Fqdn + info.Fqdn = &fqdn + } + + // Set property ‘NotebookPreparationError’: + if typedInput.NotebookPreparationError != nil { + var notebookPreparationError1 NotebookPreparationError_Status + err := notebookPreparationError1.PopulateFromARM(owner, *typedInput.NotebookPreparationError) + if err != nil { + return err + } + notebookPreparationError := notebookPreparationError1 + info.NotebookPreparationError = ¬ebookPreparationError + } + + // Set property ‘ResourceId’: + if typedInput.ResourceId != nil { + resourceId := *typedInput.ResourceId + info.ResourceId = &resourceId + } + + // No error + return nil +} + +// AssignPropertiesFromNotebookResourceInfoStatus populates our NotebookResourceInfo_Status from the provided source NotebookResourceInfo_Status +func (info *NotebookResourceInfo_Status) AssignPropertiesFromNotebookResourceInfoStatus(source *v20210701s.NotebookResourceInfo_Status) error { + + // Fqdn + info.Fqdn = genruntime.ClonePointerToString(source.Fqdn) + + // NotebookPreparationError + if source.NotebookPreparationError != nil { + var notebookPreparationError NotebookPreparationError_Status + err := notebookPreparationError.AssignPropertiesFromNotebookPreparationErrorStatus(source.NotebookPreparationError) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromNotebookPreparationErrorStatus() to populate field NotebookPreparationError") + } + info.NotebookPreparationError = ¬ebookPreparationError + } else { + info.NotebookPreparationError = nil + } + + // ResourceId + info.ResourceId = genruntime.ClonePointerToString(source.ResourceId) + + // No error + return nil +} + +// AssignPropertiesToNotebookResourceInfoStatus populates the provided destination NotebookResourceInfo_Status from our NotebookResourceInfo_Status +func (info *NotebookResourceInfo_Status) AssignPropertiesToNotebookResourceInfoStatus(destination *v20210701s.NotebookResourceInfo_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Fqdn + destination.Fqdn = genruntime.ClonePointerToString(info.Fqdn) + + // NotebookPreparationError + if info.NotebookPreparationError != nil { + var notebookPreparationError v20210701s.NotebookPreparationError_Status + err := info.NotebookPreparationError.AssignPropertiesToNotebookPreparationErrorStatus(¬ebookPreparationError) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToNotebookPreparationErrorStatus() to populate field NotebookPreparationError") + } + destination.NotebookPreparationError = ¬ebookPreparationError + } else { + destination.NotebookPreparationError = nil + } + + // ResourceId + destination.ResourceId = genruntime.ClonePointerToString(info.ResourceId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type PrivateEndpointConnection_Status_SubResourceEmbedded struct { + // 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"` + + // Sku: The sku of the workspace. + Sku *Sku_Status `json:"sku,omitempty"` + + // SystemData: System data + SystemData *SystemData_Status `json:"systemData,omitempty"` +} + +var _ genruntime.FromARMConverter = &PrivateEndpointConnection_Status_SubResourceEmbedded{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (embedded *PrivateEndpointConnection_Status_SubResourceEmbedded) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &PrivateEndpointConnection_Status_SubResourceEmbeddedARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (embedded *PrivateEndpointConnection_Status_SubResourceEmbedded) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(PrivateEndpointConnection_Status_SubResourceEmbeddedARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected PrivateEndpointConnection_Status_SubResourceEmbeddedARM, got %T", armInput) + } + + // Set property ‘Id’: + if typedInput.Id != nil { + id := *typedInput.Id + embedded.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 + embedded.Identity = &identity + } + + // Set property ‘Sku’: + if typedInput.Sku != nil { + var sku1 Sku_Status + err := sku1.PopulateFromARM(owner, *typedInput.Sku) + if err != nil { + return err + } + sku := sku1 + embedded.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 + embedded.SystemData = &systemData + } + + // No error + return nil +} + +// AssignPropertiesFromPrivateEndpointConnectionStatusSubResourceEmbedded populates our PrivateEndpointConnection_Status_SubResourceEmbedded from the provided source PrivateEndpointConnection_Status_SubResourceEmbedded +func (embedded *PrivateEndpointConnection_Status_SubResourceEmbedded) AssignPropertiesFromPrivateEndpointConnectionStatusSubResourceEmbedded(source *v20210701s.PrivateEndpointConnection_Status_SubResourceEmbedded) error { + + // Id + embedded.Id = genruntime.ClonePointerToString(source.Id) + + // Identity + if source.Identity != nil { + var identity Identity_Status + err := identity.AssignPropertiesFromIdentityStatus(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromIdentityStatus() to populate field Identity") + } + embedded.Identity = &identity + } else { + embedded.Identity = nil + } + + // Sku + if source.Sku != nil { + var sku Sku_Status + err := sku.AssignPropertiesFromSkuStatus(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSkuStatus() to populate field Sku") + } + embedded.Sku = &sku + } else { + embedded.Sku = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_Status + err := systemDatum.AssignPropertiesFromSystemDataStatus(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSystemDataStatus() to populate field SystemData") + } + embedded.SystemData = &systemDatum + } else { + embedded.SystemData = nil + } + + // No error + return nil +} + +// AssignPropertiesToPrivateEndpointConnectionStatusSubResourceEmbedded populates the provided destination PrivateEndpointConnection_Status_SubResourceEmbedded from our PrivateEndpointConnection_Status_SubResourceEmbedded +func (embedded *PrivateEndpointConnection_Status_SubResourceEmbedded) AssignPropertiesToPrivateEndpointConnectionStatusSubResourceEmbedded(destination *v20210701s.PrivateEndpointConnection_Status_SubResourceEmbedded) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Id + destination.Id = genruntime.ClonePointerToString(embedded.Id) + + // Identity + if embedded.Identity != nil { + var identity v20210701s.Identity_Status + err := embedded.Identity.AssignPropertiesToIdentityStatus(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToIdentityStatus() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Sku + if embedded.Sku != nil { + var sku v20210701s.Sku_Status + err := embedded.Sku.AssignPropertiesToSkuStatus(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSkuStatus() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // SystemData + if embedded.SystemData != nil { + var systemDatum v20210701s.SystemData_Status + err := embedded.SystemData.AssignPropertiesToSystemDataStatus(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSystemDataStatus() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ServiceManagedResourcesSettings +type ServiceManagedResourcesSettings struct { + CosmosDb *CosmosDbSettings `json:"cosmosDb,omitempty"` +} + +var _ genruntime.ARMTransformer = &ServiceManagedResourcesSettings{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (settings *ServiceManagedResourcesSettings) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if settings == nil { + return nil, nil + } + result := &ServiceManagedResourcesSettingsARM{} + + // Set property ‘CosmosDb’: + if settings.CosmosDb != nil { + cosmosDbARM, err := (*settings.CosmosDb).ConvertToARM(resolved) + if err != nil { + return nil, err + } + cosmosDb := *cosmosDbARM.(*CosmosDbSettingsARM) + result.CosmosDb = &cosmosDb + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (settings *ServiceManagedResourcesSettings) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ServiceManagedResourcesSettingsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (settings *ServiceManagedResourcesSettings) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ServiceManagedResourcesSettingsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ServiceManagedResourcesSettingsARM, got %T", armInput) + } + + // Set property ‘CosmosDb’: + if typedInput.CosmosDb != nil { + var cosmosDb1 CosmosDbSettings + err := cosmosDb1.PopulateFromARM(owner, *typedInput.CosmosDb) + if err != nil { + return err + } + cosmosDb := cosmosDb1 + settings.CosmosDb = &cosmosDb + } + + // No error + return nil +} + +// AssignPropertiesFromServiceManagedResourcesSettings populates our ServiceManagedResourcesSettings from the provided source ServiceManagedResourcesSettings +func (settings *ServiceManagedResourcesSettings) AssignPropertiesFromServiceManagedResourcesSettings(source *v20210701s.ServiceManagedResourcesSettings) error { + + // CosmosDb + if source.CosmosDb != nil { + var cosmosDb CosmosDbSettings + err := cosmosDb.AssignPropertiesFromCosmosDbSettings(source.CosmosDb) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromCosmosDbSettings() to populate field CosmosDb") + } + settings.CosmosDb = &cosmosDb + } else { + settings.CosmosDb = nil + } + + // No error + return nil +} + +// AssignPropertiesToServiceManagedResourcesSettings populates the provided destination ServiceManagedResourcesSettings from our ServiceManagedResourcesSettings +func (settings *ServiceManagedResourcesSettings) AssignPropertiesToServiceManagedResourcesSettings(destination *v20210701s.ServiceManagedResourcesSettings) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CosmosDb + if settings.CosmosDb != nil { + var cosmosDb v20210701s.CosmosDbSettings + err := settings.CosmosDb.AssignPropertiesToCosmosDbSettings(&cosmosDb) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToCosmosDbSettings() to populate field CosmosDb") + } + destination.CosmosDb = &cosmosDb + } else { + destination.CosmosDb = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type ServiceManagedResourcesSettings_Status struct { + // CosmosDb: The settings for the service managed cosmosdb account. + CosmosDb *CosmosDbSettings_Status `json:"cosmosDb,omitempty"` +} + +var _ genruntime.FromARMConverter = &ServiceManagedResourcesSettings_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (settings *ServiceManagedResourcesSettings_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ServiceManagedResourcesSettings_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (settings *ServiceManagedResourcesSettings_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ServiceManagedResourcesSettings_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ServiceManagedResourcesSettings_StatusARM, got %T", armInput) + } + + // Set property ‘CosmosDb’: + if typedInput.CosmosDb != nil { + var cosmosDb1 CosmosDbSettings_Status + err := cosmosDb1.PopulateFromARM(owner, *typedInput.CosmosDb) + if err != nil { + return err + } + cosmosDb := cosmosDb1 + settings.CosmosDb = &cosmosDb + } + + // No error + return nil +} + +// AssignPropertiesFromServiceManagedResourcesSettingsStatus populates our ServiceManagedResourcesSettings_Status from the provided source ServiceManagedResourcesSettings_Status +func (settings *ServiceManagedResourcesSettings_Status) AssignPropertiesFromServiceManagedResourcesSettingsStatus(source *v20210701s.ServiceManagedResourcesSettings_Status) error { + + // CosmosDb + if source.CosmosDb != nil { + var cosmosDb CosmosDbSettings_Status + err := cosmosDb.AssignPropertiesFromCosmosDbSettingsStatus(source.CosmosDb) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromCosmosDbSettingsStatus() to populate field CosmosDb") + } + settings.CosmosDb = &cosmosDb + } else { + settings.CosmosDb = nil + } + + // No error + return nil +} + +// AssignPropertiesToServiceManagedResourcesSettingsStatus populates the provided destination ServiceManagedResourcesSettings_Status from our ServiceManagedResourcesSettings_Status +func (settings *ServiceManagedResourcesSettings_Status) AssignPropertiesToServiceManagedResourcesSettingsStatus(destination *v20210701s.ServiceManagedResourcesSettings_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CosmosDb + if settings.CosmosDb != nil { + var cosmosDb v20210701s.CosmosDbSettings_Status + err := settings.CosmosDb.AssignPropertiesToCosmosDbSettingsStatus(&cosmosDb) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToCosmosDbSettingsStatus() to populate field CosmosDb") + } + destination.CosmosDb = &cosmosDb + } else { + destination.CosmosDb = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type SharedPrivateLinkResource_Status struct { + // GroupId: The private link resource group id. + GroupId *string `json:"groupId,omitempty"` + + // Name: Unique name of the private link. + Name *string `json:"name,omitempty"` + + // PrivateLinkResourceId: The resource id that private link links to. + PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"` + + // RequestMessage: Request message. + RequestMessage *string `json:"requestMessage,omitempty"` + + // Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus_Status `json:"status,omitempty"` +} + +var _ genruntime.FromARMConverter = &SharedPrivateLinkResource_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (resource *SharedPrivateLinkResource_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SharedPrivateLinkResource_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (resource *SharedPrivateLinkResource_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SharedPrivateLinkResource_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SharedPrivateLinkResource_StatusARM, got %T", armInput) + } + + // Set property ‘GroupId’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.GroupId != nil { + groupId := *typedInput.Properties.GroupId + resource.GroupId = &groupId + } + } + + // Set property ‘Name’: + if typedInput.Name != nil { + name := *typedInput.Name + resource.Name = &name + } + + // Set property ‘PrivateLinkResourceId’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PrivateLinkResourceId != nil { + privateLinkResourceId := *typedInput.Properties.PrivateLinkResourceId + resource.PrivateLinkResourceId = &privateLinkResourceId + } + } + + // Set property ‘RequestMessage’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequestMessage != nil { + requestMessage := *typedInput.Properties.RequestMessage + resource.RequestMessage = &requestMessage + } + } + + // Set property ‘Status’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + resource.Status = &status + } + } + + // No error + return nil +} + +// AssignPropertiesFromSharedPrivateLinkResourceStatus populates our SharedPrivateLinkResource_Status from the provided source SharedPrivateLinkResource_Status +func (resource *SharedPrivateLinkResource_Status) AssignPropertiesFromSharedPrivateLinkResourceStatus(source *v20210701s.SharedPrivateLinkResource_Status) error { + + // GroupId + resource.GroupId = genruntime.ClonePointerToString(source.GroupId) + + // Name + resource.Name = genruntime.ClonePointerToString(source.Name) + + // PrivateLinkResourceId + resource.PrivateLinkResourceId = genruntime.ClonePointerToString(source.PrivateLinkResourceId) + + // RequestMessage + resource.RequestMessage = genruntime.ClonePointerToString(source.RequestMessage) + + // Status + if source.Status != nil { + status := PrivateEndpointServiceConnectionStatus_Status(*source.Status) + resource.Status = &status + } else { + resource.Status = nil + } + + // No error + return nil +} + +// AssignPropertiesToSharedPrivateLinkResourceStatus populates the provided destination SharedPrivateLinkResource_Status from our SharedPrivateLinkResource_Status +func (resource *SharedPrivateLinkResource_Status) AssignPropertiesToSharedPrivateLinkResourceStatus(destination *v20210701s.SharedPrivateLinkResource_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // GroupId + destination.GroupId = genruntime.ClonePointerToString(resource.GroupId) + + // Name + destination.Name = genruntime.ClonePointerToString(resource.Name) + + // PrivateLinkResourceId + destination.PrivateLinkResourceId = genruntime.ClonePointerToString(resource.PrivateLinkResourceId) + + // RequestMessage + destination.RequestMessage = genruntime.ClonePointerToString(resource.RequestMessage) + + // Status + if resource.Status != nil { + status := string(*resource.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Sku +type Sku struct { + // Name: Name of the sku + Name *string `json:"name,omitempty"` + + // Tier: Tier of the sku like Basic or Enterprise + Tier *string `json:"tier,omitempty"` +} + +var _ genruntime.ARMTransformer = &Sku{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (sku *Sku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if sku == nil { + return nil, nil + } + result := &SkuARM{} + + // Set property ‘Name’: + if sku.Name != nil { + name := *sku.Name + result.Name = &name + } + + // Set property ‘Tier’: + if sku.Tier != nil { + tier := *sku.Tier + result.Tier = &tier + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (sku *Sku) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SkuARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sku *Sku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SkuARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SkuARM, got %T", armInput) + } + + // Set property ‘Name’: + if typedInput.Name != nil { + name := *typedInput.Name + sku.Name = &name + } + + // Set property ‘Tier’: + if typedInput.Tier != nil { + tier := *typedInput.Tier + sku.Tier = &tier + } + + // No error + return nil +} + +// AssignPropertiesFromSku populates our Sku from the provided source Sku +func (sku *Sku) AssignPropertiesFromSku(source *v20210701s.Sku) error { + + // Name + sku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sku.Tier = genruntime.ClonePointerToString(source.Tier) + + // No error + return nil +} + +// AssignPropertiesToSku populates the provided destination Sku from our Sku +func (sku *Sku) AssignPropertiesToSku(destination *v20210701s.Sku) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Name + destination.Name = genruntime.ClonePointerToString(sku.Name) + + // Tier + destination.Tier = genruntime.ClonePointerToString(sku.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Sku_Status struct { + // Name: Name of the sku + Name *string `json:"name,omitempty"` + + // Tier: Tier of the sku like Basic or Enterprise + Tier *string `json:"tier,omitempty"` +} + +var _ genruntime.FromARMConverter = &Sku_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (sku *Sku_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Sku_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sku *Sku_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Sku_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Sku_StatusARM, got %T", armInput) + } + + // Set property ‘Name’: + if typedInput.Name != nil { + name := *typedInput.Name + sku.Name = &name + } + + // Set property ‘Tier’: + if typedInput.Tier != nil { + tier := *typedInput.Tier + sku.Tier = &tier + } + + // No error + return nil +} + +// AssignPropertiesFromSkuStatus populates our Sku_Status from the provided source Sku_Status +func (sku *Sku_Status) AssignPropertiesFromSkuStatus(source *v20210701s.Sku_Status) error { + + // Name + sku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sku.Tier = genruntime.ClonePointerToString(source.Tier) + + // No error + return nil +} + +// AssignPropertiesToSkuStatus populates the provided destination Sku_Status from our Sku_Status +func (sku *Sku_Status) AssignPropertiesToSkuStatus(destination *v20210701s.Sku_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Name + destination.Name = genruntime.ClonePointerToString(sku.Name) + + // Tier + destination.Tier = genruntime.ClonePointerToString(sku.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SystemData +type SystemData 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 *SystemDataCreatedByType `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 *SystemDataLastModifiedByType `json:"lastModifiedByType,omitempty"` +} + +var _ genruntime.ARMTransformer = &SystemData{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (data *SystemData) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if data == nil { + return nil, nil + } + result := &SystemDataARM{} + + // Set property ‘CreatedAt’: + if data.CreatedAt != nil { + createdAt := *data.CreatedAt + result.CreatedAt = &createdAt + } + + // Set property ‘CreatedBy’: + if data.CreatedBy != nil { + createdBy := *data.CreatedBy + result.CreatedBy = &createdBy + } + + // Set property ‘CreatedByType’: + if data.CreatedByType != nil { + createdByType := *data.CreatedByType + result.CreatedByType = &createdByType + } + + // Set property ‘LastModifiedAt’: + if data.LastModifiedAt != nil { + lastModifiedAt := *data.LastModifiedAt + result.LastModifiedAt = &lastModifiedAt + } + + // Set property ‘LastModifiedBy’: + if data.LastModifiedBy != nil { + lastModifiedBy := *data.LastModifiedBy + result.LastModifiedBy = &lastModifiedBy + } + + // Set property ‘LastModifiedByType’: + if data.LastModifiedByType != nil { + lastModifiedByType := *data.LastModifiedByType + result.LastModifiedByType = &lastModifiedByType + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (data *SystemData) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SystemDataARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (data *SystemData) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SystemDataARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SystemDataARM, 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 { + createdByType := *typedInput.CreatedByType + 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 { + lastModifiedByType := *typedInput.LastModifiedByType + data.LastModifiedByType = &lastModifiedByType + } + + // No error + return nil +} + +// AssignPropertiesFromSystemData populates our SystemData from the provided source SystemData +func (data *SystemData) AssignPropertiesFromSystemData(source *v20210701s.SystemData) error { + + // CreatedAt + if source.CreatedAt != nil { + createdAt := *source.CreatedAt + data.CreatedAt = &createdAt + } else { + data.CreatedAt = nil + } + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + if source.CreatedByType != nil { + createdByType := SystemDataCreatedByType(*source.CreatedByType) + data.CreatedByType = &createdByType + } else { + data.CreatedByType = nil + } + + // LastModifiedAt + if source.LastModifiedAt != nil { + lastModifiedAt := *source.LastModifiedAt + data.LastModifiedAt = &lastModifiedAt + } else { + data.LastModifiedAt = nil + } + + // LastModifiedBy + data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) + + // LastModifiedByType + if source.LastModifiedByType != nil { + lastModifiedByType := SystemDataLastModifiedByType(*source.LastModifiedByType) + data.LastModifiedByType = &lastModifiedByType + } else { + data.LastModifiedByType = nil + } + + // No error + return nil +} + +// AssignPropertiesToSystemData populates the provided destination SystemData from our SystemData +func (data *SystemData) AssignPropertiesToSystemData(destination *v20210701s.SystemData) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CreatedAt + if data.CreatedAt != nil { + createdAt := *data.CreatedAt + destination.CreatedAt = &createdAt + } else { + destination.CreatedAt = nil + } + + // CreatedBy + destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy) + + // CreatedByType + if data.CreatedByType != nil { + createdByType := string(*data.CreatedByType) + destination.CreatedByType = &createdByType + } else { + destination.CreatedByType = nil + } + + // LastModifiedAt + if data.LastModifiedAt != nil { + lastModifiedAt := *data.LastModifiedAt + destination.LastModifiedAt = &lastModifiedAt + } else { + destination.LastModifiedAt = nil + } + + // 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 +} + +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 *SystemDataStatusCreatedByType `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 *SystemDataStatusLastModifiedByType `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 &SystemData_StatusARM{} +} + +// 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.(SystemData_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SystemData_StatusARM, 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 { + createdByType := *typedInput.CreatedByType + 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 { + lastModifiedByType := *typedInput.LastModifiedByType + data.LastModifiedByType = &lastModifiedByType + } + + // No error + return nil +} + +// AssignPropertiesFromSystemDataStatus populates our SystemData_Status from the provided source SystemData_Status +func (data *SystemData_Status) AssignPropertiesFromSystemDataStatus(source *v20210701s.SystemData_Status) error { + + // CreatedAt + data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + if source.CreatedByType != nil { + createdByType := SystemDataStatusCreatedByType(*source.CreatedByType) + data.CreatedByType = &createdByType + } else { + data.CreatedByType = nil + } + + // LastModifiedAt + data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt) + + // LastModifiedBy + data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) + + // LastModifiedByType + if source.LastModifiedByType != nil { + lastModifiedByType := SystemDataStatusLastModifiedByType(*source.LastModifiedByType) + data.LastModifiedByType = &lastModifiedByType + } else { + data.LastModifiedByType = nil + } + + // No error + return nil +} + +// AssignPropertiesToSystemDataStatus populates the provided destination SystemData_Status from our SystemData_Status +func (data *SystemData_Status) AssignPropertiesToSystemDataStatus(destination *v20210701s.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 +} + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type WorkspaceOperatorSpec struct { + // Secrets: configures where to place Azure generated secrets. + Secrets *WorkspaceOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignPropertiesFromWorkspaceOperatorSpec populates our WorkspaceOperatorSpec from the provided source WorkspaceOperatorSpec +func (operator *WorkspaceOperatorSpec) AssignPropertiesFromWorkspaceOperatorSpec(source *v20210701s.WorkspaceOperatorSpec) error { + + // Secrets + if source.Secrets != nil { + var secret WorkspaceOperatorSecrets + err := secret.AssignPropertiesFromWorkspaceOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspaceOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignPropertiesToWorkspaceOperatorSpec populates the provided destination WorkspaceOperatorSpec from our WorkspaceOperatorSpec +func (operator *WorkspaceOperatorSpec) AssignPropertiesToWorkspaceOperatorSpec(destination *v20210701s.WorkspaceOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20210701s.WorkspaceOperatorSecrets + err := operator.Secrets.AssignPropertiesToWorkspaceOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspaceOperatorSecrets() 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 WorkspacePropertiesStatusProvisioningState string + +const ( + WorkspacePropertiesStatusProvisioningStateCanceled = WorkspacePropertiesStatusProvisioningState("Canceled") + WorkspacePropertiesStatusProvisioningStateCreating = WorkspacePropertiesStatusProvisioningState("Creating") + WorkspacePropertiesStatusProvisioningStateDeleting = WorkspacePropertiesStatusProvisioningState("Deleting") + WorkspacePropertiesStatusProvisioningStateFailed = WorkspacePropertiesStatusProvisioningState("Failed") + WorkspacePropertiesStatusProvisioningStateSucceeded = WorkspacePropertiesStatusProvisioningState("Succeeded") + WorkspacePropertiesStatusProvisioningStateUnknown = WorkspacePropertiesStatusProvisioningState("Unknown") + WorkspacePropertiesStatusProvisioningStateUpdating = WorkspacePropertiesStatusProvisioningState("Updating") +) + +type WorkspacePropertiesStatusPublicNetworkAccess string + +const ( + WorkspacePropertiesStatusPublicNetworkAccessDisabled = WorkspacePropertiesStatusPublicNetworkAccess("Disabled") + WorkspacePropertiesStatusPublicNetworkAccessEnabled = WorkspacePropertiesStatusPublicNetworkAccess("Enabled") +) + +// +kubebuilder:validation:Enum={"Disabled","Enabled"} +type WorkspacesSpecPropertiesPublicNetworkAccess string + +const ( + WorkspacesSpecPropertiesPublicNetworkAccessDisabled = WorkspacesSpecPropertiesPublicNetworkAccess("Disabled") + WorkspacesSpecPropertiesPublicNetworkAccessEnabled = WorkspacesSpecPropertiesPublicNetworkAccess("Enabled") +) + +type Workspaces_Spec_Properties_SharedPrivateLinkResources struct { + // GroupId: The private link resource group id. + GroupId *string `json:"groupId,omitempty"` + + // Name: Unique name of the private link. + Name *string `json:"name,omitempty"` + + // PrivateLinkResourceReference: The resource id that private link links to. + PrivateLinkResourceReference *genruntime.ResourceReference `armReference:"PrivateLinkResourceId" json:"privateLinkResourceReference,omitempty"` + + // RequestMessage: Request message. + RequestMessage *string `json:"requestMessage,omitempty"` + + // Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *SharedPrivateLinkResourcePropertyStatus `json:"status,omitempty"` +} + +var _ genruntime.ARMTransformer = &Workspaces_Spec_Properties_SharedPrivateLinkResources{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (resources *Workspaces_Spec_Properties_SharedPrivateLinkResources) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if resources == nil { + return nil, nil + } + result := &Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM{} + + // Set property ‘Name’: + if resources.Name != nil { + name := *resources.Name + result.Name = &name + } + + // Set property ‘Properties’: + if resources.GroupId != nil || + resources.PrivateLinkResourceReference != nil || + resources.RequestMessage != nil || + resources.Status != nil { + result.Properties = &SharedPrivateLinkResourcePropertyARM{} + } + if resources.GroupId != nil { + groupId := *resources.GroupId + result.Properties.GroupId = &groupId + } + if resources.PrivateLinkResourceReference != nil { + privateLinkResourceIdARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*resources.PrivateLinkResourceReference) + if err != nil { + return nil, err + } + privateLinkResourceId := privateLinkResourceIdARMID + result.Properties.PrivateLinkResourceId = &privateLinkResourceId + } + if resources.RequestMessage != nil { + requestMessage := *resources.RequestMessage + result.Properties.RequestMessage = &requestMessage + } + if resources.Status != nil { + status := *resources.Status + result.Properties.Status = &status + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (resources *Workspaces_Spec_Properties_SharedPrivateLinkResources) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (resources *Workspaces_Spec_Properties_SharedPrivateLinkResources) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM, got %T", armInput) + } + + // Set property ‘GroupId’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.GroupId != nil { + groupId := *typedInput.Properties.GroupId + resources.GroupId = &groupId + } + } + + // Set property ‘Name’: + if typedInput.Name != nil { + name := *typedInput.Name + resources.Name = &name + } + + // no assignment for property ‘PrivateLinkResourceReference’ + + // Set property ‘RequestMessage’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequestMessage != nil { + requestMessage := *typedInput.Properties.RequestMessage + resources.RequestMessage = &requestMessage + } + } + + // Set property ‘Status’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + resources.Status = &status + } + } + + // No error + return nil +} + +// AssignPropertiesFromWorkspacesSpecPropertiesSharedPrivateLinkResources populates our Workspaces_Spec_Properties_SharedPrivateLinkResources from the provided source Workspaces_Spec_Properties_SharedPrivateLinkResources +func (resources *Workspaces_Spec_Properties_SharedPrivateLinkResources) AssignPropertiesFromWorkspacesSpecPropertiesSharedPrivateLinkResources(source *v20210701s.Workspaces_Spec_Properties_SharedPrivateLinkResources) error { + + // GroupId + resources.GroupId = genruntime.ClonePointerToString(source.GroupId) + + // Name + resources.Name = genruntime.ClonePointerToString(source.Name) + + // PrivateLinkResourceReference + if source.PrivateLinkResourceReference != nil { + privateLinkResourceReference := source.PrivateLinkResourceReference.Copy() + resources.PrivateLinkResourceReference = &privateLinkResourceReference + } else { + resources.PrivateLinkResourceReference = nil + } + + // RequestMessage + resources.RequestMessage = genruntime.ClonePointerToString(source.RequestMessage) + + // Status + if source.Status != nil { + status := SharedPrivateLinkResourcePropertyStatus(*source.Status) + resources.Status = &status + } else { + resources.Status = nil + } + + // No error + return nil +} + +// AssignPropertiesToWorkspacesSpecPropertiesSharedPrivateLinkResources populates the provided destination Workspaces_Spec_Properties_SharedPrivateLinkResources from our Workspaces_Spec_Properties_SharedPrivateLinkResources +func (resources *Workspaces_Spec_Properties_SharedPrivateLinkResources) AssignPropertiesToWorkspacesSpecPropertiesSharedPrivateLinkResources(destination *v20210701s.Workspaces_Spec_Properties_SharedPrivateLinkResources) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // GroupId + destination.GroupId = genruntime.ClonePointerToString(resources.GroupId) + + // Name + destination.Name = genruntime.ClonePointerToString(resources.Name) + + // PrivateLinkResourceReference + if resources.PrivateLinkResourceReference != nil { + privateLinkResourceReference := resources.PrivateLinkResourceReference.Copy() + destination.PrivateLinkResourceReference = &privateLinkResourceReference + } else { + destination.PrivateLinkResourceReference = nil + } + + // RequestMessage + destination.RequestMessage = genruntime.ClonePointerToString(resources.RequestMessage) + + // Status + if resources.Status != nil { + status := string(*resources.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/CosmosDbSettings +type CosmosDbSettings struct { + // CollectionsThroughput: The throughput of the collections in cosmosdb database + CollectionsThroughput *int `json:"collectionsThroughput,omitempty"` +} + +var _ genruntime.ARMTransformer = &CosmosDbSettings{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (settings *CosmosDbSettings) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if settings == nil { + return nil, nil + } + result := &CosmosDbSettingsARM{} + + // Set property ‘CollectionsThroughput’: + if settings.CollectionsThroughput != nil { + collectionsThroughput := *settings.CollectionsThroughput + result.CollectionsThroughput = &collectionsThroughput + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (settings *CosmosDbSettings) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CosmosDbSettingsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (settings *CosmosDbSettings) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CosmosDbSettingsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CosmosDbSettingsARM, got %T", armInput) + } + + // Set property ‘CollectionsThroughput’: + if typedInput.CollectionsThroughput != nil { + collectionsThroughput := *typedInput.CollectionsThroughput + settings.CollectionsThroughput = &collectionsThroughput + } + + // No error + return nil +} + +// AssignPropertiesFromCosmosDbSettings populates our CosmosDbSettings from the provided source CosmosDbSettings +func (settings *CosmosDbSettings) AssignPropertiesFromCosmosDbSettings(source *v20210701s.CosmosDbSettings) error { + + // CollectionsThroughput + settings.CollectionsThroughput = genruntime.ClonePointerToInt(source.CollectionsThroughput) + + // No error + return nil +} + +// AssignPropertiesToCosmosDbSettings populates the provided destination CosmosDbSettings from our CosmosDbSettings +func (settings *CosmosDbSettings) AssignPropertiesToCosmosDbSettings(destination *v20210701s.CosmosDbSettings) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CollectionsThroughput + destination.CollectionsThroughput = genruntime.ClonePointerToInt(settings.CollectionsThroughput) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type CosmosDbSettings_Status struct { + // CollectionsThroughput: The throughput of the collections in cosmosdb database + CollectionsThroughput *int `json:"collectionsThroughput,omitempty"` +} + +var _ genruntime.FromARMConverter = &CosmosDbSettings_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (settings *CosmosDbSettings_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CosmosDbSettings_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (settings *CosmosDbSettings_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CosmosDbSettings_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CosmosDbSettings_StatusARM, got %T", armInput) + } + + // Set property ‘CollectionsThroughput’: + if typedInput.CollectionsThroughput != nil { + collectionsThroughput := *typedInput.CollectionsThroughput + settings.CollectionsThroughput = &collectionsThroughput + } + + // No error + return nil +} + +// AssignPropertiesFromCosmosDbSettingsStatus populates our CosmosDbSettings_Status from the provided source CosmosDbSettings_Status +func (settings *CosmosDbSettings_Status) AssignPropertiesFromCosmosDbSettingsStatus(source *v20210701s.CosmosDbSettings_Status) error { + + // CollectionsThroughput + settings.CollectionsThroughput = genruntime.ClonePointerToInt(source.CollectionsThroughput) + + // No error + return nil +} + +// AssignPropertiesToCosmosDbSettingsStatus populates the provided destination CosmosDbSettings_Status from our CosmosDbSettings_Status +func (settings *CosmosDbSettings_Status) AssignPropertiesToCosmosDbSettingsStatus(destination *v20210701s.CosmosDbSettings_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CollectionsThroughput + destination.CollectionsThroughput = genruntime.ClonePointerToInt(settings.CollectionsThroughput) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Disabled","Enabled"} +type EncryptionPropertyStatus string + +const ( + EncryptionPropertyStatusDisabled = EncryptionPropertyStatus("Disabled") + EncryptionPropertyStatusEnabled = EncryptionPropertyStatus("Enabled") +) + +type EncryptionPropertyStatusStatus string + +const ( + EncryptionPropertyStatusStatusDisabled = EncryptionPropertyStatusStatus("Disabled") + EncryptionPropertyStatusStatusEnabled = EncryptionPropertyStatusStatus("Enabled") +) + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/IdentityForCmk +type IdentityForCmk struct { + // UserAssignedIdentity: The ArmId of the user assigned identity that will be used to access the customer managed key vault + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +var _ genruntime.ARMTransformer = &IdentityForCmk{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (forCmk *IdentityForCmk) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if forCmk == nil { + return nil, nil + } + result := &IdentityForCmkARM{} + + // Set property ‘UserAssignedIdentity’: + if forCmk.UserAssignedIdentity != nil { + userAssignedIdentity := *forCmk.UserAssignedIdentity + result.UserAssignedIdentity = &userAssignedIdentity + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (forCmk *IdentityForCmk) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &IdentityForCmkARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (forCmk *IdentityForCmk) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(IdentityForCmkARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected IdentityForCmkARM, got %T", armInput) + } + + // Set property ‘UserAssignedIdentity’: + if typedInput.UserAssignedIdentity != nil { + userAssignedIdentity := *typedInput.UserAssignedIdentity + forCmk.UserAssignedIdentity = &userAssignedIdentity + } + + // No error + return nil +} + +// AssignPropertiesFromIdentityForCmk populates our IdentityForCmk from the provided source IdentityForCmk +func (forCmk *IdentityForCmk) AssignPropertiesFromIdentityForCmk(source *v20210701s.IdentityForCmk) error { + + // UserAssignedIdentity + forCmk.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) + + // No error + return nil +} + +// AssignPropertiesToIdentityForCmk populates the provided destination IdentityForCmk from our IdentityForCmk +func (forCmk *IdentityForCmk) AssignPropertiesToIdentityForCmk(destination *v20210701s.IdentityForCmk) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // UserAssignedIdentity + destination.UserAssignedIdentity = genruntime.ClonePointerToString(forCmk.UserAssignedIdentity) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type IdentityForCmk_Status struct { + // UserAssignedIdentity: The ArmId of the user assigned identity that will be used to access the customer managed key vault + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +var _ genruntime.FromARMConverter = &IdentityForCmk_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (forCmk *IdentityForCmk_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &IdentityForCmk_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (forCmk *IdentityForCmk_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(IdentityForCmk_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected IdentityForCmk_StatusARM, got %T", armInput) + } + + // Set property ‘UserAssignedIdentity’: + if typedInput.UserAssignedIdentity != nil { + userAssignedIdentity := *typedInput.UserAssignedIdentity + forCmk.UserAssignedIdentity = &userAssignedIdentity + } + + // No error + return nil +} + +// AssignPropertiesFromIdentityForCmkStatus populates our IdentityForCmk_Status from the provided source IdentityForCmk_Status +func (forCmk *IdentityForCmk_Status) AssignPropertiesFromIdentityForCmkStatus(source *v20210701s.IdentityForCmk_Status) error { + + // UserAssignedIdentity + forCmk.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) + + // No error + return nil +} + +// AssignPropertiesToIdentityForCmkStatus populates the provided destination IdentityForCmk_Status from our IdentityForCmk_Status +func (forCmk *IdentityForCmk_Status) AssignPropertiesToIdentityForCmkStatus(destination *v20210701s.IdentityForCmk_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // UserAssignedIdentity + destination.UserAssignedIdentity = genruntime.ClonePointerToString(forCmk.UserAssignedIdentity) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/KeyVaultProperties +type KeyVaultProperties struct { + // IdentityClientId: For future use - The client id of the identity which will be used to access key vault. + IdentityClientId *string `json:"identityClientId,omitempty"` + + // +kubebuilder:validation:Required + // KeyIdentifier: Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + + // +kubebuilder:validation:Required + // KeyVaultArmId: The ArmId of the keyVault where the customer owned encryption key is present. + KeyVaultArmId *string `json:"keyVaultArmId,omitempty"` +} + +var _ genruntime.ARMTransformer = &KeyVaultProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *KeyVaultProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &KeyVaultPropertiesARM{} + + // Set property ‘IdentityClientId’: + if properties.IdentityClientId != nil { + identityClientId := *properties.IdentityClientId + result.IdentityClientId = &identityClientId + } + + // Set property ‘KeyIdentifier’: + if properties.KeyIdentifier != nil { + keyIdentifier := *properties.KeyIdentifier + result.KeyIdentifier = &keyIdentifier + } + + // Set property ‘KeyVaultArmId’: + if properties.KeyVaultArmId != nil { + keyVaultArmId := *properties.KeyVaultArmId + result.KeyVaultArmId = &keyVaultArmId + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *KeyVaultProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &KeyVaultPropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *KeyVaultProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(KeyVaultPropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected KeyVaultPropertiesARM, got %T", armInput) + } + + // Set property ‘IdentityClientId’: + if typedInput.IdentityClientId != nil { + identityClientId := *typedInput.IdentityClientId + properties.IdentityClientId = &identityClientId + } + + // Set property ‘KeyIdentifier’: + if typedInput.KeyIdentifier != nil { + keyIdentifier := *typedInput.KeyIdentifier + properties.KeyIdentifier = &keyIdentifier + } + + // Set property ‘KeyVaultArmId’: + if typedInput.KeyVaultArmId != nil { + keyVaultArmId := *typedInput.KeyVaultArmId + properties.KeyVaultArmId = &keyVaultArmId + } + + // No error + return nil +} + +// AssignPropertiesFromKeyVaultProperties populates our KeyVaultProperties from the provided source KeyVaultProperties +func (properties *KeyVaultProperties) AssignPropertiesFromKeyVaultProperties(source *v20210701s.KeyVaultProperties) error { + + // IdentityClientId + properties.IdentityClientId = genruntime.ClonePointerToString(source.IdentityClientId) + + // KeyIdentifier + properties.KeyIdentifier = genruntime.ClonePointerToString(source.KeyIdentifier) + + // KeyVaultArmId + properties.KeyVaultArmId = genruntime.ClonePointerToString(source.KeyVaultArmId) + + // No error + return nil +} + +// AssignPropertiesToKeyVaultProperties populates the provided destination KeyVaultProperties from our KeyVaultProperties +func (properties *KeyVaultProperties) AssignPropertiesToKeyVaultProperties(destination *v20210701s.KeyVaultProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // IdentityClientId + destination.IdentityClientId = genruntime.ClonePointerToString(properties.IdentityClientId) + + // KeyIdentifier + destination.KeyIdentifier = genruntime.ClonePointerToString(properties.KeyIdentifier) + + // KeyVaultArmId + destination.KeyVaultArmId = genruntime.ClonePointerToString(properties.KeyVaultArmId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type KeyVaultProperties_Status struct { + // IdentityClientId: For future use - The client id of the identity which will be used to access key vault. + IdentityClientId *string `json:"identityClientId,omitempty"` + + // KeyIdentifier: Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + + // KeyVaultArmId: The ArmId of the keyVault where the customer owned encryption key is present. + KeyVaultArmId *string `json:"keyVaultArmId,omitempty"` +} + +var _ genruntime.FromARMConverter = &KeyVaultProperties_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *KeyVaultProperties_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &KeyVaultProperties_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *KeyVaultProperties_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(KeyVaultProperties_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected KeyVaultProperties_StatusARM, got %T", armInput) + } + + // Set property ‘IdentityClientId’: + if typedInput.IdentityClientId != nil { + identityClientId := *typedInput.IdentityClientId + properties.IdentityClientId = &identityClientId + } + + // Set property ‘KeyIdentifier’: + if typedInput.KeyIdentifier != nil { + keyIdentifier := *typedInput.KeyIdentifier + properties.KeyIdentifier = &keyIdentifier + } + + // Set property ‘KeyVaultArmId’: + if typedInput.KeyVaultArmId != nil { + keyVaultArmId := *typedInput.KeyVaultArmId + properties.KeyVaultArmId = &keyVaultArmId + } + + // No error + return nil +} + +// AssignPropertiesFromKeyVaultPropertiesStatus populates our KeyVaultProperties_Status from the provided source KeyVaultProperties_Status +func (properties *KeyVaultProperties_Status) AssignPropertiesFromKeyVaultPropertiesStatus(source *v20210701s.KeyVaultProperties_Status) error { + + // IdentityClientId + properties.IdentityClientId = genruntime.ClonePointerToString(source.IdentityClientId) + + // KeyIdentifier + properties.KeyIdentifier = genruntime.ClonePointerToString(source.KeyIdentifier) + + // KeyVaultArmId + properties.KeyVaultArmId = genruntime.ClonePointerToString(source.KeyVaultArmId) + + // No error + return nil +} + +// AssignPropertiesToKeyVaultPropertiesStatus populates the provided destination KeyVaultProperties_Status from our KeyVaultProperties_Status +func (properties *KeyVaultProperties_Status) AssignPropertiesToKeyVaultPropertiesStatus(destination *v20210701s.KeyVaultProperties_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // IdentityClientId + destination.IdentityClientId = genruntime.ClonePointerToString(properties.IdentityClientId) + + // KeyIdentifier + destination.KeyIdentifier = genruntime.ClonePointerToString(properties.KeyIdentifier) + + // KeyVaultArmId + destination.KeyVaultArmId = genruntime.ClonePointerToString(properties.KeyVaultArmId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type NotebookPreparationError_Status struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +var _ genruntime.FromARMConverter = &NotebookPreparationError_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (error *NotebookPreparationError_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &NotebookPreparationError_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (error *NotebookPreparationError_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(NotebookPreparationError_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected NotebookPreparationError_StatusARM, got %T", armInput) + } + + // Set property ‘ErrorMessage’: + if typedInput.ErrorMessage != nil { + errorMessage := *typedInput.ErrorMessage + error.ErrorMessage = &errorMessage + } + + // Set property ‘StatusCode’: + if typedInput.StatusCode != nil { + statusCode := *typedInput.StatusCode + error.StatusCode = &statusCode + } + + // No error + return nil +} + +// AssignPropertiesFromNotebookPreparationErrorStatus populates our NotebookPreparationError_Status from the provided source NotebookPreparationError_Status +func (error *NotebookPreparationError_Status) AssignPropertiesFromNotebookPreparationErrorStatus(source *v20210701s.NotebookPreparationError_Status) error { + + // ErrorMessage + error.ErrorMessage = genruntime.ClonePointerToString(source.ErrorMessage) + + // StatusCode + error.StatusCode = genruntime.ClonePointerToInt(source.StatusCode) + + // No error + return nil +} + +// AssignPropertiesToNotebookPreparationErrorStatus populates the provided destination NotebookPreparationError_Status from our NotebookPreparationError_Status +func (error *NotebookPreparationError_Status) AssignPropertiesToNotebookPreparationErrorStatus(destination *v20210701s.NotebookPreparationError_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ErrorMessage + destination.ErrorMessage = genruntime.ClonePointerToString(error.ErrorMessage) + + // StatusCode + destination.StatusCode = genruntime.ClonePointerToInt(error.StatusCode) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type PrivateEndpointServiceConnectionStatus_Status string + +const ( + PrivateEndpointServiceConnectionStatus_StatusApproved = PrivateEndpointServiceConnectionStatus_Status("Approved") + PrivateEndpointServiceConnectionStatus_StatusDisconnected = PrivateEndpointServiceConnectionStatus_Status("Disconnected") + PrivateEndpointServiceConnectionStatus_StatusPending = PrivateEndpointServiceConnectionStatus_Status("Pending") + PrivateEndpointServiceConnectionStatus_StatusRejected = PrivateEndpointServiceConnectionStatus_Status("Rejected") + PrivateEndpointServiceConnectionStatus_StatusTimeout = PrivateEndpointServiceConnectionStatus_Status("Timeout") +) + +// +kubebuilder:validation:Enum={"Approved","Disconnected","Pending","Rejected","Timeout"} +type SharedPrivateLinkResourcePropertyStatus string + +const ( + SharedPrivateLinkResourcePropertyStatusApproved = SharedPrivateLinkResourcePropertyStatus("Approved") + SharedPrivateLinkResourcePropertyStatusDisconnected = SharedPrivateLinkResourcePropertyStatus("Disconnected") + SharedPrivateLinkResourcePropertyStatusPending = SharedPrivateLinkResourcePropertyStatus("Pending") + SharedPrivateLinkResourcePropertyStatusRejected = SharedPrivateLinkResourcePropertyStatus("Rejected") + SharedPrivateLinkResourcePropertyStatusTimeout = SharedPrivateLinkResourcePropertyStatus("Timeout") +) + +type UserAssignedIdentity_Status struct { + // ClientId: The clientId(aka appId) of the user assigned identity. + ClientId *string `json:"clientId,omitempty"` + + // PrincipalId: The principal ID of the user assigned identity. + PrincipalId *string `json:"principalId,omitempty"` + + // TenantId: The tenant ID of the user assigned identity. + TenantId *string `json:"tenantId,omitempty"` +} + +var _ genruntime.FromARMConverter = &UserAssignedIdentity_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *UserAssignedIdentity_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &UserAssignedIdentity_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *UserAssignedIdentity_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(UserAssignedIdentity_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAssignedIdentity_StatusARM, got %T", armInput) + } + + // Set property ‘ClientId’: + if typedInput.ClientId != nil { + clientId := *typedInput.ClientId + identity.ClientId = &clientId + } + + // 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 + } + + // No error + return nil +} + +// AssignPropertiesFromUserAssignedIdentityStatus populates our UserAssignedIdentity_Status from the provided source UserAssignedIdentity_Status +func (identity *UserAssignedIdentity_Status) AssignPropertiesFromUserAssignedIdentityStatus(source *v20210701s.UserAssignedIdentity_Status) error { + + // ClientId + identity.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // TenantId + identity.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // No error + return nil +} + +// AssignPropertiesToUserAssignedIdentityStatus populates the provided destination UserAssignedIdentity_Status from our UserAssignedIdentity_Status +func (identity *UserAssignedIdentity_Status) AssignPropertiesToUserAssignedIdentityStatus(destination *v20210701s.UserAssignedIdentity_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(identity.ClientId) + + // PrincipalId + destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId) + + // TenantId + destination.TenantId = genruntime.ClonePointerToString(identity.TenantId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type WorkspaceOperatorSecrets struct { + // AppInsightsInstrumentationKey: indicates where the AppInsightsInstrumentationKey secret should be placed. If omitted, + // the secret will not be retrieved from Azure. + AppInsightsInstrumentationKey *genruntime.SecretDestination `json:"appInsightsInstrumentationKey,omitempty"` + + // ContainerRegistryPassword: indicates where the ContainerRegistryPassword secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + ContainerRegistryPassword *genruntime.SecretDestination `json:"containerRegistryPassword,omitempty"` + + // ContainerRegistryPassword2: indicates where the ContainerRegistryPassword2 secret should be placed. If omitted, the + // secret will not be retrieved from Azure. + ContainerRegistryPassword2 *genruntime.SecretDestination `json:"containerRegistryPassword2,omitempty"` + + // ContainerRegistryUserName: indicates where the ContainerRegistryUserName secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + ContainerRegistryUserName *genruntime.SecretDestination `json:"containerRegistryUserName,omitempty"` + + // PrimaryNotebookAccessKey: indicates where the PrimaryNotebookAccessKey secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + PrimaryNotebookAccessKey *genruntime.SecretDestination `json:"primaryNotebookAccessKey,omitempty"` + + // SecondaryNotebookAccessKey: indicates where the SecondaryNotebookAccessKey secret should be placed. If omitted, the + // secret will not be retrieved from Azure. + SecondaryNotebookAccessKey *genruntime.SecretDestination `json:"secondaryNotebookAccessKey,omitempty"` + + // UserStorageKey: indicates where the UserStorageKey secret should be placed. If omitted, the secret will not be retrieved + // from Azure. + UserStorageKey *genruntime.SecretDestination `json:"userStorageKey,omitempty"` +} + +// AssignPropertiesFromWorkspaceOperatorSecrets populates our WorkspaceOperatorSecrets from the provided source WorkspaceOperatorSecrets +func (secrets *WorkspaceOperatorSecrets) AssignPropertiesFromWorkspaceOperatorSecrets(source *v20210701s.WorkspaceOperatorSecrets) error { + + // AppInsightsInstrumentationKey + if source.AppInsightsInstrumentationKey != nil { + appInsightsInstrumentationKey := source.AppInsightsInstrumentationKey.Copy() + secrets.AppInsightsInstrumentationKey = &appInsightsInstrumentationKey + } else { + secrets.AppInsightsInstrumentationKey = nil + } + + // ContainerRegistryPassword + if source.ContainerRegistryPassword != nil { + containerRegistryPassword := source.ContainerRegistryPassword.Copy() + secrets.ContainerRegistryPassword = &containerRegistryPassword + } else { + secrets.ContainerRegistryPassword = nil + } + + // ContainerRegistryPassword2 + if source.ContainerRegistryPassword2 != nil { + containerRegistryPassword2 := source.ContainerRegistryPassword2.Copy() + secrets.ContainerRegistryPassword2 = &containerRegistryPassword2 + } else { + secrets.ContainerRegistryPassword2 = nil + } + + // ContainerRegistryUserName + if source.ContainerRegistryUserName != nil { + containerRegistryUserName := source.ContainerRegistryUserName.Copy() + secrets.ContainerRegistryUserName = &containerRegistryUserName + } else { + secrets.ContainerRegistryUserName = nil + } + + // PrimaryNotebookAccessKey + if source.PrimaryNotebookAccessKey != nil { + primaryNotebookAccessKey := source.PrimaryNotebookAccessKey.Copy() + secrets.PrimaryNotebookAccessKey = &primaryNotebookAccessKey + } else { + secrets.PrimaryNotebookAccessKey = nil + } + + // SecondaryNotebookAccessKey + if source.SecondaryNotebookAccessKey != nil { + secondaryNotebookAccessKey := source.SecondaryNotebookAccessKey.Copy() + secrets.SecondaryNotebookAccessKey = &secondaryNotebookAccessKey + } else { + secrets.SecondaryNotebookAccessKey = nil + } + + // UserStorageKey + if source.UserStorageKey != nil { + userStorageKey := source.UserStorageKey.Copy() + secrets.UserStorageKey = &userStorageKey + } else { + secrets.UserStorageKey = nil + } + + // No error + return nil +} + +// AssignPropertiesToWorkspaceOperatorSecrets populates the provided destination WorkspaceOperatorSecrets from our WorkspaceOperatorSecrets +func (secrets *WorkspaceOperatorSecrets) AssignPropertiesToWorkspaceOperatorSecrets(destination *v20210701s.WorkspaceOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AppInsightsInstrumentationKey + if secrets.AppInsightsInstrumentationKey != nil { + appInsightsInstrumentationKey := secrets.AppInsightsInstrumentationKey.Copy() + destination.AppInsightsInstrumentationKey = &appInsightsInstrumentationKey + } else { + destination.AppInsightsInstrumentationKey = nil + } + + // ContainerRegistryPassword + if secrets.ContainerRegistryPassword != nil { + containerRegistryPassword := secrets.ContainerRegistryPassword.Copy() + destination.ContainerRegistryPassword = &containerRegistryPassword + } else { + destination.ContainerRegistryPassword = nil + } + + // ContainerRegistryPassword2 + if secrets.ContainerRegistryPassword2 != nil { + containerRegistryPassword2 := secrets.ContainerRegistryPassword2.Copy() + destination.ContainerRegistryPassword2 = &containerRegistryPassword2 + } else { + destination.ContainerRegistryPassword2 = nil + } + + // ContainerRegistryUserName + if secrets.ContainerRegistryUserName != nil { + containerRegistryUserName := secrets.ContainerRegistryUserName.Copy() + destination.ContainerRegistryUserName = &containerRegistryUserName + } else { + destination.ContainerRegistryUserName = nil + } + + // PrimaryNotebookAccessKey + if secrets.PrimaryNotebookAccessKey != nil { + primaryNotebookAccessKey := secrets.PrimaryNotebookAccessKey.Copy() + destination.PrimaryNotebookAccessKey = &primaryNotebookAccessKey + } else { + destination.PrimaryNotebookAccessKey = nil + } + + // SecondaryNotebookAccessKey + if secrets.SecondaryNotebookAccessKey != nil { + secondaryNotebookAccessKey := secrets.SecondaryNotebookAccessKey.Copy() + destination.SecondaryNotebookAccessKey = &secondaryNotebookAccessKey + } else { + destination.SecondaryNotebookAccessKey = nil + } + + // UserStorageKey + if secrets.UserStorageKey != nil { + userStorageKey := secrets.UserStorageKey.Copy() + destination.UserStorageKey = &userStorageKey + } else { + destination.UserStorageKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&Workspace{}, &WorkspaceList{}) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspace_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspace_types_gen_test.go new file mode 100644 index 0000000000..1ac4a9a385 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspace_types_gen_test.go @@ -0,0 +1,3014 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import ( + "encoding/json" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "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_Workspace_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 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 v20210701s.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 AssignPropertiesToWorkspace & AssignPropertiesFromWorkspace 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 v1beta20210701storage 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 v20210701s.Workspace + err := copied.AssignPropertiesToWorkspace(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace + err = actual.AssignPropertiesFromWorkspace(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + 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.MaxSize = 10 + 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"] = WorkspacesSpecGenerator() + gens["Status"] = WorkspaceStatusGenerator() +} + +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 AssignPropertiesToWorkspaceStatus & AssignPropertiesFromWorkspaceStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceStatus, WorkspaceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceStatus tests if a specific instance of Workspace_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceStatus(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 v20210701s.Workspace_Status + err := copied.AssignPropertiesToWorkspaceStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspace_Status + err = actual.AssignPropertiesFromWorkspaceStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + 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.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspace_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceStatus, WorkspaceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceStatus runs a test to see if a specific instance of Workspace_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceStatus(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 WorkspaceStatusGenerator() +var workspaceStatusGenerator gopter.Gen + +// WorkspaceStatusGenerator returns a generator of Workspace_Status instances for property testing. +// We first initialize workspaceStatusGenerator 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 WorkspaceStatusGenerator() gopter.Gen { + if workspaceStatusGenerator != nil { + return workspaceStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceStatus(generators) + workspaceStatusGenerator = 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) + AddIndependentPropertyGeneratorsForWorkspaceStatus(generators) + AddRelatedPropertyGeneratorsForWorkspaceStatus(generators) + workspaceStatusGenerator = gen.Struct(reflect.TypeOf(Workspace_Status{}), generators) + + return workspaceStatusGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceStatus(gens map[string]gopter.Gen) { + gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool()) + gens["ApplicationInsights"] = gen.PtrOf(gen.AlphaString()) + gens["ContainerRegistry"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString()) + gens["FriendlyName"] = gen.PtrOf(gen.AlphaString()) + gens["HbiWorkspace"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVault"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MlFlowTrackingUri"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PrimaryUserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateLinkCount"] = gen.PtrOf(gen.Int()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + WorkspacePropertiesStatusProvisioningStateCanceled, + WorkspacePropertiesStatusProvisioningStateCreating, + WorkspacePropertiesStatusProvisioningStateDeleting, + WorkspacePropertiesStatusProvisioningStateFailed, + WorkspacePropertiesStatusProvisioningStateSucceeded, + WorkspacePropertiesStatusProvisioningStateUnknown, + WorkspacePropertiesStatusProvisioningStateUpdating)) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(WorkspacePropertiesStatusPublicNetworkAccessDisabled, WorkspacePropertiesStatusPublicNetworkAccessEnabled)) + gens["ServiceProvisionedResourceGroup"] = gen.PtrOf(gen.AlphaString()) + gens["StorageAccount"] = gen.PtrOf(gen.AlphaString()) + gens["StorageHnsEnabled"] = gen.PtrOf(gen.Bool()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspaceStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceStatus(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionPropertyStatusGenerator()) + gens["Identity"] = gen.PtrOf(IdentityStatusGenerator()) + gens["NotebookInfo"] = gen.PtrOf(NotebookResourceInfoStatusGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator()) + gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsStatusGenerator()) + gens["SharedPrivateLinkResources"] = gen.SliceOf(SharedPrivateLinkResourceStatusGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusGenerator()) +} + +func Test_Workspaces_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspaces_Spec to Workspaces_Spec via AssignPropertiesToWorkspacesSpec & AssignPropertiesFromWorkspacesSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspacesSpec, WorkspacesSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspacesSpec tests if a specific instance of Workspaces_Spec can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspacesSpec(subject Workspaces_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 v20210701s.Workspaces_Spec + err := copied.AssignPropertiesToWorkspacesSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspaces_Spec + err = actual.AssignPropertiesFromWorkspacesSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Workspaces_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspaces_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesSpec, WorkspacesSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesSpec runs a test to see if a specific instance of Workspaces_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesSpec(subject Workspaces_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspaces_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 Workspaces_Spec instances for property testing - lazily instantiated by WorkspacesSpecGenerator() +var workspacesSpecGenerator gopter.Gen + +// WorkspacesSpecGenerator returns a generator of Workspaces_Spec instances for property testing. +// We first initialize workspacesSpecGenerator 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 WorkspacesSpecGenerator() gopter.Gen { + if workspacesSpecGenerator != nil { + return workspacesSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpec(generators) + workspacesSpecGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpec(generators) + AddRelatedPropertyGeneratorsForWorkspacesSpec(generators) + workspacesSpecGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec{}), generators) + + return workspacesSpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesSpec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesSpec(gens map[string]gopter.Gen) { + gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool()) + gens["AzureName"] = gen.AlphaString() + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString()) + gens["FriendlyName"] = gen.PtrOf(gen.AlphaString()) + gens["HbiWorkspace"] = gen.PtrOf(gen.Bool()) + gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(WorkspacesSpecPropertiesPublicNetworkAccessDisabled, WorkspacesSpecPropertiesPublicNetworkAccessEnabled)) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesSpec(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionPropertyGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(WorkspaceOperatorSpecGenerator()) + gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsGenerator()) + gens["SharedPrivateLinkResources"] = gen.SliceOf(WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator()) + gens["Sku"] = gen.PtrOf(SkuGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataGenerator()) +} + +func Test_EncryptionProperty_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from EncryptionProperty to EncryptionProperty via AssignPropertiesToEncryptionProperty & AssignPropertiesFromEncryptionProperty returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryptionProperty, EncryptionPropertyGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryptionProperty tests if a specific instance of EncryptionProperty can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForEncryptionProperty(subject EncryptionProperty) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.EncryptionProperty + err := copied.AssignPropertiesToEncryptionProperty(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual EncryptionProperty + err = actual.AssignPropertiesFromEncryptionProperty(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_EncryptionProperty_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of EncryptionProperty via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryptionProperty, EncryptionPropertyGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryptionProperty runs a test to see if a specific instance of EncryptionProperty round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryptionProperty(subject EncryptionProperty) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual EncryptionProperty + 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 EncryptionProperty instances for property testing - lazily instantiated by EncryptionPropertyGenerator() +var encryptionPropertyGenerator gopter.Gen + +// EncryptionPropertyGenerator returns a generator of EncryptionProperty instances for property testing. +// We first initialize encryptionPropertyGenerator 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 EncryptionPropertyGenerator() gopter.Gen { + if encryptionPropertyGenerator != nil { + return encryptionPropertyGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionProperty(generators) + encryptionPropertyGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionProperty(generators) + AddRelatedPropertyGeneratorsForEncryptionProperty(generators) + encryptionPropertyGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty{}), generators) + + return encryptionPropertyGenerator +} + +// AddIndependentPropertyGeneratorsForEncryptionProperty is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryptionProperty(gens map[string]gopter.Gen) { + gens["Status"] = gen.PtrOf(gen.OneConstOf(EncryptionPropertyStatusDisabled, EncryptionPropertyStatusEnabled)) +} + +// AddRelatedPropertyGeneratorsForEncryptionProperty is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryptionProperty(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityForCmkGenerator()) + gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesGenerator()) +} + +func Test_EncryptionProperty_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from EncryptionProperty_Status to EncryptionProperty_Status via AssignPropertiesToEncryptionPropertyStatus & AssignPropertiesFromEncryptionPropertyStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryptionPropertyStatus, EncryptionPropertyStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryptionPropertyStatus tests if a specific instance of EncryptionProperty_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForEncryptionPropertyStatus(subject EncryptionProperty_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 v20210701s.EncryptionProperty_Status + err := copied.AssignPropertiesToEncryptionPropertyStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual EncryptionProperty_Status + err = actual.AssignPropertiesFromEncryptionPropertyStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_EncryptionProperty_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of EncryptionProperty_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryptionPropertyStatus, EncryptionPropertyStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryptionPropertyStatus runs a test to see if a specific instance of EncryptionProperty_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryptionPropertyStatus(subject EncryptionProperty_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual EncryptionProperty_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 EncryptionProperty_Status instances for property testing - lazily instantiated by +// EncryptionPropertyStatusGenerator() +var encryptionPropertyStatusGenerator gopter.Gen + +// EncryptionPropertyStatusGenerator returns a generator of EncryptionProperty_Status instances for property testing. +// We first initialize encryptionPropertyStatusGenerator 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 EncryptionPropertyStatusGenerator() gopter.Gen { + if encryptionPropertyStatusGenerator != nil { + return encryptionPropertyStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyStatus(generators) + encryptionPropertyStatusGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyStatus(generators) + AddRelatedPropertyGeneratorsForEncryptionPropertyStatus(generators) + encryptionPropertyStatusGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_Status{}), generators) + + return encryptionPropertyStatusGenerator +} + +// AddIndependentPropertyGeneratorsForEncryptionPropertyStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryptionPropertyStatus(gens map[string]gopter.Gen) { + gens["Status"] = gen.PtrOf(gen.OneConstOf(EncryptionPropertyStatusStatusDisabled, EncryptionPropertyStatusStatusEnabled)) +} + +// AddRelatedPropertyGeneratorsForEncryptionPropertyStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryptionPropertyStatus(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityForCmkStatusGenerator()) + gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesStatusGenerator()) +} + +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 AssignPropertiesToIdentity & AssignPropertiesFromIdentity 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 v1beta20210701storage 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 v20210701s.Identity + err := copied.AssignPropertiesToIdentity(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity + err = actual.AssignPropertiesFromIdentity(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + 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.MaxSize = 10 + 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. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(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( + IdentityTypeNone, + IdentityTypeSystemAssigned, + IdentityTypeSystemAssignedUserAssigned, + IdentityTypeUserAssigned)) +} + +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 AssignPropertiesToIdentityStatus & AssignPropertiesFromIdentityStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentityStatus, IdentityStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentityStatus tests if a specific instance of Identity_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForIdentityStatus(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 v20210701s.Identity_Status + err := copied.AssignPropertiesToIdentityStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity_Status + err = actual.AssignPropertiesFromIdentityStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + 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.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityStatus, IdentityStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityStatus runs a test to see if a specific instance of Identity_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityStatus(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 IdentityStatusGenerator() +var identityStatusGenerator gopter.Gen + +// IdentityStatusGenerator returns a generator of Identity_Status instances for property testing. +// We first initialize identityStatusGenerator 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 IdentityStatusGenerator() gopter.Gen { + if identityStatusGenerator != nil { + return identityStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityStatus(generators) + identityStatusGenerator = 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) + AddIndependentPropertyGeneratorsForIdentityStatus(generators) + AddRelatedPropertyGeneratorsForIdentityStatus(generators) + identityStatusGenerator = gen.Struct(reflect.TypeOf(Identity_Status{}), generators) + + return identityStatusGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityStatus(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.OneConstOf( + IdentityStatusTypeNone, + IdentityStatusTypeSystemAssigned, + IdentityStatusTypeSystemAssignedUserAssigned, + IdentityStatusTypeUserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentityStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentityStatus(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentityStatusGenerator()) +} + +func Test_NotebookResourceInfo_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NotebookResourceInfo_Status to NotebookResourceInfo_Status via AssignPropertiesToNotebookResourceInfoStatus & AssignPropertiesFromNotebookResourceInfoStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForNotebookResourceInfoStatus, NotebookResourceInfoStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNotebookResourceInfoStatus tests if a specific instance of NotebookResourceInfo_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForNotebookResourceInfoStatus(subject NotebookResourceInfo_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 v20210701s.NotebookResourceInfo_Status + err := copied.AssignPropertiesToNotebookResourceInfoStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NotebookResourceInfo_Status + err = actual.AssignPropertiesFromNotebookResourceInfoStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NotebookResourceInfo_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NotebookResourceInfo_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNotebookResourceInfoStatus, NotebookResourceInfoStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNotebookResourceInfoStatus runs a test to see if a specific instance of NotebookResourceInfo_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForNotebookResourceInfoStatus(subject NotebookResourceInfo_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NotebookResourceInfo_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 NotebookResourceInfo_Status instances for property testing - lazily instantiated by +// NotebookResourceInfoStatusGenerator() +var notebookResourceInfoStatusGenerator gopter.Gen + +// NotebookResourceInfoStatusGenerator returns a generator of NotebookResourceInfo_Status instances for property testing. +// We first initialize notebookResourceInfoStatusGenerator 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 NotebookResourceInfoStatusGenerator() gopter.Gen { + if notebookResourceInfoStatusGenerator != nil { + return notebookResourceInfoStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus(generators) + notebookResourceInfoStatusGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus(generators) + AddRelatedPropertyGeneratorsForNotebookResourceInfoStatus(generators) + notebookResourceInfoStatusGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_Status{}), generators) + + return notebookResourceInfoStatusGenerator +} + +// AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus(gens map[string]gopter.Gen) { + gens["Fqdn"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNotebookResourceInfoStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNotebookResourceInfoStatus(gens map[string]gopter.Gen) { + gens["NotebookPreparationError"] = gen.PtrOf(NotebookPreparationErrorStatusGenerator()) +} + +func Test_PrivateEndpointConnection_Status_SubResourceEmbedded_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PrivateEndpointConnection_Status_SubResourceEmbedded to PrivateEndpointConnection_Status_SubResourceEmbedded via AssignPropertiesToPrivateEndpointConnectionStatusSubResourceEmbedded & AssignPropertiesFromPrivateEndpointConnectionStatusSubResourceEmbedded returns original", + prop.ForAll(RunPropertyAssignmentTestForPrivateEndpointConnectionStatusSubResourceEmbedded, PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPrivateEndpointConnectionStatusSubResourceEmbedded tests if a specific instance of PrivateEndpointConnection_Status_SubResourceEmbedded can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForPrivateEndpointConnectionStatusSubResourceEmbedded(subject PrivateEndpointConnection_Status_SubResourceEmbedded) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.PrivateEndpointConnection_Status_SubResourceEmbedded + err := copied.AssignPropertiesToPrivateEndpointConnectionStatusSubResourceEmbedded(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual PrivateEndpointConnection_Status_SubResourceEmbedded + err = actual.AssignPropertiesFromPrivateEndpointConnectionStatusSubResourceEmbedded(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_PrivateEndpointConnection_Status_SubResourceEmbedded_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PrivateEndpointConnection_Status_SubResourceEmbedded via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbedded, PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbedded runs a test to see if a specific instance of PrivateEndpointConnection_Status_SubResourceEmbedded round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbedded(subject PrivateEndpointConnection_Status_SubResourceEmbedded) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateEndpointConnection_Status_SubResourceEmbedded + 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 PrivateEndpointConnection_Status_SubResourceEmbedded instances for property testing - lazily +// instantiated by PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator() +var privateEndpointConnectionStatusSubResourceEmbeddedGenerator gopter.Gen + +// PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator returns a generator of PrivateEndpointConnection_Status_SubResourceEmbedded instances for property testing. +// We first initialize privateEndpointConnectionStatusSubResourceEmbeddedGenerator 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 PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator() gopter.Gen { + if privateEndpointConnectionStatusSubResourceEmbeddedGenerator != nil { + return privateEndpointConnectionStatusSubResourceEmbeddedGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(generators) + privateEndpointConnectionStatusSubResourceEmbeddedGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbedded{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(generators) + AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(generators) + privateEndpointConnectionStatusSubResourceEmbeddedGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbedded{}), generators) + + return privateEndpointConnectionStatusSubResourceEmbeddedGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityStatusGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusGenerator()) +} + +func Test_ServiceManagedResourcesSettings_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ServiceManagedResourcesSettings to ServiceManagedResourcesSettings via AssignPropertiesToServiceManagedResourcesSettings & AssignPropertiesFromServiceManagedResourcesSettings returns original", + prop.ForAll(RunPropertyAssignmentTestForServiceManagedResourcesSettings, ServiceManagedResourcesSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForServiceManagedResourcesSettings tests if a specific instance of ServiceManagedResourcesSettings can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForServiceManagedResourcesSettings(subject ServiceManagedResourcesSettings) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ServiceManagedResourcesSettings + err := copied.AssignPropertiesToServiceManagedResourcesSettings(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ServiceManagedResourcesSettings + err = actual.AssignPropertiesFromServiceManagedResourcesSettings(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ServiceManagedResourcesSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ServiceManagedResourcesSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettings, ServiceManagedResourcesSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForServiceManagedResourcesSettings runs a test to see if a specific instance of ServiceManagedResourcesSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForServiceManagedResourcesSettings(subject ServiceManagedResourcesSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ServiceManagedResourcesSettings + 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 ServiceManagedResourcesSettings instances for property testing - lazily instantiated by +// ServiceManagedResourcesSettingsGenerator() +var serviceManagedResourcesSettingsGenerator gopter.Gen + +// ServiceManagedResourcesSettingsGenerator returns a generator of ServiceManagedResourcesSettings instances for property testing. +func ServiceManagedResourcesSettingsGenerator() gopter.Gen { + if serviceManagedResourcesSettingsGenerator != nil { + return serviceManagedResourcesSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings(generators) + serviceManagedResourcesSettingsGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings{}), generators) + + return serviceManagedResourcesSettingsGenerator +} + +// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings(gens map[string]gopter.Gen) { + gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsGenerator()) +} + +func Test_ServiceManagedResourcesSettings_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ServiceManagedResourcesSettings_Status to ServiceManagedResourcesSettings_Status via AssignPropertiesToServiceManagedResourcesSettingsStatus & AssignPropertiesFromServiceManagedResourcesSettingsStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForServiceManagedResourcesSettingsStatus, ServiceManagedResourcesSettingsStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForServiceManagedResourcesSettingsStatus tests if a specific instance of ServiceManagedResourcesSettings_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForServiceManagedResourcesSettingsStatus(subject ServiceManagedResourcesSettings_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 v20210701s.ServiceManagedResourcesSettings_Status + err := copied.AssignPropertiesToServiceManagedResourcesSettingsStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ServiceManagedResourcesSettings_Status + err = actual.AssignPropertiesFromServiceManagedResourcesSettingsStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ServiceManagedResourcesSettings_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ServiceManagedResourcesSettings_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettingsStatus, ServiceManagedResourcesSettingsStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForServiceManagedResourcesSettingsStatus runs a test to see if a specific instance of ServiceManagedResourcesSettings_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForServiceManagedResourcesSettingsStatus(subject ServiceManagedResourcesSettings_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ServiceManagedResourcesSettings_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 ServiceManagedResourcesSettings_Status instances for property testing - lazily instantiated by +// ServiceManagedResourcesSettingsStatusGenerator() +var serviceManagedResourcesSettingsStatusGenerator gopter.Gen + +// ServiceManagedResourcesSettingsStatusGenerator returns a generator of ServiceManagedResourcesSettings_Status instances for property testing. +func ServiceManagedResourcesSettingsStatusGenerator() gopter.Gen { + if serviceManagedResourcesSettingsStatusGenerator != nil { + return serviceManagedResourcesSettingsStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatus(generators) + serviceManagedResourcesSettingsStatusGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings_Status{}), generators) + + return serviceManagedResourcesSettingsStatusGenerator +} + +// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatus(gens map[string]gopter.Gen) { + gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsStatusGenerator()) +} + +func Test_SharedPrivateLinkResource_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SharedPrivateLinkResource_Status to SharedPrivateLinkResource_Status via AssignPropertiesToSharedPrivateLinkResourceStatus & AssignPropertiesFromSharedPrivateLinkResourceStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForSharedPrivateLinkResourceStatus, SharedPrivateLinkResourceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSharedPrivateLinkResourceStatus tests if a specific instance of SharedPrivateLinkResource_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSharedPrivateLinkResourceStatus(subject SharedPrivateLinkResource_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 v20210701s.SharedPrivateLinkResource_Status + err := copied.AssignPropertiesToSharedPrivateLinkResourceStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SharedPrivateLinkResource_Status + err = actual.AssignPropertiesFromSharedPrivateLinkResourceStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SharedPrivateLinkResource_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SharedPrivateLinkResource_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourceStatus, SharedPrivateLinkResourceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSharedPrivateLinkResourceStatus runs a test to see if a specific instance of SharedPrivateLinkResource_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForSharedPrivateLinkResourceStatus(subject SharedPrivateLinkResource_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SharedPrivateLinkResource_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 SharedPrivateLinkResource_Status instances for property testing - lazily instantiated by +// SharedPrivateLinkResourceStatusGenerator() +var sharedPrivateLinkResourceStatusGenerator gopter.Gen + +// SharedPrivateLinkResourceStatusGenerator returns a generator of SharedPrivateLinkResource_Status instances for property testing. +func SharedPrivateLinkResourceStatusGenerator() gopter.Gen { + if sharedPrivateLinkResourceStatusGenerator != nil { + return sharedPrivateLinkResourceStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatus(generators) + sharedPrivateLinkResourceStatusGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResource_Status{}), generators) + + return sharedPrivateLinkResourceStatusGenerator +} + +// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatus(gens map[string]gopter.Gen) { + gens["GroupId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateLinkResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["RequestMessage"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + PrivateEndpointServiceConnectionStatus_StatusApproved, + PrivateEndpointServiceConnectionStatus_StatusDisconnected, + PrivateEndpointServiceConnectionStatus_StatusPending, + PrivateEndpointServiceConnectionStatus_StatusRejected, + PrivateEndpointServiceConnectionStatus_StatusTimeout)) +} + +func Test_Sku_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Sku to Sku via AssignPropertiesToSku & AssignPropertiesFromSku returns original", + prop.ForAll(RunPropertyAssignmentTestForSku, SkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSku tests if a specific instance of Sku can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSku(subject Sku) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Sku + err := copied.AssignPropertiesToSku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Sku + err = actual.AssignPropertiesFromSku(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSku, SkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSku runs a test to see if a specific instance of Sku round trips to JSON and back losslessly +func RunJSONSerializationTestForSku(subject Sku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Sku + 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 Sku instances for property testing - lazily instantiated by SkuGenerator() +var skuGenerator gopter.Gen + +// SkuGenerator returns a generator of Sku instances for property testing. +func SkuGenerator() gopter.Gen { + if skuGenerator != nil { + return skuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSku(generators) + skuGenerator = gen.Struct(reflect.TypeOf(Sku{}), generators) + + return skuGenerator +} + +// AddIndependentPropertyGeneratorsForSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSku(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tier"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Sku_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Sku_Status to Sku_Status via AssignPropertiesToSkuStatus & AssignPropertiesFromSkuStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForSkuStatus, SkuStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSkuStatus tests if a specific instance of Sku_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSkuStatus(subject Sku_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 v20210701s.Sku_Status + err := copied.AssignPropertiesToSkuStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Sku_Status + err = actual.AssignPropertiesFromSkuStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Sku_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSkuStatus, SkuStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSkuStatus runs a test to see if a specific instance of Sku_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForSkuStatus(subject Sku_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Sku_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 Sku_Status instances for property testing - lazily instantiated by SkuStatusGenerator() +var skuStatusGenerator gopter.Gen + +// SkuStatusGenerator returns a generator of Sku_Status instances for property testing. +func SkuStatusGenerator() gopter.Gen { + if skuStatusGenerator != nil { + return skuStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSkuStatus(generators) + skuStatusGenerator = gen.Struct(reflect.TypeOf(Sku_Status{}), generators) + + return skuStatusGenerator +} + +// AddIndependentPropertyGeneratorsForSkuStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSkuStatus(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tier"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SystemData_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SystemData to SystemData via AssignPropertiesToSystemData & AssignPropertiesFromSystemData returns original", + prop.ForAll(RunPropertyAssignmentTestForSystemData, SystemDataGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSystemData tests if a specific instance of SystemData can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSystemData(subject SystemData) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.SystemData + err := copied.AssignPropertiesToSystemData(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData + err = actual.AssignPropertiesFromSystemData(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SystemData_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData, SystemDataGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData runs a test to see if a specific instance of SystemData round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData(subject SystemData) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData + 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 instances for property testing - lazily instantiated by SystemDataGenerator() +var systemDataGenerator gopter.Gen + +// SystemDataGenerator returns a generator of SystemData instances for property testing. +func SystemDataGenerator() gopter.Gen { + if systemDataGenerator != nil { + return systemDataGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData(generators) + systemDataGenerator = gen.Struct(reflect.TypeOf(SystemData{}), generators) + + return systemDataGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataCreatedByTypeApplication, + SystemDataCreatedByTypeKey, + SystemDataCreatedByTypeManagedIdentity, + SystemDataCreatedByTypeUser)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataLastModifiedByTypeApplication, + SystemDataLastModifiedByTypeKey, + SystemDataLastModifiedByTypeManagedIdentity, + SystemDataLastModifiedByTypeUser)) +} + +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 AssignPropertiesToSystemDataStatus & AssignPropertiesFromSystemDataStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForSystemDataStatus, SystemDataStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSystemDataStatus tests if a specific instance of SystemData_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSystemDataStatus(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 v20210701s.SystemData_Status + err := copied.AssignPropertiesToSystemDataStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_Status + err = actual.AssignPropertiesFromSystemDataStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + 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.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemDataStatus, SystemDataStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemDataStatus runs a test to see if a specific instance of SystemData_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemDataStatus(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 SystemDataStatusGenerator() +var systemDataStatusGenerator gopter.Gen + +// SystemDataStatusGenerator returns a generator of SystemData_Status instances for property testing. +func SystemDataStatusGenerator() gopter.Gen { + if systemDataStatusGenerator != nil { + return systemDataStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemDataStatus(generators) + systemDataStatusGenerator = gen.Struct(reflect.TypeOf(SystemData_Status{}), generators) + + return systemDataStatusGenerator +} + +// AddIndependentPropertyGeneratorsForSystemDataStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemDataStatus(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataStatusCreatedByTypeApplication, + SystemDataStatusCreatedByTypeKey, + SystemDataStatusCreatedByTypeManagedIdentity, + SystemDataStatusCreatedByTypeUser)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataStatusLastModifiedByTypeApplication, + SystemDataStatusLastModifiedByTypeKey, + SystemDataStatusLastModifiedByTypeManagedIdentity, + SystemDataStatusLastModifiedByTypeUser)) +} + +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 AssignPropertiesToWorkspaceOperatorSpec & AssignPropertiesFromWorkspaceOperatorSpec 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 v1beta20210701storage 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 v20210701s.WorkspaceOperatorSpec + err := copied.AssignPropertiesToWorkspaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceOperatorSpec + err = actual.AssignPropertiesFromWorkspaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + 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.MaxSize = 10 + 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_Workspaces_Spec_Properties_SharedPrivateLinkResources_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Workspaces_Spec_Properties_SharedPrivateLinkResources to Workspaces_Spec_Properties_SharedPrivateLinkResources via AssignPropertiesToWorkspacesSpecPropertiesSharedPrivateLinkResources & AssignPropertiesFromWorkspacesSpecPropertiesSharedPrivateLinkResources returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspacesSpecPropertiesSharedPrivateLinkResources, WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspacesSpecPropertiesSharedPrivateLinkResources tests if a specific instance of Workspaces_Spec_Properties_SharedPrivateLinkResources can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspacesSpecPropertiesSharedPrivateLinkResources(subject Workspaces_Spec_Properties_SharedPrivateLinkResources) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Workspaces_Spec_Properties_SharedPrivateLinkResources + err := copied.AssignPropertiesToWorkspacesSpecPropertiesSharedPrivateLinkResources(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Workspaces_Spec_Properties_SharedPrivateLinkResources + err = actual.AssignPropertiesFromWorkspacesSpecPropertiesSharedPrivateLinkResources(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Workspaces_Spec_Properties_SharedPrivateLinkResources_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspaces_Spec_Properties_SharedPrivateLinkResources via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResources, WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResources runs a test to see if a specific instance of Workspaces_Spec_Properties_SharedPrivateLinkResources round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResources(subject Workspaces_Spec_Properties_SharedPrivateLinkResources) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspaces_Spec_Properties_SharedPrivateLinkResources + 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 Workspaces_Spec_Properties_SharedPrivateLinkResources instances for property testing - lazily +// instantiated by WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator() +var workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator gopter.Gen + +// WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator returns a generator of Workspaces_Spec_Properties_SharedPrivateLinkResources instances for property testing. +func WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator() gopter.Gen { + if workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator != nil { + return workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResources(generators) + workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_Properties_SharedPrivateLinkResources{}), generators) + + return workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResources is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResources(gens map[string]gopter.Gen) { + gens["GroupId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequestMessage"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + SharedPrivateLinkResourcePropertyStatusApproved, + SharedPrivateLinkResourcePropertyStatusDisconnected, + SharedPrivateLinkResourcePropertyStatusPending, + SharedPrivateLinkResourcePropertyStatusRejected, + SharedPrivateLinkResourcePropertyStatusTimeout)) +} + +func Test_CosmosDbSettings_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CosmosDbSettings to CosmosDbSettings via AssignPropertiesToCosmosDbSettings & AssignPropertiesFromCosmosDbSettings returns original", + prop.ForAll(RunPropertyAssignmentTestForCosmosDbSettings, CosmosDbSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCosmosDbSettings tests if a specific instance of CosmosDbSettings can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForCosmosDbSettings(subject CosmosDbSettings) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.CosmosDbSettings + err := copied.AssignPropertiesToCosmosDbSettings(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CosmosDbSettings + err = actual.AssignPropertiesFromCosmosDbSettings(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_CosmosDbSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CosmosDbSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCosmosDbSettings, CosmosDbSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCosmosDbSettings runs a test to see if a specific instance of CosmosDbSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForCosmosDbSettings(subject CosmosDbSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CosmosDbSettings + 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 CosmosDbSettings instances for property testing - lazily instantiated by CosmosDbSettingsGenerator() +var cosmosDbSettingsGenerator gopter.Gen + +// CosmosDbSettingsGenerator returns a generator of CosmosDbSettings instances for property testing. +func CosmosDbSettingsGenerator() gopter.Gen { + if cosmosDbSettingsGenerator != nil { + return cosmosDbSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCosmosDbSettings(generators) + cosmosDbSettingsGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings{}), generators) + + return cosmosDbSettingsGenerator +} + +// AddIndependentPropertyGeneratorsForCosmosDbSettings is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCosmosDbSettings(gens map[string]gopter.Gen) { + gens["CollectionsThroughput"] = gen.PtrOf(gen.Int()) +} + +func Test_CosmosDbSettings_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CosmosDbSettings_Status to CosmosDbSettings_Status via AssignPropertiesToCosmosDbSettingsStatus & AssignPropertiesFromCosmosDbSettingsStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForCosmosDbSettingsStatus, CosmosDbSettingsStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCosmosDbSettingsStatus tests if a specific instance of CosmosDbSettings_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForCosmosDbSettingsStatus(subject CosmosDbSettings_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 v20210701s.CosmosDbSettings_Status + err := copied.AssignPropertiesToCosmosDbSettingsStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CosmosDbSettings_Status + err = actual.AssignPropertiesFromCosmosDbSettingsStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_CosmosDbSettings_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CosmosDbSettings_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCosmosDbSettingsStatus, CosmosDbSettingsStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCosmosDbSettingsStatus runs a test to see if a specific instance of CosmosDbSettings_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForCosmosDbSettingsStatus(subject CosmosDbSettings_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CosmosDbSettings_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 CosmosDbSettings_Status instances for property testing - lazily instantiated by +// CosmosDbSettingsStatusGenerator() +var cosmosDbSettingsStatusGenerator gopter.Gen + +// CosmosDbSettingsStatusGenerator returns a generator of CosmosDbSettings_Status instances for property testing. +func CosmosDbSettingsStatusGenerator() gopter.Gen { + if cosmosDbSettingsStatusGenerator != nil { + return cosmosDbSettingsStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCosmosDbSettingsStatus(generators) + cosmosDbSettingsStatusGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings_Status{}), generators) + + return cosmosDbSettingsStatusGenerator +} + +// AddIndependentPropertyGeneratorsForCosmosDbSettingsStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCosmosDbSettingsStatus(gens map[string]gopter.Gen) { + gens["CollectionsThroughput"] = gen.PtrOf(gen.Int()) +} + +func Test_IdentityForCmk_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from IdentityForCmk to IdentityForCmk via AssignPropertiesToIdentityForCmk & AssignPropertiesFromIdentityForCmk returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentityForCmk, IdentityForCmkGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentityForCmk tests if a specific instance of IdentityForCmk can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForIdentityForCmk(subject IdentityForCmk) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.IdentityForCmk + err := copied.AssignPropertiesToIdentityForCmk(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual IdentityForCmk + err = actual.AssignPropertiesFromIdentityForCmk(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_IdentityForCmk_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of IdentityForCmk via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityForCmk, IdentityForCmkGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityForCmk runs a test to see if a specific instance of IdentityForCmk round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityForCmk(subject IdentityForCmk) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual IdentityForCmk + 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 IdentityForCmk instances for property testing - lazily instantiated by IdentityForCmkGenerator() +var identityForCmkGenerator gopter.Gen + +// IdentityForCmkGenerator returns a generator of IdentityForCmk instances for property testing. +func IdentityForCmkGenerator() gopter.Gen { + if identityForCmkGenerator != nil { + return identityForCmkGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityForCmk(generators) + identityForCmkGenerator = gen.Struct(reflect.TypeOf(IdentityForCmk{}), generators) + + return identityForCmkGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityForCmk is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityForCmk(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_IdentityForCmk_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from IdentityForCmk_Status to IdentityForCmk_Status via AssignPropertiesToIdentityForCmkStatus & AssignPropertiesFromIdentityForCmkStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentityForCmkStatus, IdentityForCmkStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentityForCmkStatus tests if a specific instance of IdentityForCmk_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForIdentityForCmkStatus(subject IdentityForCmk_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 v20210701s.IdentityForCmk_Status + err := copied.AssignPropertiesToIdentityForCmkStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual IdentityForCmk_Status + err = actual.AssignPropertiesFromIdentityForCmkStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_IdentityForCmk_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of IdentityForCmk_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityForCmkStatus, IdentityForCmkStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityForCmkStatus runs a test to see if a specific instance of IdentityForCmk_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityForCmkStatus(subject IdentityForCmk_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual IdentityForCmk_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 IdentityForCmk_Status instances for property testing - lazily instantiated by +// IdentityForCmkStatusGenerator() +var identityForCmkStatusGenerator gopter.Gen + +// IdentityForCmkStatusGenerator returns a generator of IdentityForCmk_Status instances for property testing. +func IdentityForCmkStatusGenerator() gopter.Gen { + if identityForCmkStatusGenerator != nil { + return identityForCmkStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityForCmkStatus(generators) + identityForCmkStatusGenerator = gen.Struct(reflect.TypeOf(IdentityForCmk_Status{}), generators) + + return identityForCmkStatusGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityForCmkStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityForCmkStatus(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from KeyVaultProperties to KeyVaultProperties via AssignPropertiesToKeyVaultProperties & AssignPropertiesFromKeyVaultProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties, KeyVaultPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultProperties tests if a specific instance of KeyVaultProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultProperties(subject KeyVaultProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.KeyVaultProperties + err := copied.AssignPropertiesToKeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual KeyVaultProperties + err = actual.AssignPropertiesFromKeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultProperties, KeyVaultPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultProperties runs a test to see if a specific instance of KeyVaultProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultProperties(subject KeyVaultProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties + 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 KeyVaultProperties instances for property testing - lazily instantiated by KeyVaultPropertiesGenerator() +var keyVaultPropertiesGenerator gopter.Gen + +// KeyVaultPropertiesGenerator returns a generator of KeyVaultProperties instances for property testing. +func KeyVaultPropertiesGenerator() gopter.Gen { + if keyVaultPropertiesGenerator != nil { + return keyVaultPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) + + return keyVaultPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { + gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString()) + gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultProperties_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from KeyVaultProperties_Status to KeyVaultProperties_Status via AssignPropertiesToKeyVaultPropertiesStatus & AssignPropertiesFromKeyVaultPropertiesStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultPropertiesStatus, KeyVaultPropertiesStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultPropertiesStatus tests if a specific instance of KeyVaultProperties_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultPropertiesStatus(subject KeyVaultProperties_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 v20210701s.KeyVaultProperties_Status + err := copied.AssignPropertiesToKeyVaultPropertiesStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual KeyVaultProperties_Status + err = actual.AssignPropertiesFromKeyVaultPropertiesStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_KeyVaultProperties_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultPropertiesStatus, KeyVaultPropertiesStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultPropertiesStatus runs a test to see if a specific instance of KeyVaultProperties_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultPropertiesStatus(subject KeyVaultProperties_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties_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 KeyVaultProperties_Status instances for property testing - lazily instantiated by +// KeyVaultPropertiesStatusGenerator() +var keyVaultPropertiesStatusGenerator gopter.Gen + +// KeyVaultPropertiesStatusGenerator returns a generator of KeyVaultProperties_Status instances for property testing. +func KeyVaultPropertiesStatusGenerator() gopter.Gen { + if keyVaultPropertiesStatusGenerator != nil { + return keyVaultPropertiesStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatus(generators) + keyVaultPropertiesStatusGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_Status{}), generators) + + return keyVaultPropertiesStatusGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatus(gens map[string]gopter.Gen) { + gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString()) + gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_NotebookPreparationError_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NotebookPreparationError_Status to NotebookPreparationError_Status via AssignPropertiesToNotebookPreparationErrorStatus & AssignPropertiesFromNotebookPreparationErrorStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForNotebookPreparationErrorStatus, NotebookPreparationErrorStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNotebookPreparationErrorStatus tests if a specific instance of NotebookPreparationError_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForNotebookPreparationErrorStatus(subject NotebookPreparationError_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 v20210701s.NotebookPreparationError_Status + err := copied.AssignPropertiesToNotebookPreparationErrorStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NotebookPreparationError_Status + err = actual.AssignPropertiesFromNotebookPreparationErrorStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NotebookPreparationError_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NotebookPreparationError_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNotebookPreparationErrorStatus, NotebookPreparationErrorStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNotebookPreparationErrorStatus runs a test to see if a specific instance of NotebookPreparationError_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForNotebookPreparationErrorStatus(subject NotebookPreparationError_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NotebookPreparationError_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 NotebookPreparationError_Status instances for property testing - lazily instantiated by +// NotebookPreparationErrorStatusGenerator() +var notebookPreparationErrorStatusGenerator gopter.Gen + +// NotebookPreparationErrorStatusGenerator returns a generator of NotebookPreparationError_Status instances for property testing. +func NotebookPreparationErrorStatusGenerator() gopter.Gen { + if notebookPreparationErrorStatusGenerator != nil { + return notebookPreparationErrorStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatus(generators) + notebookPreparationErrorStatusGenerator = gen.Struct(reflect.TypeOf(NotebookPreparationError_Status{}), generators) + + return notebookPreparationErrorStatusGenerator +} + +// AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatus(gens map[string]gopter.Gen) { + gens["ErrorMessage"] = gen.PtrOf(gen.AlphaString()) + gens["StatusCode"] = gen.PtrOf(gen.Int()) +} + +func Test_UserAssignedIdentity_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentity_Status to UserAssignedIdentity_Status via AssignPropertiesToUserAssignedIdentityStatus & AssignPropertiesFromUserAssignedIdentityStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityStatus, UserAssignedIdentityStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityStatus tests if a specific instance of UserAssignedIdentity_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityStatus(subject UserAssignedIdentity_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 v20210701s.UserAssignedIdentity_Status + err := copied.AssignPropertiesToUserAssignedIdentityStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentity_Status + err = actual.AssignPropertiesFromUserAssignedIdentityStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentity_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentity_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityStatus, UserAssignedIdentityStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityStatus runs a test to see if a specific instance of UserAssignedIdentity_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityStatus(subject UserAssignedIdentity_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentity_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 UserAssignedIdentity_Status instances for property testing - lazily instantiated by +// UserAssignedIdentityStatusGenerator() +var userAssignedIdentityStatusGenerator gopter.Gen + +// UserAssignedIdentityStatusGenerator returns a generator of UserAssignedIdentity_Status instances for property testing. +func UserAssignedIdentityStatusGenerator() gopter.Gen { + if userAssignedIdentityStatusGenerator != nil { + return userAssignedIdentityStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentityStatus(generators) + userAssignedIdentityStatusGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_Status{}), generators) + + return userAssignedIdentityStatusGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityStatus(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) +} + +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 AssignPropertiesToWorkspaceOperatorSecrets & AssignPropertiesFromWorkspaceOperatorSecrets 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 v1beta20210701storage 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 v20210701s.WorkspaceOperatorSecrets + err := copied.AssignPropertiesToWorkspaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceOperatorSecrets + err = actual.AssignPropertiesFromWorkspaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + 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.MaxSize = 10 + 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 +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen.go new file mode 100644 index 0000000000..8831f7725d --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen.go @@ -0,0 +1,139 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Workspaces_SpecARM struct { + // Identity: Identity for the resource. + Identity *IdentityARM `json:"identity,omitempty"` + + // Location: Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Name: Name of Azure Machine Learning workspace. + Name string `json:"name,omitempty"` + + // Properties: The properties of a machine learning workspace. + Properties *Workspaces_Spec_PropertiesARM `json:"properties,omitempty"` + + // Sku: Sku of the resource + Sku *SkuARM `json:"sku,omitempty"` + + // SystemData: Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataARM `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Workspaces_SpecARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01" +func (workspaces Workspaces_SpecARM) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetName returns the Name of the resource +func (workspaces *Workspaces_SpecARM) GetName() string { + return workspaces.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces" +func (workspaces *Workspaces_SpecARM) GetType() string { + return "Microsoft.MachineLearningServices/workspaces" +} + +type Workspaces_Spec_PropertiesARM struct { + // AllowPublicAccessWhenBehindVnet: The flag to indicate whether to allow public access when behind VNet. + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + ApplicationInsights *string `json:"applicationInsights,omitempty"` + ContainerRegistry *string `json:"containerRegistry,omitempty"` + + // Description: The description of this workspace. + Description *string `json:"description,omitempty"` + + // DiscoveryUrl: Url for the discovery service to identify regional endpoints for machine learning experimentation services + DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + Encryption *EncryptionPropertyARM `json:"encryption,omitempty"` + + // FriendlyName: The friendly name for this workspace. This name in mutable + FriendlyName *string `json:"friendlyName,omitempty"` + + // HbiWorkspace: The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + + // ImageBuildCompute: The compute name for image build + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + KeyVault *string `json:"keyVault,omitempty"` + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + + // PublicNetworkAccess: Whether requests from Public Network are allowed. + PublicNetworkAccess *WorkspacesSpecPropertiesPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + ServiceManagedResourcesSettings *ServiceManagedResourcesSettingsARM `json:"serviceManagedResourcesSettings,omitempty"` + + // SharedPrivateLinkResources: The list of shared private link resources in this workspace. + SharedPrivateLinkResources []Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM `json:"sharedPrivateLinkResources,omitempty"` + StorageAccount *string `json:"storageAccount,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/EncryptionProperty +type EncryptionPropertyARM struct { + // Identity: Identity that will be used to access key vault for encryption at rest + Identity *IdentityForCmkARM `json:"identity,omitempty"` + KeyVaultProperties *KeyVaultPropertiesARM `json:"keyVaultProperties,omitempty"` + + // Status: Indicates whether or not the encryption is enabled for the workspace. + Status *EncryptionPropertyStatus `json:"status,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ServiceManagedResourcesSettings +type ServiceManagedResourcesSettingsARM struct { + CosmosDb *CosmosDbSettingsARM `json:"cosmosDb,omitempty"` +} + +type Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM struct { + // Name: Unique name of the private link. + Name *string `json:"name,omitempty"` + + // Properties: Properties of a shared private link resource. + Properties *SharedPrivateLinkResourcePropertyARM `json:"properties,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/CosmosDbSettings +type CosmosDbSettingsARM struct { + // CollectionsThroughput: The throughput of the collections in cosmosdb database + CollectionsThroughput *int `json:"collectionsThroughput,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/IdentityForCmk +type IdentityForCmkARM struct { + // UserAssignedIdentity: The ArmId of the user assigned identity that will be used to access the customer managed key vault + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/KeyVaultProperties +type KeyVaultPropertiesARM struct { + // IdentityClientId: For future use - The client id of the identity which will be used to access key vault. + IdentityClientId *string `json:"identityClientId,omitempty"` + + // KeyIdentifier: Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + + // KeyVaultArmId: The ArmId of the keyVault where the customer owned encryption key is present. + KeyVaultArmId *string `json:"keyVaultArmId,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SharedPrivateLinkResourceProperty +type SharedPrivateLinkResourcePropertyARM struct { + // GroupId: The private link resource group id. + GroupId *string `json:"groupId,omitempty"` + PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"` + + // RequestMessage: Request message. + RequestMessage *string `json:"requestMessage,omitempty"` + + // Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *SharedPrivateLinkResourcePropertyStatus `json:"status,omitempty"` +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen_test.go new file mode 100644 index 0000000000..8b2809ed8b --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces__spec_arm_types_gen_test.go @@ -0,0 +1,641 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +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_Workspaces_SpecARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspaces_SpecARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesSpecARM, WorkspacesSpecARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesSpecARM runs a test to see if a specific instance of Workspaces_SpecARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesSpecARM(subject Workspaces_SpecARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspaces_SpecARM + 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 Workspaces_SpecARM instances for property testing - lazily instantiated by WorkspacesSpecARMGenerator() +var workspacesSpecARMGenerator gopter.Gen + +// WorkspacesSpecARMGenerator returns a generator of Workspaces_SpecARM instances for property testing. +// We first initialize workspacesSpecARMGenerator 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 WorkspacesSpecARMGenerator() gopter.Gen { + if workspacesSpecARMGenerator != nil { + return workspacesSpecARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecARM(generators) + workspacesSpecARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_SpecARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecARM(generators) + AddRelatedPropertyGeneratorsForWorkspacesSpecARM(generators) + workspacesSpecARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_SpecARM{}), generators) + + return workspacesSpecARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesSpecARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesSpecARM(gens map[string]gopter.Gen) { + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.AlphaString() + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesSpecARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesSpecARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityARMGenerator()) + gens["Properties"] = gen.PtrOf(WorkspacesSpecPropertiesARMGenerator()) + gens["Sku"] = gen.PtrOf(SkuARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataARMGenerator()) +} + +func Test_Workspaces_Spec_PropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspaces_Spec_PropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesSpecPropertiesARM, WorkspacesSpecPropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesSpecPropertiesARM runs a test to see if a specific instance of Workspaces_Spec_PropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesSpecPropertiesARM(subject Workspaces_Spec_PropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspaces_Spec_PropertiesARM + 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 Workspaces_Spec_PropertiesARM instances for property testing - lazily instantiated by +// WorkspacesSpecPropertiesARMGenerator() +var workspacesSpecPropertiesARMGenerator gopter.Gen + +// WorkspacesSpecPropertiesARMGenerator returns a generator of Workspaces_Spec_PropertiesARM instances for property testing. +// We first initialize workspacesSpecPropertiesARMGenerator 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 WorkspacesSpecPropertiesARMGenerator() gopter.Gen { + if workspacesSpecPropertiesARMGenerator != nil { + return workspacesSpecPropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM(generators) + workspacesSpecPropertiesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_PropertiesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM(generators) + AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesARM(generators) + workspacesSpecPropertiesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_PropertiesARM{}), generators) + + return workspacesSpecPropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesARM(gens map[string]gopter.Gen) { + gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool()) + gens["ApplicationInsights"] = gen.PtrOf(gen.AlphaString()) + gens["ContainerRegistry"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString()) + gens["FriendlyName"] = gen.PtrOf(gen.AlphaString()) + gens["HbiWorkspace"] = gen.PtrOf(gen.Bool()) + gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVault"] = gen.PtrOf(gen.AlphaString()) + gens["PrimaryUserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(WorkspacesSpecPropertiesPublicNetworkAccessDisabled, WorkspacesSpecPropertiesPublicNetworkAccessEnabled)) + gens["StorageAccount"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionPropertyARMGenerator()) + gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsARMGenerator()) + gens["SharedPrivateLinkResources"] = gen.SliceOf(WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator()) +} + +func Test_EncryptionPropertyARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of EncryptionPropertyARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryptionPropertyARM, EncryptionPropertyARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryptionPropertyARM runs a test to see if a specific instance of EncryptionPropertyARM round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryptionPropertyARM(subject EncryptionPropertyARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual EncryptionPropertyARM + 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 EncryptionPropertyARM instances for property testing - lazily instantiated by +// EncryptionPropertyARMGenerator() +var encryptionPropertyARMGenerator gopter.Gen + +// EncryptionPropertyARMGenerator returns a generator of EncryptionPropertyARM instances for property testing. +// We first initialize encryptionPropertyARMGenerator 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 EncryptionPropertyARMGenerator() gopter.Gen { + if encryptionPropertyARMGenerator != nil { + return encryptionPropertyARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyARM(generators) + encryptionPropertyARMGenerator = gen.Struct(reflect.TypeOf(EncryptionPropertyARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyARM(generators) + AddRelatedPropertyGeneratorsForEncryptionPropertyARM(generators) + encryptionPropertyARMGenerator = gen.Struct(reflect.TypeOf(EncryptionPropertyARM{}), generators) + + return encryptionPropertyARMGenerator +} + +// AddIndependentPropertyGeneratorsForEncryptionPropertyARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryptionPropertyARM(gens map[string]gopter.Gen) { + gens["Status"] = gen.PtrOf(gen.OneConstOf(EncryptionPropertyStatusDisabled, EncryptionPropertyStatusEnabled)) +} + +// AddRelatedPropertyGeneratorsForEncryptionPropertyARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryptionPropertyARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityForCmkARMGenerator()) + gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesARMGenerator()) +} + +func Test_ServiceManagedResourcesSettingsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ServiceManagedResourcesSettingsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettingsARM, ServiceManagedResourcesSettingsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForServiceManagedResourcesSettingsARM runs a test to see if a specific instance of ServiceManagedResourcesSettingsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForServiceManagedResourcesSettingsARM(subject ServiceManagedResourcesSettingsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ServiceManagedResourcesSettingsARM + 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 ServiceManagedResourcesSettingsARM instances for property testing - lazily instantiated by +// ServiceManagedResourcesSettingsARMGenerator() +var serviceManagedResourcesSettingsARMGenerator gopter.Gen + +// ServiceManagedResourcesSettingsARMGenerator returns a generator of ServiceManagedResourcesSettingsARM instances for property testing. +func ServiceManagedResourcesSettingsARMGenerator() gopter.Gen { + if serviceManagedResourcesSettingsARMGenerator != nil { + return serviceManagedResourcesSettingsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsARM(generators) + serviceManagedResourcesSettingsARMGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettingsARM{}), generators) + + return serviceManagedResourcesSettingsARMGenerator +} + +// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsARM(gens map[string]gopter.Gen) { + gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsARMGenerator()) +} + +func Test_Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM, WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM runs a test to see if a specific instance of Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(subject Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM + 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 Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM instances for property testing - lazily +// instantiated by WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator() +var workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator gopter.Gen + +// WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator returns a generator of Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM instances for property testing. +// We first initialize workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator 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 WorkspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator() gopter.Gen { + if workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator != nil { + return workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(generators) + workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(generators) + AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(generators) + workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM{}), generators) + + return workspacesSpecPropertiesSharedPrivateLinkResourcesARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResourcesARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SharedPrivateLinkResourcePropertyARMGenerator()) +} + +func Test_CosmosDbSettingsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CosmosDbSettingsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCosmosDbSettingsARM, CosmosDbSettingsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCosmosDbSettingsARM runs a test to see if a specific instance of CosmosDbSettingsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCosmosDbSettingsARM(subject CosmosDbSettingsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CosmosDbSettingsARM + 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 CosmosDbSettingsARM instances for property testing - lazily instantiated by +// CosmosDbSettingsARMGenerator() +var cosmosDbSettingsARMGenerator gopter.Gen + +// CosmosDbSettingsARMGenerator returns a generator of CosmosDbSettingsARM instances for property testing. +func CosmosDbSettingsARMGenerator() gopter.Gen { + if cosmosDbSettingsARMGenerator != nil { + return cosmosDbSettingsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCosmosDbSettingsARM(generators) + cosmosDbSettingsARMGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettingsARM{}), generators) + + return cosmosDbSettingsARMGenerator +} + +// AddIndependentPropertyGeneratorsForCosmosDbSettingsARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCosmosDbSettingsARM(gens map[string]gopter.Gen) { + gens["CollectionsThroughput"] = gen.PtrOf(gen.Int()) +} + +func Test_IdentityForCmkARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of IdentityForCmkARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityForCmkARM, IdentityForCmkARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityForCmkARM runs a test to see if a specific instance of IdentityForCmkARM round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityForCmkARM(subject IdentityForCmkARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual IdentityForCmkARM + 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 IdentityForCmkARM instances for property testing - lazily instantiated by IdentityForCmkARMGenerator() +var identityForCmkARMGenerator gopter.Gen + +// IdentityForCmkARMGenerator returns a generator of IdentityForCmkARM instances for property testing. +func IdentityForCmkARMGenerator() gopter.Gen { + if identityForCmkARMGenerator != nil { + return identityForCmkARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityForCmkARM(generators) + identityForCmkARMGenerator = gen.Struct(reflect.TypeOf(IdentityForCmkARM{}), generators) + + return identityForCmkARMGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityForCmkARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityForCmkARM(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultPropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultPropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultPropertiesARM, KeyVaultPropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultPropertiesARM runs a test to see if a specific instance of KeyVaultPropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultPropertiesARM(subject KeyVaultPropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultPropertiesARM + 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 KeyVaultPropertiesARM instances for property testing - lazily instantiated by +// KeyVaultPropertiesARMGenerator() +var keyVaultPropertiesARMGenerator gopter.Gen + +// KeyVaultPropertiesARMGenerator returns a generator of KeyVaultPropertiesARM instances for property testing. +func KeyVaultPropertiesARMGenerator() gopter.Gen { + if keyVaultPropertiesARMGenerator != nil { + return keyVaultPropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultPropertiesARM(generators) + keyVaultPropertiesARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultPropertiesARM{}), generators) + + return keyVaultPropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultPropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultPropertiesARM(gens map[string]gopter.Gen) { + gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString()) + gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SharedPrivateLinkResourcePropertyARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SharedPrivateLinkResourcePropertyARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourcePropertyARM, SharedPrivateLinkResourcePropertyARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSharedPrivateLinkResourcePropertyARM runs a test to see if a specific instance of SharedPrivateLinkResourcePropertyARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSharedPrivateLinkResourcePropertyARM(subject SharedPrivateLinkResourcePropertyARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SharedPrivateLinkResourcePropertyARM + 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 SharedPrivateLinkResourcePropertyARM instances for property testing - lazily instantiated by +// SharedPrivateLinkResourcePropertyARMGenerator() +var sharedPrivateLinkResourcePropertyARMGenerator gopter.Gen + +// SharedPrivateLinkResourcePropertyARMGenerator returns a generator of SharedPrivateLinkResourcePropertyARM instances for property testing. +func SharedPrivateLinkResourcePropertyARMGenerator() gopter.Gen { + if sharedPrivateLinkResourcePropertyARMGenerator != nil { + return sharedPrivateLinkResourcePropertyARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyARM(generators) + sharedPrivateLinkResourcePropertyARMGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResourcePropertyARM{}), generators) + + return sharedPrivateLinkResourcePropertyARMGenerator +} + +// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourcePropertyARM(gens map[string]gopter.Gen) { + gens["GroupId"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateLinkResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["RequestMessage"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + SharedPrivateLinkResourcePropertyStatusApproved, + SharedPrivateLinkResourcePropertyStatusDisconnected, + SharedPrivateLinkResourcePropertyStatusPending, + SharedPrivateLinkResourcePropertyStatusRejected, + SharedPrivateLinkResourcePropertyStatusTimeout)) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen.go new file mode 100644 index 0000000000..80bb78932a --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen.go @@ -0,0 +1,8108 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import ( + "fmt" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + kerrors "k8s.io/apimachinery/pkg/util/errors" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_computes +type WorkspacesCompute struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec WorkspacesComputes_Spec `json:"spec,omitempty"` + Status ComputeResource_Status `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &WorkspacesCompute{} + +// GetConditions returns the conditions of the resource +func (compute *WorkspacesCompute) GetConditions() conditions.Conditions { + return compute.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (compute *WorkspacesCompute) SetConditions(conditions conditions.Conditions) { + compute.Status.Conditions = conditions +} + +var _ conversion.Convertible = &WorkspacesCompute{} + +// ConvertFrom populates our WorkspacesCompute from the provided hub WorkspacesCompute +func (compute *WorkspacesCompute) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20210701s.WorkspacesCompute) + if !ok { + return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/WorkspacesCompute but received %T instead", hub) + } + + return compute.AssignPropertiesFromWorkspacesCompute(source) +} + +// ConvertTo populates the provided hub WorkspacesCompute from our WorkspacesCompute +func (compute *WorkspacesCompute) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20210701s.WorkspacesCompute) + if !ok { + return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/WorkspacesCompute but received %T instead", hub) + } + + return compute.AssignPropertiesToWorkspacesCompute(destination) +} + +// +kubebuilder:webhook:path=/mutate-machinelearningservices-azure-com-v1beta20210701-workspacescompute,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspacescomputes,verbs=create;update,versions=v1beta20210701,name=default.v1beta20210701.workspacescomputes.machinelearningservices.azure.com,admissionReviewVersions=v1beta1 + +var _ admission.Defaulter = &WorkspacesCompute{} + +// Default applies defaults to the WorkspacesCompute resource +func (compute *WorkspacesCompute) Default() { + compute.defaultImpl() + var temp interface{} = compute + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (compute *WorkspacesCompute) defaultAzureName() { + if compute.Spec.AzureName == "" { + compute.Spec.AzureName = compute.Name + } +} + +// defaultImpl applies the code generated defaults to the WorkspacesCompute resource +func (compute *WorkspacesCompute) defaultImpl() { compute.defaultAzureName() } + +var _ genruntime.KubernetesResource = &WorkspacesCompute{} + +// AzureName returns the Azure name of the resource +func (compute *WorkspacesCompute) AzureName() string { + return compute.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01" +func (compute WorkspacesCompute) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetResourceKind returns the kind of the resource +func (compute *WorkspacesCompute) GetResourceKind() genruntime.ResourceKind { + return genruntime.ResourceKindNormal +} + +// GetSpec returns the specification of this resource +func (compute *WorkspacesCompute) GetSpec() genruntime.ConvertibleSpec { + return &compute.Spec +} + +// GetStatus returns the status of this resource +func (compute *WorkspacesCompute) GetStatus() genruntime.ConvertibleStatus { + return &compute.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/computes" +func (compute *WorkspacesCompute) GetType() string { + return "Microsoft.MachineLearningServices/workspaces/computes" +} + +// NewEmptyStatus returns a new empty (blank) status +func (compute *WorkspacesCompute) NewEmptyStatus() genruntime.ConvertibleStatus { + return &ComputeResource_Status{} +} + +// Owner returns the ResourceReference of the owner, or nil if there is no owner +func (compute *WorkspacesCompute) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(compute.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: compute.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (compute *WorkspacesCompute) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*ComputeResource_Status); ok { + compute.Status = *st + return nil + } + + // Convert status to required version + var st ComputeResource_Status + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + compute.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-machinelearningservices-azure-com-v1beta20210701-workspacescompute,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspacescomputes,verbs=create;update,versions=v1beta20210701,name=validate.v1beta20210701.workspacescomputes.machinelearningservices.azure.com,admissionReviewVersions=v1beta1 + +var _ admission.Validator = &WorkspacesCompute{} + +// ValidateCreate validates the creation of the resource +func (compute *WorkspacesCompute) ValidateCreate() error { + validations := compute.createValidations() + var temp interface{} = compute + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation() + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// ValidateDelete validates the deletion of the resource +func (compute *WorkspacesCompute) ValidateDelete() error { + validations := compute.deleteValidations() + var temp interface{} = compute + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation() + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// ValidateUpdate validates an update of the resource +func (compute *WorkspacesCompute) ValidateUpdate(old runtime.Object) error { + validations := compute.updateValidations() + var temp interface{} = compute + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation(old) + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// createValidations validates the creation of the resource +func (compute *WorkspacesCompute) createValidations() []func() error { + return []func() error{compute.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (compute *WorkspacesCompute) deleteValidations() []func() error { + return nil +} + +// updateValidations validates the update of the resource +func (compute *WorkspacesCompute) updateValidations() []func(old runtime.Object) error { + return []func(old runtime.Object) error{ + func(old runtime.Object) error { + return compute.validateResourceReferences() + }, + compute.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (compute *WorkspacesCompute) validateResourceReferences() error { + refs, err := reflecthelpers.FindResourceReferences(&compute.Spec) + if err != nil { + return err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (compute *WorkspacesCompute) validateWriteOnceProperties(old runtime.Object) error { + oldObj, ok := old.(*WorkspacesCompute) + if !ok { + return nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, compute) +} + +// AssignPropertiesFromWorkspacesCompute populates our WorkspacesCompute from the provided source WorkspacesCompute +func (compute *WorkspacesCompute) AssignPropertiesFromWorkspacesCompute(source *v20210701s.WorkspacesCompute) error { + + // ObjectMeta + compute.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec WorkspacesComputes_Spec + err := spec.AssignPropertiesFromWorkspacesComputesSpec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspacesComputesSpec() to populate field Spec") + } + compute.Spec = spec + + // Status + var status ComputeResource_Status + err = status.AssignPropertiesFromComputeResourceStatus(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeResourceStatus() to populate field Status") + } + compute.Status = status + + // No error + return nil +} + +// AssignPropertiesToWorkspacesCompute populates the provided destination WorkspacesCompute from our WorkspacesCompute +func (compute *WorkspacesCompute) AssignPropertiesToWorkspacesCompute(destination *v20210701s.WorkspacesCompute) error { + + // ObjectMeta + destination.ObjectMeta = *compute.ObjectMeta.DeepCopy() + + // Spec + var spec v20210701s.WorkspacesComputes_Spec + err := compute.Spec.AssignPropertiesToWorkspacesComputesSpec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspacesComputesSpec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20210701s.ComputeResource_Status + err = compute.Status.AssignPropertiesToComputeResourceStatus(&status) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeResourceStatus() 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 (compute *WorkspacesCompute) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: compute.Spec.OriginalVersion(), + Kind: "WorkspacesCompute", + } +} + +// +kubebuilder:object:root=true +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_computes +type WorkspacesComputeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []WorkspacesCompute `json:"items"` +} + +type ComputeResource_Status struct { + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,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: Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: Compute properties + Properties *Compute_Status `json:"properties,omitempty"` + + // Sku: The sku of the workspace. + Sku *Sku_Status `json:"sku,omitempty"` + + // SystemData: System data + SystemData *SystemData_Status `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + 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"` +} + +var _ genruntime.ConvertibleStatus = &ComputeResource_Status{} + +// ConvertStatusFrom populates our ComputeResource_Status from the provided source +func (resource *ComputeResource_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20210701s.ComputeResource_Status) + if ok { + // Populate our instance from source + return resource.AssignPropertiesFromComputeResourceStatus(src) + } + + // Convert to an intermediate form + src = &v20210701s.ComputeResource_Status{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = resource.AssignPropertiesFromComputeResourceStatus(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our ComputeResource_Status +func (resource *ComputeResource_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20210701s.ComputeResource_Status) + if ok { + // Populate destination from our instance + return resource.AssignPropertiesToComputeResourceStatus(dst) + } + + // Convert to an intermediate form + dst = &v20210701s.ComputeResource_Status{} + err := resource.AssignPropertiesToComputeResourceStatus(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &ComputeResource_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (resource *ComputeResource_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ComputeResource_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (resource *ComputeResource_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ComputeResource_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ComputeResource_StatusARM, got %T", armInput) + } + + // no assignment for property ‘Conditions’ + + // Set property ‘Id’: + if typedInput.Id != nil { + id := *typedInput.Id + resource.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 + resource.Identity = &identity + } + + // Set property ‘Location’: + if typedInput.Location != nil { + location := *typedInput.Location + resource.Location = &location + } + + // Set property ‘Name’: + if typedInput.Name != nil { + name := *typedInput.Name + resource.Name = &name + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 Compute_Status + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + resource.Properties = &properties + } + + // Set property ‘Sku’: + if typedInput.Sku != nil { + var sku1 Sku_Status + err := sku1.PopulateFromARM(owner, *typedInput.Sku) + if err != nil { + return err + } + sku := sku1 + resource.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 + resource.SystemData = &systemData + } + + // Set property ‘Tags’: + if typedInput.Tags != nil { + resource.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + resource.Tags[key] = value + } + } + + // Set property ‘Type’: + if typedInput.Type != nil { + typeVar := *typedInput.Type + resource.Type = &typeVar + } + + // No error + return nil +} + +// AssignPropertiesFromComputeResourceStatus populates our ComputeResource_Status from the provided source ComputeResource_Status +func (resource *ComputeResource_Status) AssignPropertiesFromComputeResourceStatus(source *v20210701s.ComputeResource_Status) error { + + // Conditions + resource.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // Id + resource.Id = genruntime.ClonePointerToString(source.Id) + + // Identity + if source.Identity != nil { + var identity Identity_Status + err := identity.AssignPropertiesFromIdentityStatus(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromIdentityStatus() to populate field Identity") + } + resource.Identity = &identity + } else { + resource.Identity = nil + } + + // Location + resource.Location = genruntime.ClonePointerToString(source.Location) + + // Name + resource.Name = genruntime.ClonePointerToString(source.Name) + + // Properties + if source.Properties != nil { + var property Compute_Status + err := property.AssignPropertiesFromComputeStatus(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeStatus() to populate field Properties") + } + resource.Properties = &property + } else { + resource.Properties = nil + } + + // Sku + if source.Sku != nil { + var sku Sku_Status + err := sku.AssignPropertiesFromSkuStatus(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSkuStatus() to populate field Sku") + } + resource.Sku = &sku + } else { + resource.Sku = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_Status + err := systemDatum.AssignPropertiesFromSystemDataStatus(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSystemDataStatus() to populate field SystemData") + } + resource.SystemData = &systemDatum + } else { + resource.SystemData = nil + } + + // Tags + resource.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // Type + resource.Type = genruntime.ClonePointerToString(source.Type) + + // No error + return nil +} + +// AssignPropertiesToComputeResourceStatus populates the provided destination ComputeResource_Status from our ComputeResource_Status +func (resource *ComputeResource_Status) AssignPropertiesToComputeResourceStatus(destination *v20210701s.ComputeResource_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(resource.Conditions) + + // Id + destination.Id = genruntime.ClonePointerToString(resource.Id) + + // Identity + if resource.Identity != nil { + var identity v20210701s.Identity_Status + err := resource.Identity.AssignPropertiesToIdentityStatus(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToIdentityStatus() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(resource.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(resource.Name) + + // Properties + if resource.Properties != nil { + var property v20210701s.Compute_Status + err := resource.Properties.AssignPropertiesToComputeStatus(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeStatus() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // Sku + if resource.Sku != nil { + var sku v20210701s.Sku_Status + err := resource.Sku.AssignPropertiesToSkuStatus(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSkuStatus() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // SystemData + if resource.SystemData != nil { + var systemDatum v20210701s.SystemData_Status + err := resource.SystemData.AssignPropertiesToSystemDataStatus(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSystemDataStatus() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(resource.Tags) + + // Type + destination.Type = genruntime.ClonePointerToString(resource.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type WorkspacesComputes_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"` + + // Identity: Identity for the resource. + Identity *Identity `json:"identity,omitempty"` + + // Location: Specifies the location of the resource. + Location *string `json:"location,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 machinelearningservices.azure.com/Workspace resource + Owner *genruntime.KnownResourceReference `group:"machinelearningservices.azure.com" json:"owner,omitempty" kind:"Workspace"` + + // +kubebuilder:validation:Required + // Properties: Machine Learning compute object. + Properties *Compute `json:"properties,omitempty"` + + // Sku: Sku of the resource + Sku *Sku `json:"sku,omitempty"` + + // SystemData: Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMTransformer = &WorkspacesComputes_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (computes *WorkspacesComputes_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if computes == nil { + return nil, nil + } + result := &WorkspacesComputes_SpecARM{} + + // Set property ‘Identity’: + if computes.Identity != nil { + identityARM, err := (*computes.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identityARM.(*IdentityARM) + result.Identity = &identity + } + + // Set property ‘Location’: + if computes.Location != nil { + location := *computes.Location + result.Location = &location + } + + // Set property ‘Name’: + result.Name = resolved.Name + + // Set property ‘Properties’: + if computes.Properties != nil { + propertiesARM, err := (*computes.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*ComputeARM) + result.Properties = &properties + } + + // Set property ‘Sku’: + if computes.Sku != nil { + skuARM, err := (*computes.Sku).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sku := *skuARM.(*SkuARM) + result.Sku = &sku + } + + // Set property ‘SystemData’: + if computes.SystemData != nil { + systemDataARM, err := (*computes.SystemData).ConvertToARM(resolved) + if err != nil { + return nil, err + } + systemData := *systemDataARM.(*SystemDataARM) + result.SystemData = &systemData + } + + // Set property ‘Tags’: + if computes.Tags != nil { + result.Tags = make(map[string]string, len(computes.Tags)) + for key, value := range computes.Tags { + result.Tags[key] = value + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (computes *WorkspacesComputes_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &WorkspacesComputes_SpecARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (computes *WorkspacesComputes_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(WorkspacesComputes_SpecARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected WorkspacesComputes_SpecARM, got %T", armInput) + } + + // Set property ‘AzureName’: + computes.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property ‘Identity’: + if typedInput.Identity != nil { + var identity1 Identity + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + computes.Identity = &identity + } + + // Set property ‘Location’: + if typedInput.Location != nil { + location := *typedInput.Location + computes.Location = &location + } + + // Set property ‘Owner’: + computes.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 Compute + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + computes.Properties = &properties + } + + // Set property ‘Sku’: + if typedInput.Sku != nil { + var sku1 Sku + err := sku1.PopulateFromARM(owner, *typedInput.Sku) + if err != nil { + return err + } + sku := sku1 + computes.Sku = &sku + } + + // Set property ‘SystemData’: + if typedInput.SystemData != nil { + var systemData1 SystemData + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + computes.SystemData = &systemData + } + + // Set property ‘Tags’: + if typedInput.Tags != nil { + computes.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + computes.Tags[key] = value + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &WorkspacesComputes_Spec{} + +// ConvertSpecFrom populates our WorkspacesComputes_Spec from the provided source +func (computes *WorkspacesComputes_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20210701s.WorkspacesComputes_Spec) + if ok { + // Populate our instance from source + return computes.AssignPropertiesFromWorkspacesComputesSpec(src) + } + + // Convert to an intermediate form + src = &v20210701s.WorkspacesComputes_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = computes.AssignPropertiesFromWorkspacesComputesSpec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our WorkspacesComputes_Spec +func (computes *WorkspacesComputes_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20210701s.WorkspacesComputes_Spec) + if ok { + // Populate destination from our instance + return computes.AssignPropertiesToWorkspacesComputesSpec(dst) + } + + // Convert to an intermediate form + dst = &v20210701s.WorkspacesComputes_Spec{} + err := computes.AssignPropertiesToWorkspacesComputesSpec(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignPropertiesFromWorkspacesComputesSpec populates our WorkspacesComputes_Spec from the provided source WorkspacesComputes_Spec +func (computes *WorkspacesComputes_Spec) AssignPropertiesFromWorkspacesComputesSpec(source *v20210701s.WorkspacesComputes_Spec) error { + + // AzureName + computes.AzureName = source.AzureName + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.AssignPropertiesFromIdentity(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromIdentity() to populate field Identity") + } + computes.Identity = &identity + } else { + computes.Identity = nil + } + + // Location + computes.Location = genruntime.ClonePointerToString(source.Location) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + computes.Owner = &owner + } else { + computes.Owner = nil + } + + // Properties + if source.Properties != nil { + var property Compute + err := property.AssignPropertiesFromCompute(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromCompute() to populate field Properties") + } + computes.Properties = &property + } else { + computes.Properties = nil + } + + // Sku + if source.Sku != nil { + var sku Sku + err := sku.AssignPropertiesFromSku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSku() to populate field Sku") + } + computes.Sku = &sku + } else { + computes.Sku = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData + err := systemDatum.AssignPropertiesFromSystemData(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSystemData() to populate field SystemData") + } + computes.SystemData = &systemDatum + } else { + computes.SystemData = nil + } + + // Tags + computes.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // No error + return nil +} + +// AssignPropertiesToWorkspacesComputesSpec populates the provided destination WorkspacesComputes_Spec from our WorkspacesComputes_Spec +func (computes *WorkspacesComputes_Spec) AssignPropertiesToWorkspacesComputesSpec(destination *v20210701s.WorkspacesComputes_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = computes.AzureName + + // Identity + if computes.Identity != nil { + var identity v20210701s.Identity + err := computes.Identity.AssignPropertiesToIdentity(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToIdentity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(computes.Location) + + // OriginalVersion + destination.OriginalVersion = computes.OriginalVersion() + + // Owner + if computes.Owner != nil { + owner := computes.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Properties + if computes.Properties != nil { + var property v20210701s.Compute + err := computes.Properties.AssignPropertiesToCompute(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToCompute() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // Sku + if computes.Sku != nil { + var sku v20210701s.Sku + err := computes.Sku.AssignPropertiesToSku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSku() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // SystemData + if computes.SystemData != nil { + var systemDatum v20210701s.SystemData + err := computes.SystemData.AssignPropertiesToSystemData(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSystemData() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(computes.Tags) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (computes *WorkspacesComputes_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (computes *WorkspacesComputes_Spec) SetAzureName(azureName string) { + computes.AzureName = azureName +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Compute +type Compute struct { + // AKS: Mutually exclusive with all other properties + AKS *Compute_AKS `json:"aks,omitempty"` + + // AmlCompute: Mutually exclusive with all other properties + AmlCompute *Compute_AmlCompute `json:"amlCompute,omitempty"` + + // ComputeInstance: Mutually exclusive with all other properties + ComputeInstance *Compute_ComputeInstance `json:"computeInstance,omitempty"` + + // DataFactory: Mutually exclusive with all other properties + DataFactory *Compute_DataFactory `json:"dataFactory,omitempty"` + + // DataLakeAnalytics: Mutually exclusive with all other properties + DataLakeAnalytics *Compute_DataLakeAnalytics `json:"dataLakeAnalytics,omitempty"` + + // Databricks: Mutually exclusive with all other properties + Databricks *Compute_Databricks `json:"databricks,omitempty"` + + // HDInsight: Mutually exclusive with all other properties + HDInsight *Compute_HDInsight `json:"hdInsight,omitempty"` + + // SynapseSpark: Mutually exclusive with all other properties + SynapseSpark *Compute_SynapseSpark `json:"synapseSpark,omitempty"` + + // VirtualMachine: Mutually exclusive with all other properties + VirtualMachine *Compute_VirtualMachine `json:"virtualMachine,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (compute *Compute) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if compute == nil { + return nil, nil + } + result := &ComputeARM{} + + // Set property ‘AKS’: + if compute.AKS != nil { + aksARM, err := (*compute.AKS).ConvertToARM(resolved) + if err != nil { + return nil, err + } + aks := *aksARM.(*Compute_AKSARM) + result.AKS = &aks + } + + // Set property ‘AmlCompute’: + if compute.AmlCompute != nil { + amlComputeARM, err := (*compute.AmlCompute).ConvertToARM(resolved) + if err != nil { + return nil, err + } + amlCompute := *amlComputeARM.(*Compute_AmlComputeARM) + result.AmlCompute = &amlCompute + } + + // Set property ‘ComputeInstance’: + if compute.ComputeInstance != nil { + computeInstanceARM, err := (*compute.ComputeInstance).ConvertToARM(resolved) + if err != nil { + return nil, err + } + computeInstance := *computeInstanceARM.(*Compute_ComputeInstanceARM) + result.ComputeInstance = &computeInstance + } + + // Set property ‘DataFactory’: + if compute.DataFactory != nil { + dataFactoryARM, err := (*compute.DataFactory).ConvertToARM(resolved) + if err != nil { + return nil, err + } + dataFactory := *dataFactoryARM.(*Compute_DataFactoryARM) + result.DataFactory = &dataFactory + } + + // Set property ‘DataLakeAnalytics’: + if compute.DataLakeAnalytics != nil { + dataLakeAnalyticsARM, err := (*compute.DataLakeAnalytics).ConvertToARM(resolved) + if err != nil { + return nil, err + } + dataLakeAnalytics := *dataLakeAnalyticsARM.(*Compute_DataLakeAnalyticsARM) + result.DataLakeAnalytics = &dataLakeAnalytics + } + + // Set property ‘Databricks’: + if compute.Databricks != nil { + databricksARM, err := (*compute.Databricks).ConvertToARM(resolved) + if err != nil { + return nil, err + } + databricks := *databricksARM.(*Compute_DatabricksARM) + result.Databricks = &databricks + } + + // Set property ‘HDInsight’: + if compute.HDInsight != nil { + hdInsightARM, err := (*compute.HDInsight).ConvertToARM(resolved) + if err != nil { + return nil, err + } + hdInsight := *hdInsightARM.(*Compute_HDInsightARM) + result.HDInsight = &hdInsight + } + + // Set property ‘SynapseSpark’: + if compute.SynapseSpark != nil { + synapseSparkARM, err := (*compute.SynapseSpark).ConvertToARM(resolved) + if err != nil { + return nil, err + } + synapseSpark := *synapseSparkARM.(*Compute_SynapseSparkARM) + result.SynapseSpark = &synapseSpark + } + + // Set property ‘VirtualMachine’: + if compute.VirtualMachine != nil { + virtualMachineARM, err := (*compute.VirtualMachine).ConvertToARM(resolved) + if err != nil { + return nil, err + } + virtualMachine := *virtualMachineARM.(*Compute_VirtualMachineARM) + result.VirtualMachine = &virtualMachine + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (compute *Compute) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ComputeARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (compute *Compute) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ComputeARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ComputeARM, got %T", armInput) + } + + // Set property ‘AKS’: + if typedInput.AKS != nil { + var aks1 Compute_AKS + err := aks1.PopulateFromARM(owner, *typedInput.AKS) + if err != nil { + return err + } + aks := aks1 + compute.AKS = &aks + } + + // Set property ‘AmlCompute’: + if typedInput.AmlCompute != nil { + var amlCompute1 Compute_AmlCompute + err := amlCompute1.PopulateFromARM(owner, *typedInput.AmlCompute) + if err != nil { + return err + } + amlCompute := amlCompute1 + compute.AmlCompute = &amlCompute + } + + // Set property ‘ComputeInstance’: + if typedInput.ComputeInstance != nil { + var computeInstance1 Compute_ComputeInstance + err := computeInstance1.PopulateFromARM(owner, *typedInput.ComputeInstance) + if err != nil { + return err + } + computeInstance := computeInstance1 + compute.ComputeInstance = &computeInstance + } + + // Set property ‘DataFactory’: + if typedInput.DataFactory != nil { + var dataFactory1 Compute_DataFactory + err := dataFactory1.PopulateFromARM(owner, *typedInput.DataFactory) + if err != nil { + return err + } + dataFactory := dataFactory1 + compute.DataFactory = &dataFactory + } + + // Set property ‘DataLakeAnalytics’: + if typedInput.DataLakeAnalytics != nil { + var dataLakeAnalytics1 Compute_DataLakeAnalytics + err := dataLakeAnalytics1.PopulateFromARM(owner, *typedInput.DataLakeAnalytics) + if err != nil { + return err + } + dataLakeAnalytics := dataLakeAnalytics1 + compute.DataLakeAnalytics = &dataLakeAnalytics + } + + // Set property ‘Databricks’: + if typedInput.Databricks != nil { + var databricks1 Compute_Databricks + err := databricks1.PopulateFromARM(owner, *typedInput.Databricks) + if err != nil { + return err + } + databricks := databricks1 + compute.Databricks = &databricks + } + + // Set property ‘HDInsight’: + if typedInput.HDInsight != nil { + var hdInsight1 Compute_HDInsight + err := hdInsight1.PopulateFromARM(owner, *typedInput.HDInsight) + if err != nil { + return err + } + hdInsight := hdInsight1 + compute.HDInsight = &hdInsight + } + + // Set property ‘SynapseSpark’: + if typedInput.SynapseSpark != nil { + var synapseSpark1 Compute_SynapseSpark + err := synapseSpark1.PopulateFromARM(owner, *typedInput.SynapseSpark) + if err != nil { + return err + } + synapseSpark := synapseSpark1 + compute.SynapseSpark = &synapseSpark + } + + // Set property ‘VirtualMachine’: + if typedInput.VirtualMachine != nil { + var virtualMachine1 Compute_VirtualMachine + err := virtualMachine1.PopulateFromARM(owner, *typedInput.VirtualMachine) + if err != nil { + return err + } + virtualMachine := virtualMachine1 + compute.VirtualMachine = &virtualMachine + } + + // No error + return nil +} + +// AssignPropertiesFromCompute populates our Compute from the provided source Compute +func (compute *Compute) AssignPropertiesFromCompute(source *v20210701s.Compute) error { + + // AKS + if source.AKS != nil { + var aks Compute_AKS + err := aks.AssignPropertiesFromComputeAKS(source.AKS) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeAKS() to populate field AKS") + } + compute.AKS = &aks + } else { + compute.AKS = nil + } + + // AmlCompute + if source.AmlCompute != nil { + var amlCompute Compute_AmlCompute + err := amlCompute.AssignPropertiesFromComputeAmlCompute(source.AmlCompute) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeAmlCompute() to populate field AmlCompute") + } + compute.AmlCompute = &amlCompute + } else { + compute.AmlCompute = nil + } + + // ComputeInstance + if source.ComputeInstance != nil { + var computeInstance Compute_ComputeInstance + err := computeInstance.AssignPropertiesFromComputeComputeInstance(source.ComputeInstance) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeComputeInstance() to populate field ComputeInstance") + } + compute.ComputeInstance = &computeInstance + } else { + compute.ComputeInstance = nil + } + + // DataFactory + if source.DataFactory != nil { + var dataFactory Compute_DataFactory + err := dataFactory.AssignPropertiesFromComputeDataFactory(source.DataFactory) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeDataFactory() to populate field DataFactory") + } + compute.DataFactory = &dataFactory + } else { + compute.DataFactory = nil + } + + // DataLakeAnalytics + if source.DataLakeAnalytics != nil { + var dataLakeAnalytic Compute_DataLakeAnalytics + err := dataLakeAnalytic.AssignPropertiesFromComputeDataLakeAnalytics(source.DataLakeAnalytics) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeDataLakeAnalytics() to populate field DataLakeAnalytics") + } + compute.DataLakeAnalytics = &dataLakeAnalytic + } else { + compute.DataLakeAnalytics = nil + } + + // Databricks + if source.Databricks != nil { + var databrick Compute_Databricks + err := databrick.AssignPropertiesFromComputeDatabricks(source.Databricks) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeDatabricks() to populate field Databricks") + } + compute.Databricks = &databrick + } else { + compute.Databricks = nil + } + + // HDInsight + if source.HDInsight != nil { + var hdInsight Compute_HDInsight + err := hdInsight.AssignPropertiesFromComputeHDInsight(source.HDInsight) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeHDInsight() to populate field HDInsight") + } + compute.HDInsight = &hdInsight + } else { + compute.HDInsight = nil + } + + // SynapseSpark + if source.SynapseSpark != nil { + var synapseSpark Compute_SynapseSpark + err := synapseSpark.AssignPropertiesFromComputeSynapseSpark(source.SynapseSpark) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeSynapseSpark() to populate field SynapseSpark") + } + compute.SynapseSpark = &synapseSpark + } else { + compute.SynapseSpark = nil + } + + // VirtualMachine + if source.VirtualMachine != nil { + var virtualMachine Compute_VirtualMachine + err := virtualMachine.AssignPropertiesFromComputeVirtualMachine(source.VirtualMachine) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeVirtualMachine() to populate field VirtualMachine") + } + compute.VirtualMachine = &virtualMachine + } else { + compute.VirtualMachine = nil + } + + // No error + return nil +} + +// AssignPropertiesToCompute populates the provided destination Compute from our Compute +func (compute *Compute) AssignPropertiesToCompute(destination *v20210701s.Compute) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AKS + if compute.AKS != nil { + var aks v20210701s.Compute_AKS + err := compute.AKS.AssignPropertiesToComputeAKS(&aks) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeAKS() to populate field AKS") + } + destination.AKS = &aks + } else { + destination.AKS = nil + } + + // AmlCompute + if compute.AmlCompute != nil { + var amlCompute v20210701s.Compute_AmlCompute + err := compute.AmlCompute.AssignPropertiesToComputeAmlCompute(&amlCompute) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeAmlCompute() to populate field AmlCompute") + } + destination.AmlCompute = &amlCompute + } else { + destination.AmlCompute = nil + } + + // ComputeInstance + if compute.ComputeInstance != nil { + var computeInstance v20210701s.Compute_ComputeInstance + err := compute.ComputeInstance.AssignPropertiesToComputeComputeInstance(&computeInstance) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeComputeInstance() to populate field ComputeInstance") + } + destination.ComputeInstance = &computeInstance + } else { + destination.ComputeInstance = nil + } + + // DataFactory + if compute.DataFactory != nil { + var dataFactory v20210701s.Compute_DataFactory + err := compute.DataFactory.AssignPropertiesToComputeDataFactory(&dataFactory) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeDataFactory() to populate field DataFactory") + } + destination.DataFactory = &dataFactory + } else { + destination.DataFactory = nil + } + + // DataLakeAnalytics + if compute.DataLakeAnalytics != nil { + var dataLakeAnalytic v20210701s.Compute_DataLakeAnalytics + err := compute.DataLakeAnalytics.AssignPropertiesToComputeDataLakeAnalytics(&dataLakeAnalytic) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeDataLakeAnalytics() to populate field DataLakeAnalytics") + } + destination.DataLakeAnalytics = &dataLakeAnalytic + } else { + destination.DataLakeAnalytics = nil + } + + // Databricks + if compute.Databricks != nil { + var databrick v20210701s.Compute_Databricks + err := compute.Databricks.AssignPropertiesToComputeDatabricks(&databrick) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeDatabricks() to populate field Databricks") + } + destination.Databricks = &databrick + } else { + destination.Databricks = nil + } + + // HDInsight + if compute.HDInsight != nil { + var hdInsight v20210701s.Compute_HDInsight + err := compute.HDInsight.AssignPropertiesToComputeHDInsight(&hdInsight) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeHDInsight() to populate field HDInsight") + } + destination.HDInsight = &hdInsight + } else { + destination.HDInsight = nil + } + + // SynapseSpark + if compute.SynapseSpark != nil { + var synapseSpark v20210701s.Compute_SynapseSpark + err := compute.SynapseSpark.AssignPropertiesToComputeSynapseSpark(&synapseSpark) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeSynapseSpark() to populate field SynapseSpark") + } + destination.SynapseSpark = &synapseSpark + } else { + destination.SynapseSpark = nil + } + + // VirtualMachine + if compute.VirtualMachine != nil { + var virtualMachine v20210701s.Compute_VirtualMachine + err := compute.VirtualMachine.AssignPropertiesToComputeVirtualMachine(&virtualMachine) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeVirtualMachine() to populate field VirtualMachine") + } + destination.VirtualMachine = &virtualMachine + } else { + destination.VirtualMachine = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_Status struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // ComputeType: The type of compute + ComputeType *ComputeType_Status `json:"computeType,omitempty"` + + // CreatedOn: The time at which the compute was created. + CreatedOn *string `json:"createdOn,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // IsAttachedCompute: Indicating whether the compute was provisioned by user and brought from outside if true, or machine + // learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + + // ModifiedOn: The time at which the compute was last modified. + ModifiedOn *string `json:"modifiedOn,omitempty"` + + // ProvisioningErrors: Errors during provisioning + ProvisioningErrors []ErrorResponse_Status `json:"provisioningErrors,omitempty"` + + // ProvisioningState: The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and + // Failed. + ProvisioningState *ComputeStatusProvisioningState `json:"provisioningState,omitempty"` + + // ResourceId: ARM resource id of the underlying compute + ResourceId *string `json:"resourceId,omitempty"` +} + +var _ genruntime.FromARMConverter = &Compute_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (compute *Compute_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (compute *Compute_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_StatusARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + compute.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if typedInput.ComputeType != nil { + computeType := *typedInput.ComputeType + compute.ComputeType = &computeType + } + + // Set property ‘CreatedOn’: + if typedInput.CreatedOn != nil { + createdOn := *typedInput.CreatedOn + compute.CreatedOn = &createdOn + } + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + compute.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + compute.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘IsAttachedCompute’: + if typedInput.IsAttachedCompute != nil { + isAttachedCompute := *typedInput.IsAttachedCompute + compute.IsAttachedCompute = &isAttachedCompute + } + + // Set property ‘ModifiedOn’: + if typedInput.ModifiedOn != nil { + modifiedOn := *typedInput.ModifiedOn + compute.ModifiedOn = &modifiedOn + } + + // Set property ‘ProvisioningErrors’: + for _, item := range typedInput.ProvisioningErrors { + var item1 ErrorResponse_Status + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + compute.ProvisioningErrors = append(compute.ProvisioningErrors, item1) + } + + // Set property ‘ProvisioningState’: + if typedInput.ProvisioningState != nil { + provisioningState := *typedInput.ProvisioningState + compute.ProvisioningState = &provisioningState + } + + // Set property ‘ResourceId’: + if typedInput.ResourceId != nil { + resourceId := *typedInput.ResourceId + compute.ResourceId = &resourceId + } + + // No error + return nil +} + +// AssignPropertiesFromComputeStatus populates our Compute_Status from the provided source Compute_Status +func (compute *Compute_Status) AssignPropertiesFromComputeStatus(source *v20210701s.Compute_Status) error { + + // ComputeLocation + compute.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeType_Status(*source.ComputeType) + compute.ComputeType = &computeType + } else { + compute.ComputeType = nil + } + + // CreatedOn + compute.CreatedOn = genruntime.ClonePointerToString(source.CreatedOn) + + // Description + compute.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + compute.DisableLocalAuth = &disableLocalAuth + } else { + compute.DisableLocalAuth = nil + } + + // IsAttachedCompute + if source.IsAttachedCompute != nil { + isAttachedCompute := *source.IsAttachedCompute + compute.IsAttachedCompute = &isAttachedCompute + } else { + compute.IsAttachedCompute = nil + } + + // ModifiedOn + compute.ModifiedOn = genruntime.ClonePointerToString(source.ModifiedOn) + + // ProvisioningErrors + if source.ProvisioningErrors != nil { + provisioningErrorList := make([]ErrorResponse_Status, len(source.ProvisioningErrors)) + for provisioningErrorIndex, provisioningErrorItem := range source.ProvisioningErrors { + // Shadow the loop variable to avoid aliasing + provisioningErrorItem := provisioningErrorItem + var provisioningError ErrorResponse_Status + err := provisioningError.AssignPropertiesFromErrorResponseStatus(&provisioningErrorItem) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromErrorResponseStatus() to populate field ProvisioningErrors") + } + provisioningErrorList[provisioningErrorIndex] = provisioningError + } + compute.ProvisioningErrors = provisioningErrorList + } else { + compute.ProvisioningErrors = nil + } + + // ProvisioningState + if source.ProvisioningState != nil { + provisioningState := ComputeStatusProvisioningState(*source.ProvisioningState) + compute.ProvisioningState = &provisioningState + } else { + compute.ProvisioningState = nil + } + + // ResourceId + compute.ResourceId = genruntime.ClonePointerToString(source.ResourceId) + + // No error + return nil +} + +// AssignPropertiesToComputeStatus populates the provided destination Compute_Status from our Compute_Status +func (compute *Compute_Status) AssignPropertiesToComputeStatus(destination *v20210701s.Compute_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(compute.ComputeLocation) + + // ComputeType + if compute.ComputeType != nil { + computeType := string(*compute.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // CreatedOn + destination.CreatedOn = genruntime.ClonePointerToString(compute.CreatedOn) + + // Description + destination.Description = genruntime.ClonePointerToString(compute.Description) + + // DisableLocalAuth + if compute.DisableLocalAuth != nil { + disableLocalAuth := *compute.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // IsAttachedCompute + if compute.IsAttachedCompute != nil { + isAttachedCompute := *compute.IsAttachedCompute + destination.IsAttachedCompute = &isAttachedCompute + } else { + destination.IsAttachedCompute = nil + } + + // ModifiedOn + destination.ModifiedOn = genruntime.ClonePointerToString(compute.ModifiedOn) + + // ProvisioningErrors + if compute.ProvisioningErrors != nil { + provisioningErrorList := make([]v20210701s.ErrorResponse_Status, len(compute.ProvisioningErrors)) + for provisioningErrorIndex, provisioningErrorItem := range compute.ProvisioningErrors { + // Shadow the loop variable to avoid aliasing + provisioningErrorItem := provisioningErrorItem + var provisioningError v20210701s.ErrorResponse_Status + err := provisioningErrorItem.AssignPropertiesToErrorResponseStatus(&provisioningError) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToErrorResponseStatus() to populate field ProvisioningErrors") + } + provisioningErrorList[provisioningErrorIndex] = provisioningError + } + destination.ProvisioningErrors = provisioningErrorList + } else { + destination.ProvisioningErrors = nil + } + + // ProvisioningState + if compute.ProvisioningState != nil { + provisioningState := string(*compute.ProvisioningState) + destination.ProvisioningState = &provisioningState + } else { + destination.ProvisioningState = nil + } + + // ResourceId + destination.ResourceId = genruntime.ClonePointerToString(compute.ResourceId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_AKS struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeAKSComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: AKS properties + Properties *AKSProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_AKS{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (computeAKS *Compute_AKS) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if computeAKS == nil { + return nil, nil + } + result := &Compute_AKSARM{} + + // Set property ‘ComputeLocation’: + if computeAKS.ComputeLocation != nil { + computeLocation := *computeAKS.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if computeAKS.ComputeType != nil { + result.ComputeType = *computeAKS.ComputeType + } + + // Set property ‘Description’: + if computeAKS.Description != nil { + description := *computeAKS.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if computeAKS.DisableLocalAuth != nil { + disableLocalAuth := *computeAKS.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if computeAKS.Properties != nil { + propertiesARM, err := (*computeAKS.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*AKSPropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if computeAKS.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*computeAKS.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (computeAKS *Compute_AKS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_AKSARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (computeAKS *Compute_AKS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_AKSARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_AKSARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + computeAKS.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + computeAKS.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + computeAKS.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + computeAKS.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 AKSProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + computeAKS.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeAKS populates our Compute_AKS from the provided source Compute_AKS +func (computeAKS *Compute_AKS) AssignPropertiesFromComputeAKS(source *v20210701s.Compute_AKS) error { + + // ComputeLocation + computeAKS.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeAKSComputeType(*source.ComputeType) + computeAKS.ComputeType = &computeType + } else { + computeAKS.ComputeType = nil + } + + // Description + computeAKS.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + computeAKS.DisableLocalAuth = &disableLocalAuth + } else { + computeAKS.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property AKSProperties + err := property.AssignPropertiesFromAKSProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromAKSProperties() to populate field Properties") + } + computeAKS.Properties = &property + } else { + computeAKS.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + computeAKS.ResourceReference = &resourceReference + } else { + computeAKS.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeAKS populates the provided destination Compute_AKS from our Compute_AKS +func (computeAKS *Compute_AKS) AssignPropertiesToComputeAKS(destination *v20210701s.Compute_AKS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(computeAKS.ComputeLocation) + + // ComputeType + if computeAKS.ComputeType != nil { + computeType := string(*computeAKS.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(computeAKS.Description) + + // DisableLocalAuth + if computeAKS.DisableLocalAuth != nil { + disableLocalAuth := *computeAKS.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if computeAKS.Properties != nil { + var property v20210701s.AKSProperties + err := computeAKS.Properties.AssignPropertiesToAKSProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToAKSProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if computeAKS.ResourceReference != nil { + resourceReference := computeAKS.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_AmlCompute struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeAmlComputeComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: AML Compute properties + Properties *AmlComputeProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_AmlCompute{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (compute *Compute_AmlCompute) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if compute == nil { + return nil, nil + } + result := &Compute_AmlComputeARM{} + + // Set property ‘ComputeLocation’: + if compute.ComputeLocation != nil { + computeLocation := *compute.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if compute.ComputeType != nil { + result.ComputeType = *compute.ComputeType + } + + // Set property ‘Description’: + if compute.Description != nil { + description := *compute.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if compute.DisableLocalAuth != nil { + disableLocalAuth := *compute.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if compute.Properties != nil { + propertiesARM, err := (*compute.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*AmlComputePropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if compute.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*compute.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (compute *Compute_AmlCompute) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_AmlComputeARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (compute *Compute_AmlCompute) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_AmlComputeARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_AmlComputeARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + compute.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + compute.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + compute.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + compute.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 AmlComputeProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + compute.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeAmlCompute populates our Compute_AmlCompute from the provided source Compute_AmlCompute +func (compute *Compute_AmlCompute) AssignPropertiesFromComputeAmlCompute(source *v20210701s.Compute_AmlCompute) error { + + // ComputeLocation + compute.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeAmlComputeComputeType(*source.ComputeType) + compute.ComputeType = &computeType + } else { + compute.ComputeType = nil + } + + // Description + compute.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + compute.DisableLocalAuth = &disableLocalAuth + } else { + compute.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property AmlComputeProperties + err := property.AssignPropertiesFromAmlComputeProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromAmlComputeProperties() to populate field Properties") + } + compute.Properties = &property + } else { + compute.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + compute.ResourceReference = &resourceReference + } else { + compute.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeAmlCompute populates the provided destination Compute_AmlCompute from our Compute_AmlCompute +func (compute *Compute_AmlCompute) AssignPropertiesToComputeAmlCompute(destination *v20210701s.Compute_AmlCompute) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(compute.ComputeLocation) + + // ComputeType + if compute.ComputeType != nil { + computeType := string(*compute.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(compute.Description) + + // DisableLocalAuth + if compute.DisableLocalAuth != nil { + disableLocalAuth := *compute.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if compute.Properties != nil { + var property v20210701s.AmlComputeProperties + err := compute.Properties.AssignPropertiesToAmlComputeProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToAmlComputeProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if compute.ResourceReference != nil { + resourceReference := compute.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_ComputeInstance struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeComputeInstanceComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: Compute Instance properties + Properties *ComputeInstanceProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_ComputeInstance{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (instance *Compute_ComputeInstance) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if instance == nil { + return nil, nil + } + result := &Compute_ComputeInstanceARM{} + + // Set property ‘ComputeLocation’: + if instance.ComputeLocation != nil { + computeLocation := *instance.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if instance.ComputeType != nil { + result.ComputeType = *instance.ComputeType + } + + // Set property ‘Description’: + if instance.Description != nil { + description := *instance.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if instance.DisableLocalAuth != nil { + disableLocalAuth := *instance.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if instance.Properties != nil { + propertiesARM, err := (*instance.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*ComputeInstancePropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if instance.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*instance.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (instance *Compute_ComputeInstance) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_ComputeInstanceARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (instance *Compute_ComputeInstance) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_ComputeInstanceARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_ComputeInstanceARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + instance.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + instance.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + instance.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + instance.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 ComputeInstanceProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + instance.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeComputeInstance populates our Compute_ComputeInstance from the provided source Compute_ComputeInstance +func (instance *Compute_ComputeInstance) AssignPropertiesFromComputeComputeInstance(source *v20210701s.Compute_ComputeInstance) error { + + // ComputeLocation + instance.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeComputeInstanceComputeType(*source.ComputeType) + instance.ComputeType = &computeType + } else { + instance.ComputeType = nil + } + + // Description + instance.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + instance.DisableLocalAuth = &disableLocalAuth + } else { + instance.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property ComputeInstanceProperties + err := property.AssignPropertiesFromComputeInstanceProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeInstanceProperties() to populate field Properties") + } + instance.Properties = &property + } else { + instance.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + instance.ResourceReference = &resourceReference + } else { + instance.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeComputeInstance populates the provided destination Compute_ComputeInstance from our Compute_ComputeInstance +func (instance *Compute_ComputeInstance) AssignPropertiesToComputeComputeInstance(destination *v20210701s.Compute_ComputeInstance) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(instance.ComputeLocation) + + // ComputeType + if instance.ComputeType != nil { + computeType := string(*instance.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(instance.Description) + + // DisableLocalAuth + if instance.DisableLocalAuth != nil { + disableLocalAuth := *instance.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if instance.Properties != nil { + var property v20210701s.ComputeInstanceProperties + err := instance.Properties.AssignPropertiesToComputeInstanceProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeInstanceProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if instance.ResourceReference != nil { + resourceReference := instance.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_DataFactory struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeDataFactoryComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_DataFactory{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (factory *Compute_DataFactory) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if factory == nil { + return nil, nil + } + result := &Compute_DataFactoryARM{} + + // Set property ‘ComputeLocation’: + if factory.ComputeLocation != nil { + computeLocation := *factory.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if factory.ComputeType != nil { + result.ComputeType = *factory.ComputeType + } + + // Set property ‘Description’: + if factory.Description != nil { + description := *factory.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if factory.DisableLocalAuth != nil { + disableLocalAuth := *factory.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘ResourceId’: + if factory.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*factory.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (factory *Compute_DataFactory) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_DataFactoryARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (factory *Compute_DataFactory) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_DataFactoryARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_DataFactoryARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + factory.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + factory.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + factory.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + factory.DisableLocalAuth = &disableLocalAuth + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeDataFactory populates our Compute_DataFactory from the provided source Compute_DataFactory +func (factory *Compute_DataFactory) AssignPropertiesFromComputeDataFactory(source *v20210701s.Compute_DataFactory) error { + + // ComputeLocation + factory.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeDataFactoryComputeType(*source.ComputeType) + factory.ComputeType = &computeType + } else { + factory.ComputeType = nil + } + + // Description + factory.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + factory.DisableLocalAuth = &disableLocalAuth + } else { + factory.DisableLocalAuth = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + factory.ResourceReference = &resourceReference + } else { + factory.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeDataFactory populates the provided destination Compute_DataFactory from our Compute_DataFactory +func (factory *Compute_DataFactory) AssignPropertiesToComputeDataFactory(destination *v20210701s.Compute_DataFactory) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(factory.ComputeLocation) + + // ComputeType + if factory.ComputeType != nil { + computeType := string(*factory.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(factory.Description) + + // DisableLocalAuth + if factory.DisableLocalAuth != nil { + disableLocalAuth := *factory.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // ResourceReference + if factory.ResourceReference != nil { + resourceReference := factory.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_DataLakeAnalytics struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeDataLakeAnalyticsComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_DataLakeAnalytics{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (analytics *Compute_DataLakeAnalytics) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if analytics == nil { + return nil, nil + } + result := &Compute_DataLakeAnalyticsARM{} + + // Set property ‘ComputeLocation’: + if analytics.ComputeLocation != nil { + computeLocation := *analytics.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if analytics.ComputeType != nil { + result.ComputeType = *analytics.ComputeType + } + + // Set property ‘Description’: + if analytics.Description != nil { + description := *analytics.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if analytics.DisableLocalAuth != nil { + disableLocalAuth := *analytics.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if analytics.Properties != nil { + propertiesARM, err := (*analytics.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*DataLakeAnalyticsPropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if analytics.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*analytics.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (analytics *Compute_DataLakeAnalytics) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_DataLakeAnalyticsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (analytics *Compute_DataLakeAnalytics) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_DataLakeAnalyticsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_DataLakeAnalyticsARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + analytics.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + analytics.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + analytics.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + analytics.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 DataLakeAnalyticsProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + analytics.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeDataLakeAnalytics populates our Compute_DataLakeAnalytics from the provided source Compute_DataLakeAnalytics +func (analytics *Compute_DataLakeAnalytics) AssignPropertiesFromComputeDataLakeAnalytics(source *v20210701s.Compute_DataLakeAnalytics) error { + + // ComputeLocation + analytics.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeDataLakeAnalyticsComputeType(*source.ComputeType) + analytics.ComputeType = &computeType + } else { + analytics.ComputeType = nil + } + + // Description + analytics.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + analytics.DisableLocalAuth = &disableLocalAuth + } else { + analytics.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property DataLakeAnalyticsProperties + err := property.AssignPropertiesFromDataLakeAnalyticsProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromDataLakeAnalyticsProperties() to populate field Properties") + } + analytics.Properties = &property + } else { + analytics.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + analytics.ResourceReference = &resourceReference + } else { + analytics.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeDataLakeAnalytics populates the provided destination Compute_DataLakeAnalytics from our Compute_DataLakeAnalytics +func (analytics *Compute_DataLakeAnalytics) AssignPropertiesToComputeDataLakeAnalytics(destination *v20210701s.Compute_DataLakeAnalytics) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(analytics.ComputeLocation) + + // ComputeType + if analytics.ComputeType != nil { + computeType := string(*analytics.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(analytics.Description) + + // DisableLocalAuth + if analytics.DisableLocalAuth != nil { + disableLocalAuth := *analytics.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if analytics.Properties != nil { + var property v20210701s.DataLakeAnalyticsProperties + err := analytics.Properties.AssignPropertiesToDataLakeAnalyticsProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToDataLakeAnalyticsProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if analytics.ResourceReference != nil { + resourceReference := analytics.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_Databricks struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeDatabricksComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: Properties of Databricks + Properties *DatabricksProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_Databricks{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (databricks *Compute_Databricks) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if databricks == nil { + return nil, nil + } + result := &Compute_DatabricksARM{} + + // Set property ‘ComputeLocation’: + if databricks.ComputeLocation != nil { + computeLocation := *databricks.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if databricks.ComputeType != nil { + result.ComputeType = *databricks.ComputeType + } + + // Set property ‘Description’: + if databricks.Description != nil { + description := *databricks.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if databricks.DisableLocalAuth != nil { + disableLocalAuth := *databricks.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if databricks.Properties != nil { + propertiesARM, err := (*databricks.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*DatabricksPropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if databricks.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*databricks.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (databricks *Compute_Databricks) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_DatabricksARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (databricks *Compute_Databricks) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_DatabricksARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_DatabricksARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + databricks.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + databricks.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + databricks.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + databricks.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 DatabricksProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + databricks.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeDatabricks populates our Compute_Databricks from the provided source Compute_Databricks +func (databricks *Compute_Databricks) AssignPropertiesFromComputeDatabricks(source *v20210701s.Compute_Databricks) error { + + // ComputeLocation + databricks.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeDatabricksComputeType(*source.ComputeType) + databricks.ComputeType = &computeType + } else { + databricks.ComputeType = nil + } + + // Description + databricks.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + databricks.DisableLocalAuth = &disableLocalAuth + } else { + databricks.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property DatabricksProperties + err := property.AssignPropertiesFromDatabricksProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromDatabricksProperties() to populate field Properties") + } + databricks.Properties = &property + } else { + databricks.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + databricks.ResourceReference = &resourceReference + } else { + databricks.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeDatabricks populates the provided destination Compute_Databricks from our Compute_Databricks +func (databricks *Compute_Databricks) AssignPropertiesToComputeDatabricks(destination *v20210701s.Compute_Databricks) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(databricks.ComputeLocation) + + // ComputeType + if databricks.ComputeType != nil { + computeType := string(*databricks.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(databricks.Description) + + // DisableLocalAuth + if databricks.DisableLocalAuth != nil { + disableLocalAuth := *databricks.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if databricks.Properties != nil { + var property v20210701s.DatabricksProperties + err := databricks.Properties.AssignPropertiesToDatabricksProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToDatabricksProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if databricks.ResourceReference != nil { + resourceReference := databricks.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_HDInsight struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeHDInsightComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: HDInsight compute properties + Properties *HDInsightProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_HDInsight{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (insight *Compute_HDInsight) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if insight == nil { + return nil, nil + } + result := &Compute_HDInsightARM{} + + // Set property ‘ComputeLocation’: + if insight.ComputeLocation != nil { + computeLocation := *insight.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if insight.ComputeType != nil { + result.ComputeType = *insight.ComputeType + } + + // Set property ‘Description’: + if insight.Description != nil { + description := *insight.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if insight.DisableLocalAuth != nil { + disableLocalAuth := *insight.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if insight.Properties != nil { + propertiesARM, err := (*insight.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*HDInsightPropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if insight.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*insight.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (insight *Compute_HDInsight) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_HDInsightARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (insight *Compute_HDInsight) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_HDInsightARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_HDInsightARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + insight.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + insight.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + insight.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + insight.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 HDInsightProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + insight.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeHDInsight populates our Compute_HDInsight from the provided source Compute_HDInsight +func (insight *Compute_HDInsight) AssignPropertiesFromComputeHDInsight(source *v20210701s.Compute_HDInsight) error { + + // ComputeLocation + insight.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeHDInsightComputeType(*source.ComputeType) + insight.ComputeType = &computeType + } else { + insight.ComputeType = nil + } + + // Description + insight.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + insight.DisableLocalAuth = &disableLocalAuth + } else { + insight.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property HDInsightProperties + err := property.AssignPropertiesFromHDInsightProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromHDInsightProperties() to populate field Properties") + } + insight.Properties = &property + } else { + insight.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + insight.ResourceReference = &resourceReference + } else { + insight.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeHDInsight populates the provided destination Compute_HDInsight from our Compute_HDInsight +func (insight *Compute_HDInsight) AssignPropertiesToComputeHDInsight(destination *v20210701s.Compute_HDInsight) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(insight.ComputeLocation) + + // ComputeType + if insight.ComputeType != nil { + computeType := string(*insight.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(insight.Description) + + // DisableLocalAuth + if insight.DisableLocalAuth != nil { + disableLocalAuth := *insight.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if insight.Properties != nil { + var property v20210701s.HDInsightProperties + err := insight.Properties.AssignPropertiesToHDInsightProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToHDInsightProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if insight.ResourceReference != nil { + resourceReference := insight.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_SynapseSpark struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeSynapseSparkComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *SynapseSparkProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_SynapseSpark{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (spark *Compute_SynapseSpark) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if spark == nil { + return nil, nil + } + result := &Compute_SynapseSparkARM{} + + // Set property ‘ComputeLocation’: + if spark.ComputeLocation != nil { + computeLocation := *spark.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if spark.ComputeType != nil { + result.ComputeType = *spark.ComputeType + } + + // Set property ‘Description’: + if spark.Description != nil { + description := *spark.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if spark.DisableLocalAuth != nil { + disableLocalAuth := *spark.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if spark.Properties != nil { + propertiesARM, err := (*spark.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*SynapseSparkPropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if spark.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*spark.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (spark *Compute_SynapseSpark) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_SynapseSparkARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (spark *Compute_SynapseSpark) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_SynapseSparkARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_SynapseSparkARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + spark.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + spark.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + spark.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + spark.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 SynapseSparkProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + spark.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeSynapseSpark populates our Compute_SynapseSpark from the provided source Compute_SynapseSpark +func (spark *Compute_SynapseSpark) AssignPropertiesFromComputeSynapseSpark(source *v20210701s.Compute_SynapseSpark) error { + + // ComputeLocation + spark.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeSynapseSparkComputeType(*source.ComputeType) + spark.ComputeType = &computeType + } else { + spark.ComputeType = nil + } + + // Description + spark.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + spark.DisableLocalAuth = &disableLocalAuth + } else { + spark.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property SynapseSparkProperties + err := property.AssignPropertiesFromSynapseSparkProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSynapseSparkProperties() to populate field Properties") + } + spark.Properties = &property + } else { + spark.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + spark.ResourceReference = &resourceReference + } else { + spark.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeSynapseSpark populates the provided destination Compute_SynapseSpark from our Compute_SynapseSpark +func (spark *Compute_SynapseSpark) AssignPropertiesToComputeSynapseSpark(destination *v20210701s.Compute_SynapseSpark) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(spark.ComputeLocation) + + // ComputeType + if spark.ComputeType != nil { + computeType := string(*spark.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(spark.Description) + + // DisableLocalAuth + if spark.DisableLocalAuth != nil { + disableLocalAuth := *spark.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if spark.Properties != nil { + var property v20210701s.SynapseSparkProperties + err := spark.Properties.AssignPropertiesToSynapseSparkProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSynapseSparkProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if spark.ResourceReference != nil { + resourceReference := spark.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Compute_VirtualMachine struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + + // +kubebuilder:validation:Required + ComputeType *ComputeVirtualMachineComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *VirtualMachineProperties `json:"properties,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Compute_VirtualMachine{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (machine *Compute_VirtualMachine) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if machine == nil { + return nil, nil + } + result := &Compute_VirtualMachineARM{} + + // Set property ‘ComputeLocation’: + if machine.ComputeLocation != nil { + computeLocation := *machine.ComputeLocation + result.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + if machine.ComputeType != nil { + result.ComputeType = *machine.ComputeType + } + + // Set property ‘Description’: + if machine.Description != nil { + description := *machine.Description + result.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if machine.DisableLocalAuth != nil { + disableLocalAuth := *machine.DisableLocalAuth + result.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if machine.Properties != nil { + propertiesARM, err := (*machine.Properties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + properties := *propertiesARM.(*VirtualMachinePropertiesARM) + result.Properties = &properties + } + + // Set property ‘ResourceId’: + if machine.ResourceReference != nil { + resourceReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*machine.ResourceReference) + if err != nil { + return nil, err + } + resourceReference := resourceReferenceARMID + result.ResourceId = &resourceReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (machine *Compute_VirtualMachine) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Compute_VirtualMachineARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (machine *Compute_VirtualMachine) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Compute_VirtualMachineARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Compute_VirtualMachineARM, got %T", armInput) + } + + // Set property ‘ComputeLocation’: + if typedInput.ComputeLocation != nil { + computeLocation := *typedInput.ComputeLocation + machine.ComputeLocation = &computeLocation + } + + // Set property ‘ComputeType’: + machine.ComputeType = &typedInput.ComputeType + + // Set property ‘Description’: + if typedInput.Description != nil { + description := *typedInput.Description + machine.Description = &description + } + + // Set property ‘DisableLocalAuth’: + if typedInput.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.DisableLocalAuth + machine.DisableLocalAuth = &disableLocalAuth + } + + // Set property ‘Properties’: + if typedInput.Properties != nil { + var properties1 VirtualMachineProperties + err := properties1.PopulateFromARM(owner, *typedInput.Properties) + if err != nil { + return err + } + properties := properties1 + machine.Properties = &properties + } + + // no assignment for property ‘ResourceReference’ + + // No error + return nil +} + +// AssignPropertiesFromComputeVirtualMachine populates our Compute_VirtualMachine from the provided source Compute_VirtualMachine +func (machine *Compute_VirtualMachine) AssignPropertiesFromComputeVirtualMachine(source *v20210701s.Compute_VirtualMachine) error { + + // ComputeLocation + machine.ComputeLocation = genruntime.ClonePointerToString(source.ComputeLocation) + + // ComputeType + if source.ComputeType != nil { + computeType := ComputeVirtualMachineComputeType(*source.ComputeType) + machine.ComputeType = &computeType + } else { + machine.ComputeType = nil + } + + // Description + machine.Description = genruntime.ClonePointerToString(source.Description) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + machine.DisableLocalAuth = &disableLocalAuth + } else { + machine.DisableLocalAuth = nil + } + + // Properties + if source.Properties != nil { + var property VirtualMachineProperties + err := property.AssignPropertiesFromVirtualMachineProperties(source.Properties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromVirtualMachineProperties() to populate field Properties") + } + machine.Properties = &property + } else { + machine.Properties = nil + } + + // ResourceReference + if source.ResourceReference != nil { + resourceReference := source.ResourceReference.Copy() + machine.ResourceReference = &resourceReference + } else { + machine.ResourceReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeVirtualMachine populates the provided destination Compute_VirtualMachine from our Compute_VirtualMachine +func (machine *Compute_VirtualMachine) AssignPropertiesToComputeVirtualMachine(destination *v20210701s.Compute_VirtualMachine) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ComputeLocation + destination.ComputeLocation = genruntime.ClonePointerToString(machine.ComputeLocation) + + // ComputeType + if machine.ComputeType != nil { + computeType := string(*machine.ComputeType) + destination.ComputeType = &computeType + } else { + destination.ComputeType = nil + } + + // Description + destination.Description = genruntime.ClonePointerToString(machine.Description) + + // DisableLocalAuth + if machine.DisableLocalAuth != nil { + disableLocalAuth := *machine.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Properties + if machine.Properties != nil { + var property v20210701s.VirtualMachineProperties + err := machine.Properties.AssignPropertiesToVirtualMachineProperties(&property) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToVirtualMachineProperties() to populate field Properties") + } + destination.Properties = &property + } else { + destination.Properties = nil + } + + // ResourceReference + if machine.ResourceReference != nil { + resourceReference := machine.ResourceReference.Copy() + destination.ResourceReference = &resourceReference + } else { + destination.ResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type ErrorResponse_Status struct { + // Error: The error object. + Error *ErrorDetail_Status `json:"error,omitempty"` +} + +var _ genruntime.FromARMConverter = &ErrorResponse_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (response *ErrorResponse_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ErrorResponse_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (response *ErrorResponse_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ErrorResponse_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ErrorResponse_StatusARM, got %T", armInput) + } + + // Set property ‘Error’: + if typedInput.Error != nil { + var error1 ErrorDetail_Status + err := error1.PopulateFromARM(owner, *typedInput.Error) + if err != nil { + return err + } + error := error1 + response.Error = &error + } + + // No error + return nil +} + +// AssignPropertiesFromErrorResponseStatus populates our ErrorResponse_Status from the provided source ErrorResponse_Status +func (response *ErrorResponse_Status) AssignPropertiesFromErrorResponseStatus(source *v20210701s.ErrorResponse_Status) error { + + // Error + if source.Error != nil { + var error ErrorDetail_Status + err := error.AssignPropertiesFromErrorDetailStatus(source.Error) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromErrorDetailStatus() to populate field Error") + } + response.Error = &error + } else { + response.Error = nil + } + + // No error + return nil +} + +// AssignPropertiesToErrorResponseStatus populates the provided destination ErrorResponse_Status from our ErrorResponse_Status +func (response *ErrorResponse_Status) AssignPropertiesToErrorResponseStatus(destination *v20210701s.ErrorResponse_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Error + if response.Error != nil { + var error v20210701s.ErrorDetail_Status + err := response.Error.AssignPropertiesToErrorDetailStatus(&error) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToErrorDetailStatus() to populate field Error") + } + destination.Error = &error + } else { + destination.Error = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AKSProperties +type AKSProperties struct { + // +kubebuilder:validation:Minimum=0 + // AgentCount: Number of agents + AgentCount *int `json:"agentCount,omitempty"` + + // AgentVmSize: Agent virtual machine size + AgentVmSize *string `json:"agentVmSize,omitempty"` + + // AksNetworkingConfiguration: Advance configuration for AKS networking + AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` + + // ClusterFqdn: Cluster full qualified domain name + ClusterFqdn *string `json:"clusterFqdn,omitempty"` + + // ClusterPurpose: Intended usage of the cluster. + ClusterPurpose *AKSPropertiesClusterPurpose `json:"clusterPurpose,omitempty"` + + // LoadBalancerSubnet: Load Balancer Subnet + LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"` + + // LoadBalancerType: Load Balancer Type. + LoadBalancerType *AKSPropertiesLoadBalancerType `json:"loadBalancerType,omitempty"` + + // SslConfiguration: The ssl configuration for scoring + SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` +} + +var _ genruntime.ARMTransformer = &AKSProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *AKSProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &AKSPropertiesARM{} + + // Set property ‘AgentCount’: + if properties.AgentCount != nil { + agentCount := *properties.AgentCount + result.AgentCount = &agentCount + } + + // Set property ‘AgentVmSize’: + if properties.AgentVmSize != nil { + agentVmSize := *properties.AgentVmSize + result.AgentVmSize = &agentVmSize + } + + // Set property ‘AksNetworkingConfiguration’: + if properties.AksNetworkingConfiguration != nil { + aksNetworkingConfigurationARM, err := (*properties.AksNetworkingConfiguration).ConvertToARM(resolved) + if err != nil { + return nil, err + } + aksNetworkingConfiguration := *aksNetworkingConfigurationARM.(*AksNetworkingConfigurationARM) + result.AksNetworkingConfiguration = &aksNetworkingConfiguration + } + + // Set property ‘ClusterFqdn’: + if properties.ClusterFqdn != nil { + clusterFqdn := *properties.ClusterFqdn + result.ClusterFqdn = &clusterFqdn + } + + // Set property ‘ClusterPurpose’: + if properties.ClusterPurpose != nil { + clusterPurpose := *properties.ClusterPurpose + result.ClusterPurpose = &clusterPurpose + } + + // Set property ‘LoadBalancerSubnet’: + if properties.LoadBalancerSubnet != nil { + loadBalancerSubnet := *properties.LoadBalancerSubnet + result.LoadBalancerSubnet = &loadBalancerSubnet + } + + // Set property ‘LoadBalancerType’: + if properties.LoadBalancerType != nil { + loadBalancerType := *properties.LoadBalancerType + result.LoadBalancerType = &loadBalancerType + } + + // Set property ‘SslConfiguration’: + if properties.SslConfiguration != nil { + sslConfigurationARM, err := (*properties.SslConfiguration).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sslConfiguration := *sslConfigurationARM.(*SslConfigurationARM) + result.SslConfiguration = &sslConfiguration + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *AKSProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &AKSPropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *AKSProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(AKSPropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected AKSPropertiesARM, got %T", armInput) + } + + // Set property ‘AgentCount’: + if typedInput.AgentCount != nil { + agentCount := *typedInput.AgentCount + properties.AgentCount = &agentCount + } + + // Set property ‘AgentVmSize’: + if typedInput.AgentVmSize != nil { + agentVmSize := *typedInput.AgentVmSize + properties.AgentVmSize = &agentVmSize + } + + // Set property ‘AksNetworkingConfiguration’: + if typedInput.AksNetworkingConfiguration != nil { + var aksNetworkingConfiguration1 AksNetworkingConfiguration + err := aksNetworkingConfiguration1.PopulateFromARM(owner, *typedInput.AksNetworkingConfiguration) + if err != nil { + return err + } + aksNetworkingConfiguration := aksNetworkingConfiguration1 + properties.AksNetworkingConfiguration = &aksNetworkingConfiguration + } + + // Set property ‘ClusterFqdn’: + if typedInput.ClusterFqdn != nil { + clusterFqdn := *typedInput.ClusterFqdn + properties.ClusterFqdn = &clusterFqdn + } + + // Set property ‘ClusterPurpose’: + if typedInput.ClusterPurpose != nil { + clusterPurpose := *typedInput.ClusterPurpose + properties.ClusterPurpose = &clusterPurpose + } + + // Set property ‘LoadBalancerSubnet’: + if typedInput.LoadBalancerSubnet != nil { + loadBalancerSubnet := *typedInput.LoadBalancerSubnet + properties.LoadBalancerSubnet = &loadBalancerSubnet + } + + // Set property ‘LoadBalancerType’: + if typedInput.LoadBalancerType != nil { + loadBalancerType := *typedInput.LoadBalancerType + properties.LoadBalancerType = &loadBalancerType + } + + // Set property ‘SslConfiguration’: + if typedInput.SslConfiguration != nil { + var sslConfiguration1 SslConfiguration + err := sslConfiguration1.PopulateFromARM(owner, *typedInput.SslConfiguration) + if err != nil { + return err + } + sslConfiguration := sslConfiguration1 + properties.SslConfiguration = &sslConfiguration + } + + // No error + return nil +} + +// AssignPropertiesFromAKSProperties populates our AKSProperties from the provided source AKSProperties +func (properties *AKSProperties) AssignPropertiesFromAKSProperties(source *v20210701s.AKSProperties) error { + + // AgentCount + if source.AgentCount != nil { + agentCount := *source.AgentCount + properties.AgentCount = &agentCount + } else { + properties.AgentCount = nil + } + + // AgentVmSize + properties.AgentVmSize = genruntime.ClonePointerToString(source.AgentVmSize) + + // AksNetworkingConfiguration + if source.AksNetworkingConfiguration != nil { + var aksNetworkingConfiguration AksNetworkingConfiguration + err := aksNetworkingConfiguration.AssignPropertiesFromAksNetworkingConfiguration(source.AksNetworkingConfiguration) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromAksNetworkingConfiguration() to populate field AksNetworkingConfiguration") + } + properties.AksNetworkingConfiguration = &aksNetworkingConfiguration + } else { + properties.AksNetworkingConfiguration = nil + } + + // ClusterFqdn + properties.ClusterFqdn = genruntime.ClonePointerToString(source.ClusterFqdn) + + // ClusterPurpose + if source.ClusterPurpose != nil { + clusterPurpose := AKSPropertiesClusterPurpose(*source.ClusterPurpose) + properties.ClusterPurpose = &clusterPurpose + } else { + properties.ClusterPurpose = nil + } + + // LoadBalancerSubnet + properties.LoadBalancerSubnet = genruntime.ClonePointerToString(source.LoadBalancerSubnet) + + // LoadBalancerType + if source.LoadBalancerType != nil { + loadBalancerType := AKSPropertiesLoadBalancerType(*source.LoadBalancerType) + properties.LoadBalancerType = &loadBalancerType + } else { + properties.LoadBalancerType = nil + } + + // SslConfiguration + if source.SslConfiguration != nil { + var sslConfiguration SslConfiguration + err := sslConfiguration.AssignPropertiesFromSslConfiguration(source.SslConfiguration) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSslConfiguration() to populate field SslConfiguration") + } + properties.SslConfiguration = &sslConfiguration + } else { + properties.SslConfiguration = nil + } + + // No error + return nil +} + +// AssignPropertiesToAKSProperties populates the provided destination AKSProperties from our AKSProperties +func (properties *AKSProperties) AssignPropertiesToAKSProperties(destination *v20210701s.AKSProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AgentCount + if properties.AgentCount != nil { + agentCount := *properties.AgentCount + destination.AgentCount = &agentCount + } else { + destination.AgentCount = nil + } + + // AgentVmSize + destination.AgentVmSize = genruntime.ClonePointerToString(properties.AgentVmSize) + + // AksNetworkingConfiguration + if properties.AksNetworkingConfiguration != nil { + var aksNetworkingConfiguration v20210701s.AksNetworkingConfiguration + err := properties.AksNetworkingConfiguration.AssignPropertiesToAksNetworkingConfiguration(&aksNetworkingConfiguration) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToAksNetworkingConfiguration() to populate field AksNetworkingConfiguration") + } + destination.AksNetworkingConfiguration = &aksNetworkingConfiguration + } else { + destination.AksNetworkingConfiguration = nil + } + + // ClusterFqdn + destination.ClusterFqdn = genruntime.ClonePointerToString(properties.ClusterFqdn) + + // ClusterPurpose + if properties.ClusterPurpose != nil { + clusterPurpose := string(*properties.ClusterPurpose) + destination.ClusterPurpose = &clusterPurpose + } else { + destination.ClusterPurpose = nil + } + + // LoadBalancerSubnet + destination.LoadBalancerSubnet = genruntime.ClonePointerToString(properties.LoadBalancerSubnet) + + // LoadBalancerType + if properties.LoadBalancerType != nil { + loadBalancerType := string(*properties.LoadBalancerType) + destination.LoadBalancerType = &loadBalancerType + } else { + destination.LoadBalancerType = nil + } + + // SslConfiguration + if properties.SslConfiguration != nil { + var sslConfiguration v20210701s.SslConfiguration + err := properties.SslConfiguration.AssignPropertiesToSslConfiguration(&sslConfiguration) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSslConfiguration() to populate field SslConfiguration") + } + destination.SslConfiguration = &sslConfiguration + } else { + destination.SslConfiguration = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AmlComputeProperties +type AmlComputeProperties struct { + // EnableNodePublicIp: Enable or disable node public IP address provisioning. Possible values are: Possible values are: + // true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will + // have a private endpoint and no public IPs. + EnableNodePublicIp *bool `json:"enableNodePublicIp,omitempty"` + + // IsolatedNetwork: Network is isolated or not + IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"` + + // OsType: Compute OS Type. + OsType *AmlComputePropertiesOsType `json:"osType,omitempty"` + + // RemoteLoginPortPublicAccess: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh + // port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the + // cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, + // else is open all public nodes. It can be default only during cluster creation time, after creation it will be either + // enabled or disabled. + RemoteLoginPortPublicAccess *AmlComputePropertiesRemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"` + + // ScaleSettings: scale settings for AML Compute + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + + // Subnet: Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. + Subnet *ResourceId `json:"subnet,omitempty"` + + // UserAccountCredentials: Settings for user account that gets created on each on the nodes of a compute. + UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` + + // VirtualMachineImage: Virtual Machine image for Windows AML Compute + VirtualMachineImage *VirtualMachineImage `json:"virtualMachineImage,omitempty"` + + // VmPriority: Virtual Machine priority. + VmPriority *AmlComputePropertiesVmPriority `json:"vmPriority,omitempty"` + + // VmSize: Virtual Machine Size + VmSize *string `json:"vmSize,omitempty"` +} + +var _ genruntime.ARMTransformer = &AmlComputeProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *AmlComputeProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &AmlComputePropertiesARM{} + + // Set property ‘EnableNodePublicIp’: + if properties.EnableNodePublicIp != nil { + enableNodePublicIp := *properties.EnableNodePublicIp + result.EnableNodePublicIp = &enableNodePublicIp + } + + // Set property ‘IsolatedNetwork’: + if properties.IsolatedNetwork != nil { + isolatedNetwork := *properties.IsolatedNetwork + result.IsolatedNetwork = &isolatedNetwork + } + + // Set property ‘OsType’: + if properties.OsType != nil { + osType := *properties.OsType + result.OsType = &osType + } + + // Set property ‘RemoteLoginPortPublicAccess’: + if properties.RemoteLoginPortPublicAccess != nil { + remoteLoginPortPublicAccess := *properties.RemoteLoginPortPublicAccess + result.RemoteLoginPortPublicAccess = &remoteLoginPortPublicAccess + } + + // Set property ‘ScaleSettings’: + if properties.ScaleSettings != nil { + scaleSettingsARM, err := (*properties.ScaleSettings).ConvertToARM(resolved) + if err != nil { + return nil, err + } + scaleSettings := *scaleSettingsARM.(*ScaleSettingsARM) + result.ScaleSettings = &scaleSettings + } + + // Set property ‘Subnet’: + if properties.Subnet != nil { + subnetARM, err := (*properties.Subnet).ConvertToARM(resolved) + if err != nil { + return nil, err + } + subnet := *subnetARM.(*ResourceIdARM) + result.Subnet = &subnet + } + + // Set property ‘UserAccountCredentials’: + if properties.UserAccountCredentials != nil { + userAccountCredentialsARM, err := (*properties.UserAccountCredentials).ConvertToARM(resolved) + if err != nil { + return nil, err + } + userAccountCredentials := *userAccountCredentialsARM.(*UserAccountCredentialsARM) + result.UserAccountCredentials = &userAccountCredentials + } + + // Set property ‘VirtualMachineImage’: + if properties.VirtualMachineImage != nil { + virtualMachineImageARM, err := (*properties.VirtualMachineImage).ConvertToARM(resolved) + if err != nil { + return nil, err + } + virtualMachineImage := *virtualMachineImageARM.(*VirtualMachineImageARM) + result.VirtualMachineImage = &virtualMachineImage + } + + // Set property ‘VmPriority’: + if properties.VmPriority != nil { + vmPriority := *properties.VmPriority + result.VmPriority = &vmPriority + } + + // Set property ‘VmSize’: + if properties.VmSize != nil { + vmSize := *properties.VmSize + result.VmSize = &vmSize + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *AmlComputeProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &AmlComputePropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *AmlComputeProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(AmlComputePropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected AmlComputePropertiesARM, got %T", armInput) + } + + // Set property ‘EnableNodePublicIp’: + if typedInput.EnableNodePublicIp != nil { + enableNodePublicIp := *typedInput.EnableNodePublicIp + properties.EnableNodePublicIp = &enableNodePublicIp + } + + // Set property ‘IsolatedNetwork’: + if typedInput.IsolatedNetwork != nil { + isolatedNetwork := *typedInput.IsolatedNetwork + properties.IsolatedNetwork = &isolatedNetwork + } + + // Set property ‘OsType’: + if typedInput.OsType != nil { + osType := *typedInput.OsType + properties.OsType = &osType + } + + // Set property ‘RemoteLoginPortPublicAccess’: + if typedInput.RemoteLoginPortPublicAccess != nil { + remoteLoginPortPublicAccess := *typedInput.RemoteLoginPortPublicAccess + properties.RemoteLoginPortPublicAccess = &remoteLoginPortPublicAccess + } + + // Set property ‘ScaleSettings’: + if typedInput.ScaleSettings != nil { + var scaleSettings1 ScaleSettings + err := scaleSettings1.PopulateFromARM(owner, *typedInput.ScaleSettings) + if err != nil { + return err + } + scaleSettings := scaleSettings1 + properties.ScaleSettings = &scaleSettings + } + + // Set property ‘Subnet’: + if typedInput.Subnet != nil { + var subnet1 ResourceId + err := subnet1.PopulateFromARM(owner, *typedInput.Subnet) + if err != nil { + return err + } + subnet := subnet1 + properties.Subnet = &subnet + } + + // Set property ‘UserAccountCredentials’: + if typedInput.UserAccountCredentials != nil { + var userAccountCredentials1 UserAccountCredentials + err := userAccountCredentials1.PopulateFromARM(owner, *typedInput.UserAccountCredentials) + if err != nil { + return err + } + userAccountCredentials := userAccountCredentials1 + properties.UserAccountCredentials = &userAccountCredentials + } + + // Set property ‘VirtualMachineImage’: + if typedInput.VirtualMachineImage != nil { + var virtualMachineImage1 VirtualMachineImage + err := virtualMachineImage1.PopulateFromARM(owner, *typedInput.VirtualMachineImage) + if err != nil { + return err + } + virtualMachineImage := virtualMachineImage1 + properties.VirtualMachineImage = &virtualMachineImage + } + + // Set property ‘VmPriority’: + if typedInput.VmPriority != nil { + vmPriority := *typedInput.VmPriority + properties.VmPriority = &vmPriority + } + + // Set property ‘VmSize’: + if typedInput.VmSize != nil { + vmSize := *typedInput.VmSize + properties.VmSize = &vmSize + } + + // No error + return nil +} + +// AssignPropertiesFromAmlComputeProperties populates our AmlComputeProperties from the provided source AmlComputeProperties +func (properties *AmlComputeProperties) AssignPropertiesFromAmlComputeProperties(source *v20210701s.AmlComputeProperties) error { + + // EnableNodePublicIp + if source.EnableNodePublicIp != nil { + enableNodePublicIp := *source.EnableNodePublicIp + properties.EnableNodePublicIp = &enableNodePublicIp + } else { + properties.EnableNodePublicIp = nil + } + + // IsolatedNetwork + if source.IsolatedNetwork != nil { + isolatedNetwork := *source.IsolatedNetwork + properties.IsolatedNetwork = &isolatedNetwork + } else { + properties.IsolatedNetwork = nil + } + + // OsType + if source.OsType != nil { + osType := AmlComputePropertiesOsType(*source.OsType) + properties.OsType = &osType + } else { + properties.OsType = nil + } + + // RemoteLoginPortPublicAccess + if source.RemoteLoginPortPublicAccess != nil { + remoteLoginPortPublicAccess := AmlComputePropertiesRemoteLoginPortPublicAccess(*source.RemoteLoginPortPublicAccess) + properties.RemoteLoginPortPublicAccess = &remoteLoginPortPublicAccess + } else { + properties.RemoteLoginPortPublicAccess = nil + } + + // ScaleSettings + if source.ScaleSettings != nil { + var scaleSetting ScaleSettings + err := scaleSetting.AssignPropertiesFromScaleSettings(source.ScaleSettings) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromScaleSettings() to populate field ScaleSettings") + } + properties.ScaleSettings = &scaleSetting + } else { + properties.ScaleSettings = nil + } + + // Subnet + if source.Subnet != nil { + var subnet ResourceId + err := subnet.AssignPropertiesFromResourceId(source.Subnet) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromResourceId() to populate field Subnet") + } + properties.Subnet = &subnet + } else { + properties.Subnet = nil + } + + // UserAccountCredentials + if source.UserAccountCredentials != nil { + var userAccountCredential UserAccountCredentials + err := userAccountCredential.AssignPropertiesFromUserAccountCredentials(source.UserAccountCredentials) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromUserAccountCredentials() to populate field UserAccountCredentials") + } + properties.UserAccountCredentials = &userAccountCredential + } else { + properties.UserAccountCredentials = nil + } + + // VirtualMachineImage + if source.VirtualMachineImage != nil { + var virtualMachineImage VirtualMachineImage + err := virtualMachineImage.AssignPropertiesFromVirtualMachineImage(source.VirtualMachineImage) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromVirtualMachineImage() to populate field VirtualMachineImage") + } + properties.VirtualMachineImage = &virtualMachineImage + } else { + properties.VirtualMachineImage = nil + } + + // VmPriority + if source.VmPriority != nil { + vmPriority := AmlComputePropertiesVmPriority(*source.VmPriority) + properties.VmPriority = &vmPriority + } else { + properties.VmPriority = nil + } + + // VmSize + properties.VmSize = genruntime.ClonePointerToString(source.VmSize) + + // No error + return nil +} + +// AssignPropertiesToAmlComputeProperties populates the provided destination AmlComputeProperties from our AmlComputeProperties +func (properties *AmlComputeProperties) AssignPropertiesToAmlComputeProperties(destination *v20210701s.AmlComputeProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // EnableNodePublicIp + if properties.EnableNodePublicIp != nil { + enableNodePublicIp := *properties.EnableNodePublicIp + destination.EnableNodePublicIp = &enableNodePublicIp + } else { + destination.EnableNodePublicIp = nil + } + + // IsolatedNetwork + if properties.IsolatedNetwork != nil { + isolatedNetwork := *properties.IsolatedNetwork + destination.IsolatedNetwork = &isolatedNetwork + } else { + destination.IsolatedNetwork = nil + } + + // OsType + if properties.OsType != nil { + osType := string(*properties.OsType) + destination.OsType = &osType + } else { + destination.OsType = nil + } + + // RemoteLoginPortPublicAccess + if properties.RemoteLoginPortPublicAccess != nil { + remoteLoginPortPublicAccess := string(*properties.RemoteLoginPortPublicAccess) + destination.RemoteLoginPortPublicAccess = &remoteLoginPortPublicAccess + } else { + destination.RemoteLoginPortPublicAccess = nil + } + + // ScaleSettings + if properties.ScaleSettings != nil { + var scaleSetting v20210701s.ScaleSettings + err := properties.ScaleSettings.AssignPropertiesToScaleSettings(&scaleSetting) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToScaleSettings() to populate field ScaleSettings") + } + destination.ScaleSettings = &scaleSetting + } else { + destination.ScaleSettings = nil + } + + // Subnet + if properties.Subnet != nil { + var subnet v20210701s.ResourceId + err := properties.Subnet.AssignPropertiesToResourceId(&subnet) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToResourceId() to populate field Subnet") + } + destination.Subnet = &subnet + } else { + destination.Subnet = nil + } + + // UserAccountCredentials + if properties.UserAccountCredentials != nil { + var userAccountCredential v20210701s.UserAccountCredentials + err := properties.UserAccountCredentials.AssignPropertiesToUserAccountCredentials(&userAccountCredential) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToUserAccountCredentials() to populate field UserAccountCredentials") + } + destination.UserAccountCredentials = &userAccountCredential + } else { + destination.UserAccountCredentials = nil + } + + // VirtualMachineImage + if properties.VirtualMachineImage != nil { + var virtualMachineImage v20210701s.VirtualMachineImage + err := properties.VirtualMachineImage.AssignPropertiesToVirtualMachineImage(&virtualMachineImage) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToVirtualMachineImage() to populate field VirtualMachineImage") + } + destination.VirtualMachineImage = &virtualMachineImage + } else { + destination.VirtualMachineImage = nil + } + + // VmPriority + if properties.VmPriority != nil { + vmPriority := string(*properties.VmPriority) + destination.VmPriority = &vmPriority + } else { + destination.VmPriority = nil + } + + // VmSize + destination.VmSize = genruntime.ClonePointerToString(properties.VmSize) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceProperties +type ComputeInstanceProperties struct { + // ApplicationSharingPolicy: Policy for sharing applications on this compute instance among users of parent workspace. If + // Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access + // applications on this instance depending on his/her assigned role. + ApplicationSharingPolicy *ComputeInstancePropertiesApplicationSharingPolicy `json:"applicationSharingPolicy,omitempty"` + + // ComputeInstanceAuthorizationType: The Compute Instance Authorization type. Available values are personal (default). + ComputeInstanceAuthorizationType *ComputeInstancePropertiesComputeInstanceAuthorizationType `json:"computeInstanceAuthorizationType,omitempty"` + + // PersonalComputeInstanceSettings: Settings for a personal compute instance. + PersonalComputeInstanceSettings *PersonalComputeInstanceSettings `json:"personalComputeInstanceSettings,omitempty"` + + // SetupScripts: Details of customized scripts to execute for setting up the cluster. + SetupScripts *SetupScripts `json:"setupScripts,omitempty"` + + // SshSettings: Specifies policy and settings for SSH access. + SshSettings *ComputeInstanceSshSettings `json:"sshSettings,omitempty"` + + // Subnet: Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. + Subnet *ResourceId `json:"subnet,omitempty"` + + // VmSize: Virtual Machine Size + VmSize *string `json:"vmSize,omitempty"` +} + +var _ genruntime.ARMTransformer = &ComputeInstanceProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *ComputeInstanceProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &ComputeInstancePropertiesARM{} + + // Set property ‘ApplicationSharingPolicy’: + if properties.ApplicationSharingPolicy != nil { + applicationSharingPolicy := *properties.ApplicationSharingPolicy + result.ApplicationSharingPolicy = &applicationSharingPolicy + } + + // Set property ‘ComputeInstanceAuthorizationType’: + if properties.ComputeInstanceAuthorizationType != nil { + computeInstanceAuthorizationType := *properties.ComputeInstanceAuthorizationType + result.ComputeInstanceAuthorizationType = &computeInstanceAuthorizationType + } + + // Set property ‘PersonalComputeInstanceSettings’: + if properties.PersonalComputeInstanceSettings != nil { + personalComputeInstanceSettingsARM, err := (*properties.PersonalComputeInstanceSettings).ConvertToARM(resolved) + if err != nil { + return nil, err + } + personalComputeInstanceSettings := *personalComputeInstanceSettingsARM.(*PersonalComputeInstanceSettingsARM) + result.PersonalComputeInstanceSettings = &personalComputeInstanceSettings + } + + // Set property ‘SetupScripts’: + if properties.SetupScripts != nil { + setupScriptsARM, err := (*properties.SetupScripts).ConvertToARM(resolved) + if err != nil { + return nil, err + } + setupScripts := *setupScriptsARM.(*SetupScriptsARM) + result.SetupScripts = &setupScripts + } + + // Set property ‘SshSettings’: + if properties.SshSettings != nil { + sshSettingsARM, err := (*properties.SshSettings).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sshSettings := *sshSettingsARM.(*ComputeInstanceSshSettingsARM) + result.SshSettings = &sshSettings + } + + // Set property ‘Subnet’: + if properties.Subnet != nil { + subnetARM, err := (*properties.Subnet).ConvertToARM(resolved) + if err != nil { + return nil, err + } + subnet := *subnetARM.(*ResourceIdARM) + result.Subnet = &subnet + } + + // Set property ‘VmSize’: + if properties.VmSize != nil { + vmSize := *properties.VmSize + result.VmSize = &vmSize + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *ComputeInstanceProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ComputeInstancePropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *ComputeInstanceProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ComputeInstancePropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ComputeInstancePropertiesARM, got %T", armInput) + } + + // Set property ‘ApplicationSharingPolicy’: + if typedInput.ApplicationSharingPolicy != nil { + applicationSharingPolicy := *typedInput.ApplicationSharingPolicy + properties.ApplicationSharingPolicy = &applicationSharingPolicy + } + + // Set property ‘ComputeInstanceAuthorizationType’: + if typedInput.ComputeInstanceAuthorizationType != nil { + computeInstanceAuthorizationType := *typedInput.ComputeInstanceAuthorizationType + properties.ComputeInstanceAuthorizationType = &computeInstanceAuthorizationType + } + + // Set property ‘PersonalComputeInstanceSettings’: + if typedInput.PersonalComputeInstanceSettings != nil { + var personalComputeInstanceSettings1 PersonalComputeInstanceSettings + err := personalComputeInstanceSettings1.PopulateFromARM(owner, *typedInput.PersonalComputeInstanceSettings) + if err != nil { + return err + } + personalComputeInstanceSettings := personalComputeInstanceSettings1 + properties.PersonalComputeInstanceSettings = &personalComputeInstanceSettings + } + + // Set property ‘SetupScripts’: + if typedInput.SetupScripts != nil { + var setupScripts1 SetupScripts + err := setupScripts1.PopulateFromARM(owner, *typedInput.SetupScripts) + if err != nil { + return err + } + setupScripts := setupScripts1 + properties.SetupScripts = &setupScripts + } + + // Set property ‘SshSettings’: + if typedInput.SshSettings != nil { + var sshSettings1 ComputeInstanceSshSettings + err := sshSettings1.PopulateFromARM(owner, *typedInput.SshSettings) + if err != nil { + return err + } + sshSettings := sshSettings1 + properties.SshSettings = &sshSettings + } + + // Set property ‘Subnet’: + if typedInput.Subnet != nil { + var subnet1 ResourceId + err := subnet1.PopulateFromARM(owner, *typedInput.Subnet) + if err != nil { + return err + } + subnet := subnet1 + properties.Subnet = &subnet + } + + // Set property ‘VmSize’: + if typedInput.VmSize != nil { + vmSize := *typedInput.VmSize + properties.VmSize = &vmSize + } + + // No error + return nil +} + +// AssignPropertiesFromComputeInstanceProperties populates our ComputeInstanceProperties from the provided source ComputeInstanceProperties +func (properties *ComputeInstanceProperties) AssignPropertiesFromComputeInstanceProperties(source *v20210701s.ComputeInstanceProperties) error { + + // ApplicationSharingPolicy + if source.ApplicationSharingPolicy != nil { + applicationSharingPolicy := ComputeInstancePropertiesApplicationSharingPolicy(*source.ApplicationSharingPolicy) + properties.ApplicationSharingPolicy = &applicationSharingPolicy + } else { + properties.ApplicationSharingPolicy = nil + } + + // ComputeInstanceAuthorizationType + if source.ComputeInstanceAuthorizationType != nil { + computeInstanceAuthorizationType := ComputeInstancePropertiesComputeInstanceAuthorizationType(*source.ComputeInstanceAuthorizationType) + properties.ComputeInstanceAuthorizationType = &computeInstanceAuthorizationType + } else { + properties.ComputeInstanceAuthorizationType = nil + } + + // PersonalComputeInstanceSettings + if source.PersonalComputeInstanceSettings != nil { + var personalComputeInstanceSetting PersonalComputeInstanceSettings + err := personalComputeInstanceSetting.AssignPropertiesFromPersonalComputeInstanceSettings(source.PersonalComputeInstanceSettings) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromPersonalComputeInstanceSettings() to populate field PersonalComputeInstanceSettings") + } + properties.PersonalComputeInstanceSettings = &personalComputeInstanceSetting + } else { + properties.PersonalComputeInstanceSettings = nil + } + + // SetupScripts + if source.SetupScripts != nil { + var setupScript SetupScripts + err := setupScript.AssignPropertiesFromSetupScripts(source.SetupScripts) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromSetupScripts() to populate field SetupScripts") + } + properties.SetupScripts = &setupScript + } else { + properties.SetupScripts = nil + } + + // SshSettings + if source.SshSettings != nil { + var sshSetting ComputeInstanceSshSettings + err := sshSetting.AssignPropertiesFromComputeInstanceSshSettings(source.SshSettings) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromComputeInstanceSshSettings() to populate field SshSettings") + } + properties.SshSettings = &sshSetting + } else { + properties.SshSettings = nil + } + + // Subnet + if source.Subnet != nil { + var subnet ResourceId + err := subnet.AssignPropertiesFromResourceId(source.Subnet) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromResourceId() to populate field Subnet") + } + properties.Subnet = &subnet + } else { + properties.Subnet = nil + } + + // VmSize + properties.VmSize = genruntime.ClonePointerToString(source.VmSize) + + // No error + return nil +} + +// AssignPropertiesToComputeInstanceProperties populates the provided destination ComputeInstanceProperties from our ComputeInstanceProperties +func (properties *ComputeInstanceProperties) AssignPropertiesToComputeInstanceProperties(destination *v20210701s.ComputeInstanceProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ApplicationSharingPolicy + if properties.ApplicationSharingPolicy != nil { + applicationSharingPolicy := string(*properties.ApplicationSharingPolicy) + destination.ApplicationSharingPolicy = &applicationSharingPolicy + } else { + destination.ApplicationSharingPolicy = nil + } + + // ComputeInstanceAuthorizationType + if properties.ComputeInstanceAuthorizationType != nil { + computeInstanceAuthorizationType := string(*properties.ComputeInstanceAuthorizationType) + destination.ComputeInstanceAuthorizationType = &computeInstanceAuthorizationType + } else { + destination.ComputeInstanceAuthorizationType = nil + } + + // PersonalComputeInstanceSettings + if properties.PersonalComputeInstanceSettings != nil { + var personalComputeInstanceSetting v20210701s.PersonalComputeInstanceSettings + err := properties.PersonalComputeInstanceSettings.AssignPropertiesToPersonalComputeInstanceSettings(&personalComputeInstanceSetting) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToPersonalComputeInstanceSettings() to populate field PersonalComputeInstanceSettings") + } + destination.PersonalComputeInstanceSettings = &personalComputeInstanceSetting + } else { + destination.PersonalComputeInstanceSettings = nil + } + + // SetupScripts + if properties.SetupScripts != nil { + var setupScript v20210701s.SetupScripts + err := properties.SetupScripts.AssignPropertiesToSetupScripts(&setupScript) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToSetupScripts() to populate field SetupScripts") + } + destination.SetupScripts = &setupScript + } else { + destination.SetupScripts = nil + } + + // SshSettings + if properties.SshSettings != nil { + var sshSetting v20210701s.ComputeInstanceSshSettings + err := properties.SshSettings.AssignPropertiesToComputeInstanceSshSettings(&sshSetting) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToComputeInstanceSshSettings() to populate field SshSettings") + } + destination.SshSettings = &sshSetting + } else { + destination.SshSettings = nil + } + + // Subnet + if properties.Subnet != nil { + var subnet v20210701s.ResourceId + err := properties.Subnet.AssignPropertiesToResourceId(&subnet) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToResourceId() to populate field Subnet") + } + destination.Subnet = &subnet + } else { + destination.Subnet = nil + } + + // VmSize + destination.VmSize = genruntime.ClonePointerToString(properties.VmSize) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DataLakeAnalyticsProperties +type DataLakeAnalyticsProperties struct { + // DataLakeStoreAccountName: DataLake Store Account Name + DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` +} + +var _ genruntime.ARMTransformer = &DataLakeAnalyticsProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *DataLakeAnalyticsProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &DataLakeAnalyticsPropertiesARM{} + + // Set property ‘DataLakeStoreAccountName’: + if properties.DataLakeStoreAccountName != nil { + dataLakeStoreAccountName := *properties.DataLakeStoreAccountName + result.DataLakeStoreAccountName = &dataLakeStoreAccountName + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *DataLakeAnalyticsProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &DataLakeAnalyticsPropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *DataLakeAnalyticsProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(DataLakeAnalyticsPropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected DataLakeAnalyticsPropertiesARM, got %T", armInput) + } + + // Set property ‘DataLakeStoreAccountName’: + if typedInput.DataLakeStoreAccountName != nil { + dataLakeStoreAccountName := *typedInput.DataLakeStoreAccountName + properties.DataLakeStoreAccountName = &dataLakeStoreAccountName + } + + // No error + return nil +} + +// AssignPropertiesFromDataLakeAnalyticsProperties populates our DataLakeAnalyticsProperties from the provided source DataLakeAnalyticsProperties +func (properties *DataLakeAnalyticsProperties) AssignPropertiesFromDataLakeAnalyticsProperties(source *v20210701s.DataLakeAnalyticsProperties) error { + + // DataLakeStoreAccountName + properties.DataLakeStoreAccountName = genruntime.ClonePointerToString(source.DataLakeStoreAccountName) + + // No error + return nil +} + +// AssignPropertiesToDataLakeAnalyticsProperties populates the provided destination DataLakeAnalyticsProperties from our DataLakeAnalyticsProperties +func (properties *DataLakeAnalyticsProperties) AssignPropertiesToDataLakeAnalyticsProperties(destination *v20210701s.DataLakeAnalyticsProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // DataLakeStoreAccountName + destination.DataLakeStoreAccountName = genruntime.ClonePointerToString(properties.DataLakeStoreAccountName) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DatabricksProperties +type DatabricksProperties struct { + // DatabricksAccessToken: Databricks access token + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + + // WorkspaceUrl: Workspace Url + WorkspaceUrl *string `json:"workspaceUrl,omitempty"` +} + +var _ genruntime.ARMTransformer = &DatabricksProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *DatabricksProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &DatabricksPropertiesARM{} + + // Set property ‘DatabricksAccessToken’: + if properties.DatabricksAccessToken != nil { + databricksAccessToken := *properties.DatabricksAccessToken + result.DatabricksAccessToken = &databricksAccessToken + } + + // Set property ‘WorkspaceUrl’: + if properties.WorkspaceUrl != nil { + workspaceUrl := *properties.WorkspaceUrl + result.WorkspaceUrl = &workspaceUrl + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *DatabricksProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &DatabricksPropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *DatabricksProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(DatabricksPropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected DatabricksPropertiesARM, got %T", armInput) + } + + // Set property ‘DatabricksAccessToken’: + if typedInput.DatabricksAccessToken != nil { + databricksAccessToken := *typedInput.DatabricksAccessToken + properties.DatabricksAccessToken = &databricksAccessToken + } + + // Set property ‘WorkspaceUrl’: + if typedInput.WorkspaceUrl != nil { + workspaceUrl := *typedInput.WorkspaceUrl + properties.WorkspaceUrl = &workspaceUrl + } + + // No error + return nil +} + +// AssignPropertiesFromDatabricksProperties populates our DatabricksProperties from the provided source DatabricksProperties +func (properties *DatabricksProperties) AssignPropertiesFromDatabricksProperties(source *v20210701s.DatabricksProperties) error { + + // DatabricksAccessToken + properties.DatabricksAccessToken = genruntime.ClonePointerToString(source.DatabricksAccessToken) + + // WorkspaceUrl + properties.WorkspaceUrl = genruntime.ClonePointerToString(source.WorkspaceUrl) + + // No error + return nil +} + +// AssignPropertiesToDatabricksProperties populates the provided destination DatabricksProperties from our DatabricksProperties +func (properties *DatabricksProperties) AssignPropertiesToDatabricksProperties(destination *v20210701s.DatabricksProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // DatabricksAccessToken + destination.DatabricksAccessToken = genruntime.ClonePointerToString(properties.DatabricksAccessToken) + + // WorkspaceUrl + destination.WorkspaceUrl = genruntime.ClonePointerToString(properties.WorkspaceUrl) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type ErrorDetail_Status struct { + // AdditionalInfo: The error additional info. + AdditionalInfo []ErrorAdditionalInfo_Status `json:"additionalInfo,omitempty"` + + // Code: The error code. + Code *string `json:"code,omitempty"` + + // Details: The error details. + Details []ErrorDetail_Status_Unrolled `json:"details,omitempty"` + + // Message: The error message. + Message *string `json:"message,omitempty"` + + // Target: The error target. + Target *string `json:"target,omitempty"` +} + +var _ genruntime.FromARMConverter = &ErrorDetail_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (detail *ErrorDetail_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ErrorDetail_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (detail *ErrorDetail_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ErrorDetail_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ErrorDetail_StatusARM, got %T", armInput) + } + + // Set property ‘AdditionalInfo’: + for _, item := range typedInput.AdditionalInfo { + var item1 ErrorAdditionalInfo_Status + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + detail.AdditionalInfo = append(detail.AdditionalInfo, item1) + } + + // Set property ‘Code’: + if typedInput.Code != nil { + code := *typedInput.Code + detail.Code = &code + } + + // Set property ‘Details’: + for _, item := range typedInput.Details { + var item1 ErrorDetail_Status_Unrolled + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + detail.Details = append(detail.Details, item1) + } + + // Set property ‘Message’: + if typedInput.Message != nil { + message := *typedInput.Message + detail.Message = &message + } + + // Set property ‘Target’: + if typedInput.Target != nil { + target := *typedInput.Target + detail.Target = &target + } + + // No error + return nil +} + +// AssignPropertiesFromErrorDetailStatus populates our ErrorDetail_Status from the provided source ErrorDetail_Status +func (detail *ErrorDetail_Status) AssignPropertiesFromErrorDetailStatus(source *v20210701s.ErrorDetail_Status) error { + + // AdditionalInfo + if source.AdditionalInfo != nil { + additionalInfoList := make([]ErrorAdditionalInfo_Status, len(source.AdditionalInfo)) + for additionalInfoIndex, additionalInfoItem := range source.AdditionalInfo { + // Shadow the loop variable to avoid aliasing + additionalInfoItem := additionalInfoItem + var additionalInfo ErrorAdditionalInfo_Status + err := additionalInfo.AssignPropertiesFromErrorAdditionalInfoStatus(&additionalInfoItem) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromErrorAdditionalInfoStatus() to populate field AdditionalInfo") + } + additionalInfoList[additionalInfoIndex] = additionalInfo + } + detail.AdditionalInfo = additionalInfoList + } else { + detail.AdditionalInfo = nil + } + + // Code + detail.Code = genruntime.ClonePointerToString(source.Code) + + // Details + if source.Details != nil { + detailList := make([]ErrorDetail_Status_Unrolled, len(source.Details)) + for detailIndex, detailItem := range source.Details { + // Shadow the loop variable to avoid aliasing + detailItem := detailItem + var detailLocal ErrorDetail_Status_Unrolled + err := detailLocal.AssignPropertiesFromErrorDetailStatusUnrolled(&detailItem) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromErrorDetailStatusUnrolled() to populate field Details") + } + detailList[detailIndex] = detailLocal + } + detail.Details = detailList + } else { + detail.Details = nil + } + + // Message + detail.Message = genruntime.ClonePointerToString(source.Message) + + // Target + detail.Target = genruntime.ClonePointerToString(source.Target) + + // No error + return nil +} + +// AssignPropertiesToErrorDetailStatus populates the provided destination ErrorDetail_Status from our ErrorDetail_Status +func (detail *ErrorDetail_Status) AssignPropertiesToErrorDetailStatus(destination *v20210701s.ErrorDetail_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AdditionalInfo + if detail.AdditionalInfo != nil { + additionalInfoList := make([]v20210701s.ErrorAdditionalInfo_Status, len(detail.AdditionalInfo)) + for additionalInfoIndex, additionalInfoItem := range detail.AdditionalInfo { + // Shadow the loop variable to avoid aliasing + additionalInfoItem := additionalInfoItem + var additionalInfo v20210701s.ErrorAdditionalInfo_Status + err := additionalInfoItem.AssignPropertiesToErrorAdditionalInfoStatus(&additionalInfo) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToErrorAdditionalInfoStatus() to populate field AdditionalInfo") + } + additionalInfoList[additionalInfoIndex] = additionalInfo + } + destination.AdditionalInfo = additionalInfoList + } else { + destination.AdditionalInfo = nil + } + + // Code + destination.Code = genruntime.ClonePointerToString(detail.Code) + + // Details + if detail.Details != nil { + detailList := make([]v20210701s.ErrorDetail_Status_Unrolled, len(detail.Details)) + for detailIndex, detailItem := range detail.Details { + // Shadow the loop variable to avoid aliasing + detailItem := detailItem + var detailLocal v20210701s.ErrorDetail_Status_Unrolled + err := detailItem.AssignPropertiesToErrorDetailStatusUnrolled(&detailLocal) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToErrorDetailStatusUnrolled() to populate field Details") + } + detailList[detailIndex] = detailLocal + } + destination.Details = detailList + } else { + destination.Details = nil + } + + // Message + destination.Message = genruntime.ClonePointerToString(detail.Message) + + // Target + destination.Target = genruntime.ClonePointerToString(detail.Target) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/HDInsightProperties +type HDInsightProperties struct { + // Address: Public IP address of the master node of the cluster. + Address *string `json:"address,omitempty"` + + // AdministratorAccount: Admin credentials for virtual machine + AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"` + + // SshPort: Port open for ssh connections on the master node of the cluster. + SshPort *int `json:"sshPort,omitempty"` +} + +var _ genruntime.ARMTransformer = &HDInsightProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *HDInsightProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &HDInsightPropertiesARM{} + + // Set property ‘Address’: + if properties.Address != nil { + address := *properties.Address + result.Address = &address + } + + // Set property ‘AdministratorAccount’: + if properties.AdministratorAccount != nil { + administratorAccountARM, err := (*properties.AdministratorAccount).ConvertToARM(resolved) + if err != nil { + return nil, err + } + administratorAccount := *administratorAccountARM.(*VirtualMachineSshCredentialsARM) + result.AdministratorAccount = &administratorAccount + } + + // Set property ‘SshPort’: + if properties.SshPort != nil { + sshPort := *properties.SshPort + result.SshPort = &sshPort + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *HDInsightProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &HDInsightPropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *HDInsightProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(HDInsightPropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected HDInsightPropertiesARM, got %T", armInput) + } + + // Set property ‘Address’: + if typedInput.Address != nil { + address := *typedInput.Address + properties.Address = &address + } + + // Set property ‘AdministratorAccount’: + if typedInput.AdministratorAccount != nil { + var administratorAccount1 VirtualMachineSshCredentials + err := administratorAccount1.PopulateFromARM(owner, *typedInput.AdministratorAccount) + if err != nil { + return err + } + administratorAccount := administratorAccount1 + properties.AdministratorAccount = &administratorAccount + } + + // Set property ‘SshPort’: + if typedInput.SshPort != nil { + sshPort := *typedInput.SshPort + properties.SshPort = &sshPort + } + + // No error + return nil +} + +// AssignPropertiesFromHDInsightProperties populates our HDInsightProperties from the provided source HDInsightProperties +func (properties *HDInsightProperties) AssignPropertiesFromHDInsightProperties(source *v20210701s.HDInsightProperties) error { + + // Address + properties.Address = genruntime.ClonePointerToString(source.Address) + + // AdministratorAccount + if source.AdministratorAccount != nil { + var administratorAccount VirtualMachineSshCredentials + err := administratorAccount.AssignPropertiesFromVirtualMachineSshCredentials(source.AdministratorAccount) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromVirtualMachineSshCredentials() to populate field AdministratorAccount") + } + properties.AdministratorAccount = &administratorAccount + } else { + properties.AdministratorAccount = nil + } + + // SshPort + properties.SshPort = genruntime.ClonePointerToInt(source.SshPort) + + // No error + return nil +} + +// AssignPropertiesToHDInsightProperties populates the provided destination HDInsightProperties from our HDInsightProperties +func (properties *HDInsightProperties) AssignPropertiesToHDInsightProperties(destination *v20210701s.HDInsightProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Address + destination.Address = genruntime.ClonePointerToString(properties.Address) + + // AdministratorAccount + if properties.AdministratorAccount != nil { + var administratorAccount v20210701s.VirtualMachineSshCredentials + err := properties.AdministratorAccount.AssignPropertiesToVirtualMachineSshCredentials(&administratorAccount) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToVirtualMachineSshCredentials() to populate field AdministratorAccount") + } + destination.AdministratorAccount = &administratorAccount + } else { + destination.AdministratorAccount = nil + } + + // SshPort + destination.SshPort = genruntime.ClonePointerToInt(properties.SshPort) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SynapseSparkProperties +type SynapseSparkProperties struct { + // AutoPauseProperties: Auto pause properties + AutoPauseProperties *AutoPauseProperties `json:"autoPauseProperties,omitempty"` + + // AutoScaleProperties: Auto scale properties + AutoScaleProperties *AutoScaleProperties `json:"autoScaleProperties,omitempty"` + + // NodeCount: The number of compute nodes currently assigned to the compute. + NodeCount *int `json:"nodeCount,omitempty"` + + // NodeSize: Node size. + NodeSize *string `json:"nodeSize,omitempty"` + + // NodeSizeFamily: Node size family. + NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"` + + // PoolName: Pool name. + PoolName *string `json:"poolName,omitempty"` + + // ResourceGroup: Name of the resource group in which workspace is located. + ResourceGroup *string `json:"resourceGroup,omitempty"` + + // SparkVersion: Spark version. + SparkVersion *string `json:"sparkVersion,omitempty"` + + // SubscriptionId: Azure subscription identifier. + SubscriptionId *string `json:"subscriptionId,omitempty"` + + // WorkspaceName: Name of Azure Machine Learning workspace. + WorkspaceName *string `json:"workspaceName,omitempty"` +} + +var _ genruntime.ARMTransformer = &SynapseSparkProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *SynapseSparkProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &SynapseSparkPropertiesARM{} + + // Set property ‘AutoPauseProperties’: + if properties.AutoPauseProperties != nil { + autoPausePropertiesARM, err := (*properties.AutoPauseProperties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + autoPauseProperties := *autoPausePropertiesARM.(*AutoPausePropertiesARM) + result.AutoPauseProperties = &autoPauseProperties + } + + // Set property ‘AutoScaleProperties’: + if properties.AutoScaleProperties != nil { + autoScalePropertiesARM, err := (*properties.AutoScaleProperties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + autoScaleProperties := *autoScalePropertiesARM.(*AutoScalePropertiesARM) + result.AutoScaleProperties = &autoScaleProperties + } + + // Set property ‘NodeCount’: + if properties.NodeCount != nil { + nodeCount := *properties.NodeCount + result.NodeCount = &nodeCount + } + + // Set property ‘NodeSize’: + if properties.NodeSize != nil { + nodeSize := *properties.NodeSize + result.NodeSize = &nodeSize + } + + // Set property ‘NodeSizeFamily’: + if properties.NodeSizeFamily != nil { + nodeSizeFamily := *properties.NodeSizeFamily + result.NodeSizeFamily = &nodeSizeFamily + } + + // Set property ‘PoolName’: + if properties.PoolName != nil { + poolName := *properties.PoolName + result.PoolName = &poolName + } + + // Set property ‘ResourceGroup’: + if properties.ResourceGroup != nil { + resourceGroup := *properties.ResourceGroup + result.ResourceGroup = &resourceGroup + } + + // Set property ‘SparkVersion’: + if properties.SparkVersion != nil { + sparkVersion := *properties.SparkVersion + result.SparkVersion = &sparkVersion + } + + // Set property ‘SubscriptionId’: + if properties.SubscriptionId != nil { + subscriptionId := *properties.SubscriptionId + result.SubscriptionId = &subscriptionId + } + + // Set property ‘WorkspaceName’: + if properties.WorkspaceName != nil { + workspaceName := *properties.WorkspaceName + result.WorkspaceName = &workspaceName + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *SynapseSparkProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SynapseSparkPropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *SynapseSparkProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SynapseSparkPropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SynapseSparkPropertiesARM, got %T", armInput) + } + + // Set property ‘AutoPauseProperties’: + if typedInput.AutoPauseProperties != nil { + var autoPauseProperties1 AutoPauseProperties + err := autoPauseProperties1.PopulateFromARM(owner, *typedInput.AutoPauseProperties) + if err != nil { + return err + } + autoPauseProperties := autoPauseProperties1 + properties.AutoPauseProperties = &autoPauseProperties + } + + // Set property ‘AutoScaleProperties’: + if typedInput.AutoScaleProperties != nil { + var autoScaleProperties1 AutoScaleProperties + err := autoScaleProperties1.PopulateFromARM(owner, *typedInput.AutoScaleProperties) + if err != nil { + return err + } + autoScaleProperties := autoScaleProperties1 + properties.AutoScaleProperties = &autoScaleProperties + } + + // Set property ‘NodeCount’: + if typedInput.NodeCount != nil { + nodeCount := *typedInput.NodeCount + properties.NodeCount = &nodeCount + } + + // Set property ‘NodeSize’: + if typedInput.NodeSize != nil { + nodeSize := *typedInput.NodeSize + properties.NodeSize = &nodeSize + } + + // Set property ‘NodeSizeFamily’: + if typedInput.NodeSizeFamily != nil { + nodeSizeFamily := *typedInput.NodeSizeFamily + properties.NodeSizeFamily = &nodeSizeFamily + } + + // Set property ‘PoolName’: + if typedInput.PoolName != nil { + poolName := *typedInput.PoolName + properties.PoolName = &poolName + } + + // Set property ‘ResourceGroup’: + if typedInput.ResourceGroup != nil { + resourceGroup := *typedInput.ResourceGroup + properties.ResourceGroup = &resourceGroup + } + + // Set property ‘SparkVersion’: + if typedInput.SparkVersion != nil { + sparkVersion := *typedInput.SparkVersion + properties.SparkVersion = &sparkVersion + } + + // Set property ‘SubscriptionId’: + if typedInput.SubscriptionId != nil { + subscriptionId := *typedInput.SubscriptionId + properties.SubscriptionId = &subscriptionId + } + + // Set property ‘WorkspaceName’: + if typedInput.WorkspaceName != nil { + workspaceName := *typedInput.WorkspaceName + properties.WorkspaceName = &workspaceName + } + + // No error + return nil +} + +// AssignPropertiesFromSynapseSparkProperties populates our SynapseSparkProperties from the provided source SynapseSparkProperties +func (properties *SynapseSparkProperties) AssignPropertiesFromSynapseSparkProperties(source *v20210701s.SynapseSparkProperties) error { + + // AutoPauseProperties + if source.AutoPauseProperties != nil { + var autoPauseProperty AutoPauseProperties + err := autoPauseProperty.AssignPropertiesFromAutoPauseProperties(source.AutoPauseProperties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromAutoPauseProperties() to populate field AutoPauseProperties") + } + properties.AutoPauseProperties = &autoPauseProperty + } else { + properties.AutoPauseProperties = nil + } + + // AutoScaleProperties + if source.AutoScaleProperties != nil { + var autoScaleProperty AutoScaleProperties + err := autoScaleProperty.AssignPropertiesFromAutoScaleProperties(source.AutoScaleProperties) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromAutoScaleProperties() to populate field AutoScaleProperties") + } + properties.AutoScaleProperties = &autoScaleProperty + } else { + properties.AutoScaleProperties = nil + } + + // NodeCount + properties.NodeCount = genruntime.ClonePointerToInt(source.NodeCount) + + // NodeSize + properties.NodeSize = genruntime.ClonePointerToString(source.NodeSize) + + // NodeSizeFamily + properties.NodeSizeFamily = genruntime.ClonePointerToString(source.NodeSizeFamily) + + // PoolName + properties.PoolName = genruntime.ClonePointerToString(source.PoolName) + + // ResourceGroup + properties.ResourceGroup = genruntime.ClonePointerToString(source.ResourceGroup) + + // SparkVersion + properties.SparkVersion = genruntime.ClonePointerToString(source.SparkVersion) + + // SubscriptionId + properties.SubscriptionId = genruntime.ClonePointerToString(source.SubscriptionId) + + // WorkspaceName + properties.WorkspaceName = genruntime.ClonePointerToString(source.WorkspaceName) + + // No error + return nil +} + +// AssignPropertiesToSynapseSparkProperties populates the provided destination SynapseSparkProperties from our SynapseSparkProperties +func (properties *SynapseSparkProperties) AssignPropertiesToSynapseSparkProperties(destination *v20210701s.SynapseSparkProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoPauseProperties + if properties.AutoPauseProperties != nil { + var autoPauseProperty v20210701s.AutoPauseProperties + err := properties.AutoPauseProperties.AssignPropertiesToAutoPauseProperties(&autoPauseProperty) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToAutoPauseProperties() to populate field AutoPauseProperties") + } + destination.AutoPauseProperties = &autoPauseProperty + } else { + destination.AutoPauseProperties = nil + } + + // AutoScaleProperties + if properties.AutoScaleProperties != nil { + var autoScaleProperty v20210701s.AutoScaleProperties + err := properties.AutoScaleProperties.AssignPropertiesToAutoScaleProperties(&autoScaleProperty) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToAutoScaleProperties() to populate field AutoScaleProperties") + } + destination.AutoScaleProperties = &autoScaleProperty + } else { + destination.AutoScaleProperties = nil + } + + // NodeCount + destination.NodeCount = genruntime.ClonePointerToInt(properties.NodeCount) + + // NodeSize + destination.NodeSize = genruntime.ClonePointerToString(properties.NodeSize) + + // NodeSizeFamily + destination.NodeSizeFamily = genruntime.ClonePointerToString(properties.NodeSizeFamily) + + // PoolName + destination.PoolName = genruntime.ClonePointerToString(properties.PoolName) + + // ResourceGroup + destination.ResourceGroup = genruntime.ClonePointerToString(properties.ResourceGroup) + + // SparkVersion + destination.SparkVersion = genruntime.ClonePointerToString(properties.SparkVersion) + + // SubscriptionId + destination.SubscriptionId = genruntime.ClonePointerToString(properties.SubscriptionId) + + // WorkspaceName + destination.WorkspaceName = genruntime.ClonePointerToString(properties.WorkspaceName) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineProperties +type VirtualMachineProperties struct { + // Address: Public IP address of the virtual machine. + Address *string `json:"address,omitempty"` + + // AdministratorAccount: Admin credentials for virtual machine + AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"` + + // IsNotebookInstanceCompute: Indicates whether this compute will be used for running notebooks. + IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"` + + // SshPort: Port open for ssh connections. + SshPort *int `json:"sshPort,omitempty"` + + // VirtualMachineSize: Virtual Machine size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` +} + +var _ genruntime.ARMTransformer = &VirtualMachineProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *VirtualMachineProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &VirtualMachinePropertiesARM{} + + // Set property ‘Address’: + if properties.Address != nil { + address := *properties.Address + result.Address = &address + } + + // Set property ‘AdministratorAccount’: + if properties.AdministratorAccount != nil { + administratorAccountARM, err := (*properties.AdministratorAccount).ConvertToARM(resolved) + if err != nil { + return nil, err + } + administratorAccount := *administratorAccountARM.(*VirtualMachineSshCredentialsARM) + result.AdministratorAccount = &administratorAccount + } + + // Set property ‘IsNotebookInstanceCompute’: + if properties.IsNotebookInstanceCompute != nil { + isNotebookInstanceCompute := *properties.IsNotebookInstanceCompute + result.IsNotebookInstanceCompute = &isNotebookInstanceCompute + } + + // Set property ‘SshPort’: + if properties.SshPort != nil { + sshPort := *properties.SshPort + result.SshPort = &sshPort + } + + // Set property ‘VirtualMachineSize’: + if properties.VirtualMachineSize != nil { + virtualMachineSize := *properties.VirtualMachineSize + result.VirtualMachineSize = &virtualMachineSize + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *VirtualMachineProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &VirtualMachinePropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *VirtualMachineProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(VirtualMachinePropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected VirtualMachinePropertiesARM, got %T", armInput) + } + + // Set property ‘Address’: + if typedInput.Address != nil { + address := *typedInput.Address + properties.Address = &address + } + + // Set property ‘AdministratorAccount’: + if typedInput.AdministratorAccount != nil { + var administratorAccount1 VirtualMachineSshCredentials + err := administratorAccount1.PopulateFromARM(owner, *typedInput.AdministratorAccount) + if err != nil { + return err + } + administratorAccount := administratorAccount1 + properties.AdministratorAccount = &administratorAccount + } + + // Set property ‘IsNotebookInstanceCompute’: + if typedInput.IsNotebookInstanceCompute != nil { + isNotebookInstanceCompute := *typedInput.IsNotebookInstanceCompute + properties.IsNotebookInstanceCompute = &isNotebookInstanceCompute + } + + // Set property ‘SshPort’: + if typedInput.SshPort != nil { + sshPort := *typedInput.SshPort + properties.SshPort = &sshPort + } + + // Set property ‘VirtualMachineSize’: + if typedInput.VirtualMachineSize != nil { + virtualMachineSize := *typedInput.VirtualMachineSize + properties.VirtualMachineSize = &virtualMachineSize + } + + // No error + return nil +} + +// AssignPropertiesFromVirtualMachineProperties populates our VirtualMachineProperties from the provided source VirtualMachineProperties +func (properties *VirtualMachineProperties) AssignPropertiesFromVirtualMachineProperties(source *v20210701s.VirtualMachineProperties) error { + + // Address + properties.Address = genruntime.ClonePointerToString(source.Address) + + // AdministratorAccount + if source.AdministratorAccount != nil { + var administratorAccount VirtualMachineSshCredentials + err := administratorAccount.AssignPropertiesFromVirtualMachineSshCredentials(source.AdministratorAccount) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromVirtualMachineSshCredentials() to populate field AdministratorAccount") + } + properties.AdministratorAccount = &administratorAccount + } else { + properties.AdministratorAccount = nil + } + + // IsNotebookInstanceCompute + if source.IsNotebookInstanceCompute != nil { + isNotebookInstanceCompute := *source.IsNotebookInstanceCompute + properties.IsNotebookInstanceCompute = &isNotebookInstanceCompute + } else { + properties.IsNotebookInstanceCompute = nil + } + + // SshPort + properties.SshPort = genruntime.ClonePointerToInt(source.SshPort) + + // VirtualMachineSize + properties.VirtualMachineSize = genruntime.ClonePointerToString(source.VirtualMachineSize) + + // No error + return nil +} + +// AssignPropertiesToVirtualMachineProperties populates the provided destination VirtualMachineProperties from our VirtualMachineProperties +func (properties *VirtualMachineProperties) AssignPropertiesToVirtualMachineProperties(destination *v20210701s.VirtualMachineProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Address + destination.Address = genruntime.ClonePointerToString(properties.Address) + + // AdministratorAccount + if properties.AdministratorAccount != nil { + var administratorAccount v20210701s.VirtualMachineSshCredentials + err := properties.AdministratorAccount.AssignPropertiesToVirtualMachineSshCredentials(&administratorAccount) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToVirtualMachineSshCredentials() to populate field AdministratorAccount") + } + destination.AdministratorAccount = &administratorAccount + } else { + destination.AdministratorAccount = nil + } + + // IsNotebookInstanceCompute + if properties.IsNotebookInstanceCompute != nil { + isNotebookInstanceCompute := *properties.IsNotebookInstanceCompute + destination.IsNotebookInstanceCompute = &isNotebookInstanceCompute + } else { + destination.IsNotebookInstanceCompute = nil + } + + // SshPort + destination.SshPort = genruntime.ClonePointerToInt(properties.SshPort) + + // VirtualMachineSize + destination.VirtualMachineSize = genruntime.ClonePointerToString(properties.VirtualMachineSize) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AksNetworkingConfiguration +type AksNetworkingConfiguration struct { + // +kubebuilder:validation:Pattern="^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + // DnsServiceIP: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address + // range specified in serviceCidr. + DnsServiceIP *string `json:"dnsServiceIP,omitempty"` + + // +kubebuilder:validation:Pattern="^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$" + // DockerBridgeCidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP + // ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + + // +kubebuilder:validation:Pattern="^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$" + // ServiceCidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP + // ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + + // SubnetReference: Virtual network subnet resource ID the compute nodes belong to + SubnetReference *genruntime.ResourceReference `armReference:"SubnetId" json:"subnetReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &AksNetworkingConfiguration{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (configuration *AksNetworkingConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if configuration == nil { + return nil, nil + } + result := &AksNetworkingConfigurationARM{} + + // Set property ‘DnsServiceIP’: + if configuration.DnsServiceIP != nil { + dnsServiceIP := *configuration.DnsServiceIP + result.DnsServiceIP = &dnsServiceIP + } + + // Set property ‘DockerBridgeCidr’: + if configuration.DockerBridgeCidr != nil { + dockerBridgeCidr := *configuration.DockerBridgeCidr + result.DockerBridgeCidr = &dockerBridgeCidr + } + + // Set property ‘ServiceCidr’: + if configuration.ServiceCidr != nil { + serviceCidr := *configuration.ServiceCidr + result.ServiceCidr = &serviceCidr + } + + // Set property ‘SubnetId’: + if configuration.SubnetReference != nil { + subnetReferenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*configuration.SubnetReference) + if err != nil { + return nil, err + } + subnetReference := subnetReferenceARMID + result.SubnetId = &subnetReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (configuration *AksNetworkingConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &AksNetworkingConfigurationARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (configuration *AksNetworkingConfiguration) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(AksNetworkingConfigurationARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected AksNetworkingConfigurationARM, got %T", armInput) + } + + // Set property ‘DnsServiceIP’: + if typedInput.DnsServiceIP != nil { + dnsServiceIP := *typedInput.DnsServiceIP + configuration.DnsServiceIP = &dnsServiceIP + } + + // Set property ‘DockerBridgeCidr’: + if typedInput.DockerBridgeCidr != nil { + dockerBridgeCidr := *typedInput.DockerBridgeCidr + configuration.DockerBridgeCidr = &dockerBridgeCidr + } + + // Set property ‘ServiceCidr’: + if typedInput.ServiceCidr != nil { + serviceCidr := *typedInput.ServiceCidr + configuration.ServiceCidr = &serviceCidr + } + + // no assignment for property ‘SubnetReference’ + + // No error + return nil +} + +// AssignPropertiesFromAksNetworkingConfiguration populates our AksNetworkingConfiguration from the provided source AksNetworkingConfiguration +func (configuration *AksNetworkingConfiguration) AssignPropertiesFromAksNetworkingConfiguration(source *v20210701s.AksNetworkingConfiguration) error { + + // DnsServiceIP + if source.DnsServiceIP != nil { + dnsServiceIP := *source.DnsServiceIP + configuration.DnsServiceIP = &dnsServiceIP + } else { + configuration.DnsServiceIP = nil + } + + // DockerBridgeCidr + if source.DockerBridgeCidr != nil { + dockerBridgeCidr := *source.DockerBridgeCidr + configuration.DockerBridgeCidr = &dockerBridgeCidr + } else { + configuration.DockerBridgeCidr = nil + } + + // ServiceCidr + if source.ServiceCidr != nil { + serviceCidr := *source.ServiceCidr + configuration.ServiceCidr = &serviceCidr + } else { + configuration.ServiceCidr = nil + } + + // SubnetReference + if source.SubnetReference != nil { + subnetReference := source.SubnetReference.Copy() + configuration.SubnetReference = &subnetReference + } else { + configuration.SubnetReference = nil + } + + // No error + return nil +} + +// AssignPropertiesToAksNetworkingConfiguration populates the provided destination AksNetworkingConfiguration from our AksNetworkingConfiguration +func (configuration *AksNetworkingConfiguration) AssignPropertiesToAksNetworkingConfiguration(destination *v20210701s.AksNetworkingConfiguration) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // DnsServiceIP + if configuration.DnsServiceIP != nil { + dnsServiceIP := *configuration.DnsServiceIP + destination.DnsServiceIP = &dnsServiceIP + } else { + destination.DnsServiceIP = nil + } + + // DockerBridgeCidr + if configuration.DockerBridgeCidr != nil { + dockerBridgeCidr := *configuration.DockerBridgeCidr + destination.DockerBridgeCidr = &dockerBridgeCidr + } else { + destination.DockerBridgeCidr = nil + } + + // ServiceCidr + if configuration.ServiceCidr != nil { + serviceCidr := *configuration.ServiceCidr + destination.ServiceCidr = &serviceCidr + } else { + destination.ServiceCidr = nil + } + + // SubnetReference + if configuration.SubnetReference != nil { + subnetReference := configuration.SubnetReference.Copy() + destination.SubnetReference = &subnetReference + } else { + destination.SubnetReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoPauseProperties +type AutoPauseProperties struct { + DelayInMinutes *int `json:"delayInMinutes,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +var _ genruntime.ARMTransformer = &AutoPauseProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *AutoPauseProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &AutoPausePropertiesARM{} + + // Set property ‘DelayInMinutes’: + if properties.DelayInMinutes != nil { + delayInMinutes := *properties.DelayInMinutes + result.DelayInMinutes = &delayInMinutes + } + + // Set property ‘Enabled’: + if properties.Enabled != nil { + enabled := *properties.Enabled + result.Enabled = &enabled + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *AutoPauseProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &AutoPausePropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *AutoPauseProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(AutoPausePropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected AutoPausePropertiesARM, got %T", armInput) + } + + // Set property ‘DelayInMinutes’: + if typedInput.DelayInMinutes != nil { + delayInMinutes := *typedInput.DelayInMinutes + properties.DelayInMinutes = &delayInMinutes + } + + // Set property ‘Enabled’: + if typedInput.Enabled != nil { + enabled := *typedInput.Enabled + properties.Enabled = &enabled + } + + // No error + return nil +} + +// AssignPropertiesFromAutoPauseProperties populates our AutoPauseProperties from the provided source AutoPauseProperties +func (properties *AutoPauseProperties) AssignPropertiesFromAutoPauseProperties(source *v20210701s.AutoPauseProperties) error { + + // DelayInMinutes + properties.DelayInMinutes = genruntime.ClonePointerToInt(source.DelayInMinutes) + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + properties.Enabled = &enabled + } else { + properties.Enabled = nil + } + + // No error + return nil +} + +// AssignPropertiesToAutoPauseProperties populates the provided destination AutoPauseProperties from our AutoPauseProperties +func (properties *AutoPauseProperties) AssignPropertiesToAutoPauseProperties(destination *v20210701s.AutoPauseProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // DelayInMinutes + destination.DelayInMinutes = genruntime.ClonePointerToInt(properties.DelayInMinutes) + + // Enabled + if properties.Enabled != nil { + enabled := *properties.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoScaleProperties +type AutoScaleProperties struct { + Enabled *bool `json:"enabled,omitempty"` + MaxNodeCount *int `json:"maxNodeCount,omitempty"` + MinNodeCount *int `json:"minNodeCount,omitempty"` +} + +var _ genruntime.ARMTransformer = &AutoScaleProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *AutoScaleProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &AutoScalePropertiesARM{} + + // Set property ‘Enabled’: + if properties.Enabled != nil { + enabled := *properties.Enabled + result.Enabled = &enabled + } + + // Set property ‘MaxNodeCount’: + if properties.MaxNodeCount != nil { + maxNodeCount := *properties.MaxNodeCount + result.MaxNodeCount = &maxNodeCount + } + + // Set property ‘MinNodeCount’: + if properties.MinNodeCount != nil { + minNodeCount := *properties.MinNodeCount + result.MinNodeCount = &minNodeCount + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *AutoScaleProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &AutoScalePropertiesARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *AutoScaleProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(AutoScalePropertiesARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected AutoScalePropertiesARM, got %T", armInput) + } + + // Set property ‘Enabled’: + if typedInput.Enabled != nil { + enabled := *typedInput.Enabled + properties.Enabled = &enabled + } + + // Set property ‘MaxNodeCount’: + if typedInput.MaxNodeCount != nil { + maxNodeCount := *typedInput.MaxNodeCount + properties.MaxNodeCount = &maxNodeCount + } + + // Set property ‘MinNodeCount’: + if typedInput.MinNodeCount != nil { + minNodeCount := *typedInput.MinNodeCount + properties.MinNodeCount = &minNodeCount + } + + // No error + return nil +} + +// AssignPropertiesFromAutoScaleProperties populates our AutoScaleProperties from the provided source AutoScaleProperties +func (properties *AutoScaleProperties) AssignPropertiesFromAutoScaleProperties(source *v20210701s.AutoScaleProperties) error { + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + properties.Enabled = &enabled + } else { + properties.Enabled = nil + } + + // MaxNodeCount + properties.MaxNodeCount = genruntime.ClonePointerToInt(source.MaxNodeCount) + + // MinNodeCount + properties.MinNodeCount = genruntime.ClonePointerToInt(source.MinNodeCount) + + // No error + return nil +} + +// AssignPropertiesToAutoScaleProperties populates the provided destination AutoScaleProperties from our AutoScaleProperties +func (properties *AutoScaleProperties) AssignPropertiesToAutoScaleProperties(destination *v20210701s.AutoScaleProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Enabled + if properties.Enabled != nil { + enabled := *properties.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // MaxNodeCount + destination.MaxNodeCount = genruntime.ClonePointerToInt(properties.MaxNodeCount) + + // MinNodeCount + destination.MinNodeCount = genruntime.ClonePointerToInt(properties.MinNodeCount) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceSshSettings +type ComputeInstanceSshSettings struct { + // AdminPublicKey: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH + // key pairs. + AdminPublicKey *string `json:"adminPublicKey,omitempty"` + + // SshPublicAccess: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is + // closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the + // VNet/subnet policy if applicable. + SshPublicAccess *ComputeInstanceSshSettingsSshPublicAccess `json:"sshPublicAccess,omitempty"` +} + +var _ genruntime.ARMTransformer = &ComputeInstanceSshSettings{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (settings *ComputeInstanceSshSettings) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if settings == nil { + return nil, nil + } + result := &ComputeInstanceSshSettingsARM{} + + // Set property ‘AdminPublicKey’: + if settings.AdminPublicKey != nil { + adminPublicKey := *settings.AdminPublicKey + result.AdminPublicKey = &adminPublicKey + } + + // Set property ‘SshPublicAccess’: + if settings.SshPublicAccess != nil { + sshPublicAccess := *settings.SshPublicAccess + result.SshPublicAccess = &sshPublicAccess + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (settings *ComputeInstanceSshSettings) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ComputeInstanceSshSettingsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (settings *ComputeInstanceSshSettings) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ComputeInstanceSshSettingsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ComputeInstanceSshSettingsARM, got %T", armInput) + } + + // Set property ‘AdminPublicKey’: + if typedInput.AdminPublicKey != nil { + adminPublicKey := *typedInput.AdminPublicKey + settings.AdminPublicKey = &adminPublicKey + } + + // Set property ‘SshPublicAccess’: + if typedInput.SshPublicAccess != nil { + sshPublicAccess := *typedInput.SshPublicAccess + settings.SshPublicAccess = &sshPublicAccess + } + + // No error + return nil +} + +// AssignPropertiesFromComputeInstanceSshSettings populates our ComputeInstanceSshSettings from the provided source ComputeInstanceSshSettings +func (settings *ComputeInstanceSshSettings) AssignPropertiesFromComputeInstanceSshSettings(source *v20210701s.ComputeInstanceSshSettings) error { + + // AdminPublicKey + settings.AdminPublicKey = genruntime.ClonePointerToString(source.AdminPublicKey) + + // SshPublicAccess + if source.SshPublicAccess != nil { + sshPublicAccess := ComputeInstanceSshSettingsSshPublicAccess(*source.SshPublicAccess) + settings.SshPublicAccess = &sshPublicAccess + } else { + settings.SshPublicAccess = nil + } + + // No error + return nil +} + +// AssignPropertiesToComputeInstanceSshSettings populates the provided destination ComputeInstanceSshSettings from our ComputeInstanceSshSettings +func (settings *ComputeInstanceSshSettings) AssignPropertiesToComputeInstanceSshSettings(destination *v20210701s.ComputeInstanceSshSettings) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AdminPublicKey + destination.AdminPublicKey = genruntime.ClonePointerToString(settings.AdminPublicKey) + + // SshPublicAccess + if settings.SshPublicAccess != nil { + sshPublicAccess := string(*settings.SshPublicAccess) + destination.SshPublicAccess = &sshPublicAccess + } else { + destination.SshPublicAccess = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type ErrorAdditionalInfo_Status struct { + // Info: The additional info. + Info map[string]v1.JSON `json:"info,omitempty"` + + // Type: The additional info type. + Type *string `json:"type,omitempty"` +} + +var _ genruntime.FromARMConverter = &ErrorAdditionalInfo_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (info *ErrorAdditionalInfo_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ErrorAdditionalInfo_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (info *ErrorAdditionalInfo_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ErrorAdditionalInfo_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ErrorAdditionalInfo_StatusARM, got %T", armInput) + } + + // Set property ‘Info’: + if typedInput.Info != nil { + info.Info = make(map[string]v1.JSON, len(typedInput.Info)) + for key, value := range typedInput.Info { + info.Info[key] = *value.DeepCopy() + } + } + + // Set property ‘Type’: + if typedInput.Type != nil { + typeVar := *typedInput.Type + info.Type = &typeVar + } + + // No error + return nil +} + +// AssignPropertiesFromErrorAdditionalInfoStatus populates our ErrorAdditionalInfo_Status from the provided source ErrorAdditionalInfo_Status +func (info *ErrorAdditionalInfo_Status) AssignPropertiesFromErrorAdditionalInfoStatus(source *v20210701s.ErrorAdditionalInfo_Status) error { + + // Info + if source.Info != nil { + infoMap := make(map[string]v1.JSON, len(source.Info)) + for infoKey, infoValue := range source.Info { + // Shadow the loop variable to avoid aliasing + infoValue := infoValue + infoMap[infoKey] = *infoValue.DeepCopy() + } + info.Info = infoMap + } else { + info.Info = nil + } + + // Type + info.Type = genruntime.ClonePointerToString(source.Type) + + // No error + return nil +} + +// AssignPropertiesToErrorAdditionalInfoStatus populates the provided destination ErrorAdditionalInfo_Status from our ErrorAdditionalInfo_Status +func (info *ErrorAdditionalInfo_Status) AssignPropertiesToErrorAdditionalInfoStatus(destination *v20210701s.ErrorAdditionalInfo_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Info + if info.Info != nil { + infoMap := make(map[string]v1.JSON, len(info.Info)) + for infoKey, infoValue := range info.Info { + // Shadow the loop variable to avoid aliasing + infoValue := infoValue + infoMap[infoKey] = *infoValue.DeepCopy() + } + destination.Info = infoMap + } else { + destination.Info = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(info.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type ErrorDetail_Status_Unrolled struct { + // AdditionalInfo: The error additional info. + AdditionalInfo []ErrorAdditionalInfo_Status `json:"additionalInfo,omitempty"` + + // Code: The error code. + Code *string `json:"code,omitempty"` + + // Message: The error message. + Message *string `json:"message,omitempty"` + + // Target: The error target. + Target *string `json:"target,omitempty"` +} + +var _ genruntime.FromARMConverter = &ErrorDetail_Status_Unrolled{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (unrolled *ErrorDetail_Status_Unrolled) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ErrorDetail_Status_UnrolledARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (unrolled *ErrorDetail_Status_Unrolled) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ErrorDetail_Status_UnrolledARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ErrorDetail_Status_UnrolledARM, got %T", armInput) + } + + // Set property ‘AdditionalInfo’: + for _, item := range typedInput.AdditionalInfo { + var item1 ErrorAdditionalInfo_Status + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + unrolled.AdditionalInfo = append(unrolled.AdditionalInfo, item1) + } + + // Set property ‘Code’: + if typedInput.Code != nil { + code := *typedInput.Code + unrolled.Code = &code + } + + // Set property ‘Message’: + if typedInput.Message != nil { + message := *typedInput.Message + unrolled.Message = &message + } + + // Set property ‘Target’: + if typedInput.Target != nil { + target := *typedInput.Target + unrolled.Target = &target + } + + // No error + return nil +} + +// AssignPropertiesFromErrorDetailStatusUnrolled populates our ErrorDetail_Status_Unrolled from the provided source ErrorDetail_Status_Unrolled +func (unrolled *ErrorDetail_Status_Unrolled) AssignPropertiesFromErrorDetailStatusUnrolled(source *v20210701s.ErrorDetail_Status_Unrolled) error { + + // AdditionalInfo + if source.AdditionalInfo != nil { + additionalInfoList := make([]ErrorAdditionalInfo_Status, len(source.AdditionalInfo)) + for additionalInfoIndex, additionalInfoItem := range source.AdditionalInfo { + // Shadow the loop variable to avoid aliasing + additionalInfoItem := additionalInfoItem + var additionalInfo ErrorAdditionalInfo_Status + err := additionalInfo.AssignPropertiesFromErrorAdditionalInfoStatus(&additionalInfoItem) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromErrorAdditionalInfoStatus() to populate field AdditionalInfo") + } + additionalInfoList[additionalInfoIndex] = additionalInfo + } + unrolled.AdditionalInfo = additionalInfoList + } else { + unrolled.AdditionalInfo = nil + } + + // Code + unrolled.Code = genruntime.ClonePointerToString(source.Code) + + // Message + unrolled.Message = genruntime.ClonePointerToString(source.Message) + + // Target + unrolled.Target = genruntime.ClonePointerToString(source.Target) + + // No error + return nil +} + +// AssignPropertiesToErrorDetailStatusUnrolled populates the provided destination ErrorDetail_Status_Unrolled from our ErrorDetail_Status_Unrolled +func (unrolled *ErrorDetail_Status_Unrolled) AssignPropertiesToErrorDetailStatusUnrolled(destination *v20210701s.ErrorDetail_Status_Unrolled) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AdditionalInfo + if unrolled.AdditionalInfo != nil { + additionalInfoList := make([]v20210701s.ErrorAdditionalInfo_Status, len(unrolled.AdditionalInfo)) + for additionalInfoIndex, additionalInfoItem := range unrolled.AdditionalInfo { + // Shadow the loop variable to avoid aliasing + additionalInfoItem := additionalInfoItem + var additionalInfo v20210701s.ErrorAdditionalInfo_Status + err := additionalInfoItem.AssignPropertiesToErrorAdditionalInfoStatus(&additionalInfo) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToErrorAdditionalInfoStatus() to populate field AdditionalInfo") + } + additionalInfoList[additionalInfoIndex] = additionalInfo + } + destination.AdditionalInfo = additionalInfoList + } else { + destination.AdditionalInfo = nil + } + + // Code + destination.Code = genruntime.ClonePointerToString(unrolled.Code) + + // Message + destination.Message = genruntime.ClonePointerToString(unrolled.Message) + + // Target + destination.Target = genruntime.ClonePointerToString(unrolled.Target) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/PersonalComputeInstanceSettings +type PersonalComputeInstanceSettings struct { + // AssignedUser: A user that can be assigned to a compute instance. + AssignedUser *AssignedUser `json:"assignedUser,omitempty"` +} + +var _ genruntime.ARMTransformer = &PersonalComputeInstanceSettings{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (settings *PersonalComputeInstanceSettings) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if settings == nil { + return nil, nil + } + result := &PersonalComputeInstanceSettingsARM{} + + // Set property ‘AssignedUser’: + if settings.AssignedUser != nil { + assignedUserARM, err := (*settings.AssignedUser).ConvertToARM(resolved) + if err != nil { + return nil, err + } + assignedUser := *assignedUserARM.(*AssignedUserARM) + result.AssignedUser = &assignedUser + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (settings *PersonalComputeInstanceSettings) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &PersonalComputeInstanceSettingsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (settings *PersonalComputeInstanceSettings) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(PersonalComputeInstanceSettingsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected PersonalComputeInstanceSettingsARM, got %T", armInput) + } + + // Set property ‘AssignedUser’: + if typedInput.AssignedUser != nil { + var assignedUser1 AssignedUser + err := assignedUser1.PopulateFromARM(owner, *typedInput.AssignedUser) + if err != nil { + return err + } + assignedUser := assignedUser1 + settings.AssignedUser = &assignedUser + } + + // No error + return nil +} + +// AssignPropertiesFromPersonalComputeInstanceSettings populates our PersonalComputeInstanceSettings from the provided source PersonalComputeInstanceSettings +func (settings *PersonalComputeInstanceSettings) AssignPropertiesFromPersonalComputeInstanceSettings(source *v20210701s.PersonalComputeInstanceSettings) error { + + // AssignedUser + if source.AssignedUser != nil { + var assignedUser AssignedUser + err := assignedUser.AssignPropertiesFromAssignedUser(source.AssignedUser) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromAssignedUser() to populate field AssignedUser") + } + settings.AssignedUser = &assignedUser + } else { + settings.AssignedUser = nil + } + + // No error + return nil +} + +// AssignPropertiesToPersonalComputeInstanceSettings populates the provided destination PersonalComputeInstanceSettings from our PersonalComputeInstanceSettings +func (settings *PersonalComputeInstanceSettings) AssignPropertiesToPersonalComputeInstanceSettings(destination *v20210701s.PersonalComputeInstanceSettings) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AssignedUser + if settings.AssignedUser != nil { + var assignedUser v20210701s.AssignedUser + err := settings.AssignedUser.AssignPropertiesToAssignedUser(&assignedUser) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToAssignedUser() to populate field AssignedUser") + } + destination.AssignedUser = &assignedUser + } else { + destination.AssignedUser = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ResourceId +type ResourceId struct { + // +kubebuilder:validation:Required + // Reference: The ID of the resource + Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"` +} + +var _ genruntime.ARMTransformer = &ResourceId{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (resourceId *ResourceId) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if resourceId == nil { + return nil, nil + } + result := &ResourceIdARM{} + + // Set property ‘Id’: + if resourceId.Reference != nil { + referenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*resourceId.Reference) + if err != nil { + return nil, err + } + reference := referenceARMID + result.Id = &reference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (resourceId *ResourceId) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ResourceIdARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (resourceId *ResourceId) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + _, ok := armInput.(ResourceIdARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ResourceIdARM, got %T", armInput) + } + + // no assignment for property ‘Reference’ + + // No error + return nil +} + +// AssignPropertiesFromResourceId populates our ResourceId from the provided source ResourceId +func (resourceId *ResourceId) AssignPropertiesFromResourceId(source *v20210701s.ResourceId) error { + + // Reference + if source.Reference != nil { + reference := source.Reference.Copy() + resourceId.Reference = &reference + } else { + resourceId.Reference = nil + } + + // No error + return nil +} + +// AssignPropertiesToResourceId populates the provided destination ResourceId from our ResourceId +func (resourceId *ResourceId) AssignPropertiesToResourceId(destination *v20210701s.ResourceId) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Reference + if resourceId.Reference != nil { + reference := resourceId.Reference.Copy() + destination.Reference = &reference + } else { + destination.Reference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScaleSettings +type ScaleSettings struct { + // +kubebuilder:validation:Required + // MaxNodeCount: Max number of nodes to use + MaxNodeCount *int `json:"maxNodeCount,omitempty"` + + // MinNodeCount: Min number of nodes to use + MinNodeCount *int `json:"minNodeCount,omitempty"` + + // NodeIdleTimeBeforeScaleDown: Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format. + NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` +} + +var _ genruntime.ARMTransformer = &ScaleSettings{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (settings *ScaleSettings) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if settings == nil { + return nil, nil + } + result := &ScaleSettingsARM{} + + // Set property ‘MaxNodeCount’: + if settings.MaxNodeCount != nil { + maxNodeCount := *settings.MaxNodeCount + result.MaxNodeCount = &maxNodeCount + } + + // Set property ‘MinNodeCount’: + if settings.MinNodeCount != nil { + minNodeCount := *settings.MinNodeCount + result.MinNodeCount = &minNodeCount + } + + // Set property ‘NodeIdleTimeBeforeScaleDown’: + if settings.NodeIdleTimeBeforeScaleDown != nil { + nodeIdleTimeBeforeScaleDown := *settings.NodeIdleTimeBeforeScaleDown + result.NodeIdleTimeBeforeScaleDown = &nodeIdleTimeBeforeScaleDown + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (settings *ScaleSettings) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ScaleSettingsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (settings *ScaleSettings) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ScaleSettingsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ScaleSettingsARM, got %T", armInput) + } + + // Set property ‘MaxNodeCount’: + if typedInput.MaxNodeCount != nil { + maxNodeCount := *typedInput.MaxNodeCount + settings.MaxNodeCount = &maxNodeCount + } + + // Set property ‘MinNodeCount’: + if typedInput.MinNodeCount != nil { + minNodeCount := *typedInput.MinNodeCount + settings.MinNodeCount = &minNodeCount + } + + // Set property ‘NodeIdleTimeBeforeScaleDown’: + if typedInput.NodeIdleTimeBeforeScaleDown != nil { + nodeIdleTimeBeforeScaleDown := *typedInput.NodeIdleTimeBeforeScaleDown + settings.NodeIdleTimeBeforeScaleDown = &nodeIdleTimeBeforeScaleDown + } + + // No error + return nil +} + +// AssignPropertiesFromScaleSettings populates our ScaleSettings from the provided source ScaleSettings +func (settings *ScaleSettings) AssignPropertiesFromScaleSettings(source *v20210701s.ScaleSettings) error { + + // MaxNodeCount + settings.MaxNodeCount = genruntime.ClonePointerToInt(source.MaxNodeCount) + + // MinNodeCount + settings.MinNodeCount = genruntime.ClonePointerToInt(source.MinNodeCount) + + // NodeIdleTimeBeforeScaleDown + if source.NodeIdleTimeBeforeScaleDown != nil { + nodeIdleTimeBeforeScaleDown := *source.NodeIdleTimeBeforeScaleDown + settings.NodeIdleTimeBeforeScaleDown = &nodeIdleTimeBeforeScaleDown + } else { + settings.NodeIdleTimeBeforeScaleDown = nil + } + + // No error + return nil +} + +// AssignPropertiesToScaleSettings populates the provided destination ScaleSettings from our ScaleSettings +func (settings *ScaleSettings) AssignPropertiesToScaleSettings(destination *v20210701s.ScaleSettings) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // MaxNodeCount + destination.MaxNodeCount = genruntime.ClonePointerToInt(settings.MaxNodeCount) + + // MinNodeCount + destination.MinNodeCount = genruntime.ClonePointerToInt(settings.MinNodeCount) + + // NodeIdleTimeBeforeScaleDown + if settings.NodeIdleTimeBeforeScaleDown != nil { + nodeIdleTimeBeforeScaleDown := *settings.NodeIdleTimeBeforeScaleDown + destination.NodeIdleTimeBeforeScaleDown = &nodeIdleTimeBeforeScaleDown + } else { + destination.NodeIdleTimeBeforeScaleDown = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SetupScripts +type SetupScripts struct { + // Scripts: Customized setup scripts + Scripts *ScriptsToExecute `json:"scripts,omitempty"` +} + +var _ genruntime.ARMTransformer = &SetupScripts{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (scripts *SetupScripts) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if scripts == nil { + return nil, nil + } + result := &SetupScriptsARM{} + + // Set property ‘Scripts’: + if scripts.Scripts != nil { + scriptsARM, err := (*scripts.Scripts).ConvertToARM(resolved) + if err != nil { + return nil, err + } + scripts1 := *scriptsARM.(*ScriptsToExecuteARM) + result.Scripts = &scripts1 + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (scripts *SetupScripts) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SetupScriptsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (scripts *SetupScripts) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SetupScriptsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SetupScriptsARM, got %T", armInput) + } + + // Set property ‘Scripts’: + if typedInput.Scripts != nil { + var scripts2 ScriptsToExecute + err := scripts2.PopulateFromARM(owner, *typedInput.Scripts) + if err != nil { + return err + } + scripts1 := scripts2 + scripts.Scripts = &scripts1 + } + + // No error + return nil +} + +// AssignPropertiesFromSetupScripts populates our SetupScripts from the provided source SetupScripts +func (scripts *SetupScripts) AssignPropertiesFromSetupScripts(source *v20210701s.SetupScripts) error { + + // Scripts + if source.Scripts != nil { + var script ScriptsToExecute + err := script.AssignPropertiesFromScriptsToExecute(source.Scripts) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromScriptsToExecute() to populate field Scripts") + } + scripts.Scripts = &script + } else { + scripts.Scripts = nil + } + + // No error + return nil +} + +// AssignPropertiesToSetupScripts populates the provided destination SetupScripts from our SetupScripts +func (scripts *SetupScripts) AssignPropertiesToSetupScripts(destination *v20210701s.SetupScripts) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Scripts + if scripts.Scripts != nil { + var script v20210701s.ScriptsToExecute + err := scripts.Scripts.AssignPropertiesToScriptsToExecute(&script) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToScriptsToExecute() to populate field Scripts") + } + destination.Scripts = &script + } else { + destination.Scripts = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SslConfiguration +type SslConfiguration struct { + // Cert: Cert data + Cert *string `json:"cert,omitempty"` + + // Cname: CNAME of the cert + Cname *string `json:"cname,omitempty"` + + // Key: Key data + Key *string `json:"key,omitempty"` + + // LeafDomainLabel: Leaf domain label of public endpoint + LeafDomainLabel *string `json:"leafDomainLabel,omitempty"` + + // OverwriteExistingDomain: Indicates whether to overwrite existing domain label. + OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"` + + // Status: Enable or disable ssl for scoring. + Status *SslConfigurationStatus `json:"status,omitempty"` +} + +var _ genruntime.ARMTransformer = &SslConfiguration{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (configuration *SslConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if configuration == nil { + return nil, nil + } + result := &SslConfigurationARM{} + + // Set property ‘Cert’: + if configuration.Cert != nil { + cert := *configuration.Cert + result.Cert = &cert + } + + // Set property ‘Cname’: + if configuration.Cname != nil { + cname := *configuration.Cname + result.Cname = &cname + } + + // Set property ‘Key’: + if configuration.Key != nil { + key := *configuration.Key + result.Key = &key + } + + // Set property ‘LeafDomainLabel’: + if configuration.LeafDomainLabel != nil { + leafDomainLabel := *configuration.LeafDomainLabel + result.LeafDomainLabel = &leafDomainLabel + } + + // Set property ‘OverwriteExistingDomain’: + if configuration.OverwriteExistingDomain != nil { + overwriteExistingDomain := *configuration.OverwriteExistingDomain + result.OverwriteExistingDomain = &overwriteExistingDomain + } + + // Set property ‘Status’: + if configuration.Status != nil { + status := *configuration.Status + result.Status = &status + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (configuration *SslConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SslConfigurationARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (configuration *SslConfiguration) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SslConfigurationARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SslConfigurationARM, got %T", armInput) + } + + // Set property ‘Cert’: + if typedInput.Cert != nil { + cert := *typedInput.Cert + configuration.Cert = &cert + } + + // Set property ‘Cname’: + if typedInput.Cname != nil { + cname := *typedInput.Cname + configuration.Cname = &cname + } + + // Set property ‘Key’: + if typedInput.Key != nil { + key := *typedInput.Key + configuration.Key = &key + } + + // Set property ‘LeafDomainLabel’: + if typedInput.LeafDomainLabel != nil { + leafDomainLabel := *typedInput.LeafDomainLabel + configuration.LeafDomainLabel = &leafDomainLabel + } + + // Set property ‘OverwriteExistingDomain’: + if typedInput.OverwriteExistingDomain != nil { + overwriteExistingDomain := *typedInput.OverwriteExistingDomain + configuration.OverwriteExistingDomain = &overwriteExistingDomain + } + + // Set property ‘Status’: + if typedInput.Status != nil { + status := *typedInput.Status + configuration.Status = &status + } + + // No error + return nil +} + +// AssignPropertiesFromSslConfiguration populates our SslConfiguration from the provided source SslConfiguration +func (configuration *SslConfiguration) AssignPropertiesFromSslConfiguration(source *v20210701s.SslConfiguration) error { + + // Cert + configuration.Cert = genruntime.ClonePointerToString(source.Cert) + + // Cname + configuration.Cname = genruntime.ClonePointerToString(source.Cname) + + // Key + configuration.Key = genruntime.ClonePointerToString(source.Key) + + // LeafDomainLabel + configuration.LeafDomainLabel = genruntime.ClonePointerToString(source.LeafDomainLabel) + + // OverwriteExistingDomain + if source.OverwriteExistingDomain != nil { + overwriteExistingDomain := *source.OverwriteExistingDomain + configuration.OverwriteExistingDomain = &overwriteExistingDomain + } else { + configuration.OverwriteExistingDomain = nil + } + + // Status + if source.Status != nil { + status := SslConfigurationStatus(*source.Status) + configuration.Status = &status + } else { + configuration.Status = nil + } + + // No error + return nil +} + +// AssignPropertiesToSslConfiguration populates the provided destination SslConfiguration from our SslConfiguration +func (configuration *SslConfiguration) AssignPropertiesToSslConfiguration(destination *v20210701s.SslConfiguration) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Cert + destination.Cert = genruntime.ClonePointerToString(configuration.Cert) + + // Cname + destination.Cname = genruntime.ClonePointerToString(configuration.Cname) + + // Key + destination.Key = genruntime.ClonePointerToString(configuration.Key) + + // LeafDomainLabel + destination.LeafDomainLabel = genruntime.ClonePointerToString(configuration.LeafDomainLabel) + + // OverwriteExistingDomain + if configuration.OverwriteExistingDomain != nil { + overwriteExistingDomain := *configuration.OverwriteExistingDomain + destination.OverwriteExistingDomain = &overwriteExistingDomain + } else { + destination.OverwriteExistingDomain = nil + } + + // Status + if configuration.Status != nil { + status := string(*configuration.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/UserAccountCredentials +type UserAccountCredentials struct { + // +kubebuilder:validation:Required + // AdminUserName: Name of the administrator user account which can be used to SSH to nodes. + AdminUserName *string `json:"adminUserName,omitempty"` + + // AdminUserPassword: Password of the administrator user account. + AdminUserPassword *genruntime.SecretReference `json:"adminUserPassword,omitempty"` + + // AdminUserSshPublicKey: SSH public key of the administrator user account. + AdminUserSshPublicKey *genruntime.SecretReference `json:"adminUserSshPublicKey,omitempty"` +} + +var _ genruntime.ARMTransformer = &UserAccountCredentials{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (credentials *UserAccountCredentials) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if credentials == nil { + return nil, nil + } + result := &UserAccountCredentialsARM{} + + // Set property ‘AdminUserName’: + if credentials.AdminUserName != nil { + adminUserName := *credentials.AdminUserName + result.AdminUserName = &adminUserName + } + + // Set property ‘AdminUserPassword’: + if credentials.AdminUserPassword != nil { + adminUserPasswordSecret, err := resolved.ResolvedSecrets.LookupSecret(*credentials.AdminUserPassword) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminUserPassword") + } + adminUserPassword := adminUserPasswordSecret + result.AdminUserPassword = &adminUserPassword + } + + // Set property ‘AdminUserSshPublicKey’: + if credentials.AdminUserSshPublicKey != nil { + adminUserSshPublicKeySecret, err := resolved.ResolvedSecrets.LookupSecret(*credentials.AdminUserSshPublicKey) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property AdminUserSshPublicKey") + } + adminUserSshPublicKey := adminUserSshPublicKeySecret + result.AdminUserSshPublicKey = &adminUserSshPublicKey + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (credentials *UserAccountCredentials) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &UserAccountCredentialsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (credentials *UserAccountCredentials) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(UserAccountCredentialsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAccountCredentialsARM, got %T", armInput) + } + + // Set property ‘AdminUserName’: + if typedInput.AdminUserName != nil { + adminUserName := *typedInput.AdminUserName + credentials.AdminUserName = &adminUserName + } + + // no assignment for property ‘AdminUserPassword’ + + // no assignment for property ‘AdminUserSshPublicKey’ + + // No error + return nil +} + +// AssignPropertiesFromUserAccountCredentials populates our UserAccountCredentials from the provided source UserAccountCredentials +func (credentials *UserAccountCredentials) AssignPropertiesFromUserAccountCredentials(source *v20210701s.UserAccountCredentials) error { + + // AdminUserName + credentials.AdminUserName = genruntime.ClonePointerToString(source.AdminUserName) + + // AdminUserPassword + if source.AdminUserPassword != nil { + adminUserPassword := source.AdminUserPassword.Copy() + credentials.AdminUserPassword = &adminUserPassword + } else { + credentials.AdminUserPassword = nil + } + + // AdminUserSshPublicKey + if source.AdminUserSshPublicKey != nil { + adminUserSshPublicKey := source.AdminUserSshPublicKey.Copy() + credentials.AdminUserSshPublicKey = &adminUserSshPublicKey + } else { + credentials.AdminUserSshPublicKey = nil + } + + // No error + return nil +} + +// AssignPropertiesToUserAccountCredentials populates the provided destination UserAccountCredentials from our UserAccountCredentials +func (credentials *UserAccountCredentials) AssignPropertiesToUserAccountCredentials(destination *v20210701s.UserAccountCredentials) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AdminUserName + destination.AdminUserName = genruntime.ClonePointerToString(credentials.AdminUserName) + + // AdminUserPassword + if credentials.AdminUserPassword != nil { + adminUserPassword := credentials.AdminUserPassword.Copy() + destination.AdminUserPassword = &adminUserPassword + } else { + destination.AdminUserPassword = nil + } + + // AdminUserSshPublicKey + if credentials.AdminUserSshPublicKey != nil { + adminUserSshPublicKey := credentials.AdminUserSshPublicKey.Copy() + destination.AdminUserSshPublicKey = &adminUserSshPublicKey + } else { + destination.AdminUserSshPublicKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineImage +type VirtualMachineImage struct { + // +kubebuilder:validation:Required + // Reference: Virtual Machine image path + Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"` +} + +var _ genruntime.ARMTransformer = &VirtualMachineImage{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (image *VirtualMachineImage) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if image == nil { + return nil, nil + } + result := &VirtualMachineImageARM{} + + // Set property ‘Id’: + if image.Reference != nil { + referenceARMID, err := resolved.ResolvedReferences.ARMIDOrErr(*image.Reference) + if err != nil { + return nil, err + } + reference := referenceARMID + result.Id = &reference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (image *VirtualMachineImage) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &VirtualMachineImageARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (image *VirtualMachineImage) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + _, ok := armInput.(VirtualMachineImageARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected VirtualMachineImageARM, got %T", armInput) + } + + // no assignment for property ‘Reference’ + + // No error + return nil +} + +// AssignPropertiesFromVirtualMachineImage populates our VirtualMachineImage from the provided source VirtualMachineImage +func (image *VirtualMachineImage) AssignPropertiesFromVirtualMachineImage(source *v20210701s.VirtualMachineImage) error { + + // Reference + if source.Reference != nil { + reference := source.Reference.Copy() + image.Reference = &reference + } else { + image.Reference = nil + } + + // No error + return nil +} + +// AssignPropertiesToVirtualMachineImage populates the provided destination VirtualMachineImage from our VirtualMachineImage +func (image *VirtualMachineImage) AssignPropertiesToVirtualMachineImage(destination *v20210701s.VirtualMachineImage) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Reference + if image.Reference != nil { + reference := image.Reference.Copy() + destination.Reference = &reference + } else { + destination.Reference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineSshCredentials +type VirtualMachineSshCredentials struct { + // Password: Password of admin account + Password *genruntime.SecretReference `json:"password,omitempty"` + + // PrivateKeyData: Private key data + PrivateKeyData *string `json:"privateKeyData,omitempty"` + + // PublicKeyData: Public key data + PublicKeyData *string `json:"publicKeyData,omitempty"` + + // Username: Username of admin account + Username *string `json:"username,omitempty"` +} + +var _ genruntime.ARMTransformer = &VirtualMachineSshCredentials{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (credentials *VirtualMachineSshCredentials) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if credentials == nil { + return nil, nil + } + result := &VirtualMachineSshCredentialsARM{} + + // Set property ‘Password’: + if credentials.Password != nil { + passwordSecret, err := resolved.ResolvedSecrets.LookupSecret(*credentials.Password) + if err != nil { + return nil, errors.Wrap(err, "looking up secret for property Password") + } + password := passwordSecret + result.Password = &password + } + + // Set property ‘PrivateKeyData’: + if credentials.PrivateKeyData != nil { + privateKeyData := *credentials.PrivateKeyData + result.PrivateKeyData = &privateKeyData + } + + // Set property ‘PublicKeyData’: + if credentials.PublicKeyData != nil { + publicKeyData := *credentials.PublicKeyData + result.PublicKeyData = &publicKeyData + } + + // Set property ‘Username’: + if credentials.Username != nil { + username := *credentials.Username + result.Username = &username + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (credentials *VirtualMachineSshCredentials) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &VirtualMachineSshCredentialsARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (credentials *VirtualMachineSshCredentials) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(VirtualMachineSshCredentialsARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected VirtualMachineSshCredentialsARM, got %T", armInput) + } + + // no assignment for property ‘Password’ + + // Set property ‘PrivateKeyData’: + if typedInput.PrivateKeyData != nil { + privateKeyData := *typedInput.PrivateKeyData + credentials.PrivateKeyData = &privateKeyData + } + + // Set property ‘PublicKeyData’: + if typedInput.PublicKeyData != nil { + publicKeyData := *typedInput.PublicKeyData + credentials.PublicKeyData = &publicKeyData + } + + // Set property ‘Username’: + if typedInput.Username != nil { + username := *typedInput.Username + credentials.Username = &username + } + + // No error + return nil +} + +// AssignPropertiesFromVirtualMachineSshCredentials populates our VirtualMachineSshCredentials from the provided source VirtualMachineSshCredentials +func (credentials *VirtualMachineSshCredentials) AssignPropertiesFromVirtualMachineSshCredentials(source *v20210701s.VirtualMachineSshCredentials) error { + + // Password + if source.Password != nil { + password := source.Password.Copy() + credentials.Password = &password + } else { + credentials.Password = nil + } + + // PrivateKeyData + credentials.PrivateKeyData = genruntime.ClonePointerToString(source.PrivateKeyData) + + // PublicKeyData + credentials.PublicKeyData = genruntime.ClonePointerToString(source.PublicKeyData) + + // Username + credentials.Username = genruntime.ClonePointerToString(source.Username) + + // No error + return nil +} + +// AssignPropertiesToVirtualMachineSshCredentials populates the provided destination VirtualMachineSshCredentials from our VirtualMachineSshCredentials +func (credentials *VirtualMachineSshCredentials) AssignPropertiesToVirtualMachineSshCredentials(destination *v20210701s.VirtualMachineSshCredentials) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Password + if credentials.Password != nil { + password := credentials.Password.Copy() + destination.Password = &password + } else { + destination.Password = nil + } + + // PrivateKeyData + destination.PrivateKeyData = genruntime.ClonePointerToString(credentials.PrivateKeyData) + + // PublicKeyData + destination.PublicKeyData = genruntime.ClonePointerToString(credentials.PublicKeyData) + + // Username + destination.Username = genruntime.ClonePointerToString(credentials.Username) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AssignedUser +type AssignedUser struct { + // +kubebuilder:validation:Required + // ObjectId: User’s AAD Object Id. + ObjectId *string `json:"objectId,omitempty"` + + // +kubebuilder:validation:Required + // TenantId: User’s AAD Tenant Id. + TenantId *string `json:"tenantId,omitempty"` +} + +var _ genruntime.ARMTransformer = &AssignedUser{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (user *AssignedUser) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if user == nil { + return nil, nil + } + result := &AssignedUserARM{} + + // Set property ‘ObjectId’: + if user.ObjectId != nil { + objectId := *user.ObjectId + result.ObjectId = &objectId + } + + // Set property ‘TenantId’: + if user.TenantId != nil { + tenantId := *user.TenantId + result.TenantId = &tenantId + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (user *AssignedUser) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &AssignedUserARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (user *AssignedUser) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(AssignedUserARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected AssignedUserARM, got %T", armInput) + } + + // Set property ‘ObjectId’: + if typedInput.ObjectId != nil { + objectId := *typedInput.ObjectId + user.ObjectId = &objectId + } + + // Set property ‘TenantId’: + if typedInput.TenantId != nil { + tenantId := *typedInput.TenantId + user.TenantId = &tenantId + } + + // No error + return nil +} + +// AssignPropertiesFromAssignedUser populates our AssignedUser from the provided source AssignedUser +func (user *AssignedUser) AssignPropertiesFromAssignedUser(source *v20210701s.AssignedUser) error { + + // ObjectId + user.ObjectId = genruntime.ClonePointerToString(source.ObjectId) + + // TenantId + user.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // No error + return nil +} + +// AssignPropertiesToAssignedUser populates the provided destination AssignedUser from our AssignedUser +func (user *AssignedUser) AssignPropertiesToAssignedUser(destination *v20210701s.AssignedUser) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ObjectId + destination.ObjectId = genruntime.ClonePointerToString(user.ObjectId) + + // TenantId + destination.TenantId = genruntime.ClonePointerToString(user.TenantId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptsToExecute +type ScriptsToExecute struct { + // CreationScript: Script reference + CreationScript *ScriptReference `json:"creationScript,omitempty"` + + // StartupScript: Script reference + StartupScript *ScriptReference `json:"startupScript,omitempty"` +} + +var _ genruntime.ARMTransformer = &ScriptsToExecute{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (execute *ScriptsToExecute) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if execute == nil { + return nil, nil + } + result := &ScriptsToExecuteARM{} + + // Set property ‘CreationScript’: + if execute.CreationScript != nil { + creationScriptARM, err := (*execute.CreationScript).ConvertToARM(resolved) + if err != nil { + return nil, err + } + creationScript := *creationScriptARM.(*ScriptReferenceARM) + result.CreationScript = &creationScript + } + + // Set property ‘StartupScript’: + if execute.StartupScript != nil { + startupScriptARM, err := (*execute.StartupScript).ConvertToARM(resolved) + if err != nil { + return nil, err + } + startupScript := *startupScriptARM.(*ScriptReferenceARM) + result.StartupScript = &startupScript + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (execute *ScriptsToExecute) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ScriptsToExecuteARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (execute *ScriptsToExecute) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ScriptsToExecuteARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ScriptsToExecuteARM, got %T", armInput) + } + + // Set property ‘CreationScript’: + if typedInput.CreationScript != nil { + var creationScript1 ScriptReference + err := creationScript1.PopulateFromARM(owner, *typedInput.CreationScript) + if err != nil { + return err + } + creationScript := creationScript1 + execute.CreationScript = &creationScript + } + + // Set property ‘StartupScript’: + if typedInput.StartupScript != nil { + var startupScript1 ScriptReference + err := startupScript1.PopulateFromARM(owner, *typedInput.StartupScript) + if err != nil { + return err + } + startupScript := startupScript1 + execute.StartupScript = &startupScript + } + + // No error + return nil +} + +// AssignPropertiesFromScriptsToExecute populates our ScriptsToExecute from the provided source ScriptsToExecute +func (execute *ScriptsToExecute) AssignPropertiesFromScriptsToExecute(source *v20210701s.ScriptsToExecute) error { + + // CreationScript + if source.CreationScript != nil { + var creationScript ScriptReference + err := creationScript.AssignPropertiesFromScriptReference(source.CreationScript) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromScriptReference() to populate field CreationScript") + } + execute.CreationScript = &creationScript + } else { + execute.CreationScript = nil + } + + // StartupScript + if source.StartupScript != nil { + var startupScript ScriptReference + err := startupScript.AssignPropertiesFromScriptReference(source.StartupScript) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromScriptReference() to populate field StartupScript") + } + execute.StartupScript = &startupScript + } else { + execute.StartupScript = nil + } + + // No error + return nil +} + +// AssignPropertiesToScriptsToExecute populates the provided destination ScriptsToExecute from our ScriptsToExecute +func (execute *ScriptsToExecute) AssignPropertiesToScriptsToExecute(destination *v20210701s.ScriptsToExecute) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CreationScript + if execute.CreationScript != nil { + var creationScript v20210701s.ScriptReference + err := execute.CreationScript.AssignPropertiesToScriptReference(&creationScript) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToScriptReference() to populate field CreationScript") + } + destination.CreationScript = &creationScript + } else { + destination.CreationScript = nil + } + + // StartupScript + if execute.StartupScript != nil { + var startupScript v20210701s.ScriptReference + err := execute.StartupScript.AssignPropertiesToScriptReference(&startupScript) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToScriptReference() to populate field StartupScript") + } + destination.StartupScript = &startupScript + } else { + destination.StartupScript = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptReference +type ScriptReference struct { + // ScriptArguments: Optional command line arguments passed to the script to run. + ScriptArguments *string `json:"scriptArguments,omitempty"` + + // ScriptData: The location of scripts in the mounted volume. + ScriptData *string `json:"scriptData,omitempty"` + + // ScriptSource: The storage source of the script: inline, workspace. + ScriptSource *string `json:"scriptSource,omitempty"` + + // Timeout: Optional time period passed to timeout command. + Timeout *string `json:"timeout,omitempty"` +} + +var _ genruntime.ARMTransformer = &ScriptReference{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (reference *ScriptReference) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if reference == nil { + return nil, nil + } + result := &ScriptReferenceARM{} + + // Set property ‘ScriptArguments’: + if reference.ScriptArguments != nil { + scriptArguments := *reference.ScriptArguments + result.ScriptArguments = &scriptArguments + } + + // Set property ‘ScriptData’: + if reference.ScriptData != nil { + scriptData := *reference.ScriptData + result.ScriptData = &scriptData + } + + // Set property ‘ScriptSource’: + if reference.ScriptSource != nil { + scriptSource := *reference.ScriptSource + result.ScriptSource = &scriptSource + } + + // Set property ‘Timeout’: + if reference.Timeout != nil { + timeout := *reference.Timeout + result.Timeout = &timeout + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (reference *ScriptReference) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &ScriptReferenceARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (reference *ScriptReference) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(ScriptReferenceARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected ScriptReferenceARM, got %T", armInput) + } + + // Set property ‘ScriptArguments’: + if typedInput.ScriptArguments != nil { + scriptArguments := *typedInput.ScriptArguments + reference.ScriptArguments = &scriptArguments + } + + // Set property ‘ScriptData’: + if typedInput.ScriptData != nil { + scriptData := *typedInput.ScriptData + reference.ScriptData = &scriptData + } + + // Set property ‘ScriptSource’: + if typedInput.ScriptSource != nil { + scriptSource := *typedInput.ScriptSource + reference.ScriptSource = &scriptSource + } + + // Set property ‘Timeout’: + if typedInput.Timeout != nil { + timeout := *typedInput.Timeout + reference.Timeout = &timeout + } + + // No error + return nil +} + +// AssignPropertiesFromScriptReference populates our ScriptReference from the provided source ScriptReference +func (reference *ScriptReference) AssignPropertiesFromScriptReference(source *v20210701s.ScriptReference) error { + + // ScriptArguments + reference.ScriptArguments = genruntime.ClonePointerToString(source.ScriptArguments) + + // ScriptData + reference.ScriptData = genruntime.ClonePointerToString(source.ScriptData) + + // ScriptSource + reference.ScriptSource = genruntime.ClonePointerToString(source.ScriptSource) + + // Timeout + reference.Timeout = genruntime.ClonePointerToString(source.Timeout) + + // No error + return nil +} + +// AssignPropertiesToScriptReference populates the provided destination ScriptReference from our ScriptReference +func (reference *ScriptReference) AssignPropertiesToScriptReference(destination *v20210701s.ScriptReference) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ScriptArguments + destination.ScriptArguments = genruntime.ClonePointerToString(reference.ScriptArguments) + + // ScriptData + destination.ScriptData = genruntime.ClonePointerToString(reference.ScriptData) + + // ScriptSource + destination.ScriptSource = genruntime.ClonePointerToString(reference.ScriptSource) + + // Timeout + destination.Timeout = genruntime.ClonePointerToString(reference.Timeout) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&WorkspacesCompute{}, &WorkspacesComputeList{}) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen_test.go new file mode 100644 index 0000000000..4a7051a1d0 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_compute_types_gen_test.go @@ -0,0 +1,4636 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import ( + "encoding/json" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "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_WorkspacesCompute_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspacesCompute to hub returns original", + prop.ForAll(RunResourceConversionTestForWorkspacesCompute, WorkspacesComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForWorkspacesCompute tests if a specific instance of WorkspacesCompute round trips to the hub storage version and back losslessly +func RunResourceConversionTestForWorkspacesCompute(subject WorkspacesCompute) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20210701s.WorkspacesCompute + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual WorkspacesCompute + 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_WorkspacesCompute_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspacesCompute to WorkspacesCompute via AssignPropertiesToWorkspacesCompute & AssignPropertiesFromWorkspacesCompute returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspacesCompute, WorkspacesComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspacesCompute tests if a specific instance of WorkspacesCompute can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspacesCompute(subject WorkspacesCompute) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.WorkspacesCompute + err := copied.AssignPropertiesToWorkspacesCompute(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspacesCompute + err = actual.AssignPropertiesFromWorkspacesCompute(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_WorkspacesCompute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesCompute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesCompute, WorkspacesComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesCompute runs a test to see if a specific instance of WorkspacesCompute round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesCompute(subject WorkspacesCompute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesCompute + 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 WorkspacesCompute instances for property testing - lazily instantiated by WorkspacesComputeGenerator() +var workspacesComputeGenerator gopter.Gen + +// WorkspacesComputeGenerator returns a generator of WorkspacesCompute instances for property testing. +func WorkspacesComputeGenerator() gopter.Gen { + if workspacesComputeGenerator != nil { + return workspacesComputeGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspacesCompute(generators) + workspacesComputeGenerator = gen.Struct(reflect.TypeOf(WorkspacesCompute{}), generators) + + return workspacesComputeGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspacesCompute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesCompute(gens map[string]gopter.Gen) { + gens["Spec"] = WorkspacesComputesSpecGenerator() + gens["Status"] = ComputeResourceStatusGenerator() +} + +func Test_ComputeResource_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ComputeResource_Status to ComputeResource_Status via AssignPropertiesToComputeResourceStatus & AssignPropertiesFromComputeResourceStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeResourceStatus, ComputeResourceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeResourceStatus tests if a specific instance of ComputeResource_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeResourceStatus(subject ComputeResource_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 v20210701s.ComputeResource_Status + err := copied.AssignPropertiesToComputeResourceStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ComputeResource_Status + err = actual.AssignPropertiesFromComputeResourceStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ComputeResource_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeResource_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeResourceStatus, ComputeResourceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeResourceStatus runs a test to see if a specific instance of ComputeResource_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeResourceStatus(subject ComputeResource_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeResource_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 ComputeResource_Status instances for property testing - lazily instantiated by +// ComputeResourceStatusGenerator() +var computeResourceStatusGenerator gopter.Gen + +// ComputeResourceStatusGenerator returns a generator of ComputeResource_Status instances for property testing. +// We first initialize computeResourceStatusGenerator 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 ComputeResourceStatusGenerator() gopter.Gen { + if computeResourceStatusGenerator != nil { + return computeResourceStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeResourceStatus(generators) + computeResourceStatusGenerator = gen.Struct(reflect.TypeOf(ComputeResource_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeResourceStatus(generators) + AddRelatedPropertyGeneratorsForComputeResourceStatus(generators) + computeResourceStatusGenerator = gen.Struct(reflect.TypeOf(ComputeResource_Status{}), generators) + + return computeResourceStatusGenerator +} + +// AddIndependentPropertyGeneratorsForComputeResourceStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeResourceStatus(gens map[string]gopter.Gen) { + 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()) +} + +// AddRelatedPropertyGeneratorsForComputeResourceStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeResourceStatus(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityStatusGenerator()) + gens["Properties"] = gen.PtrOf(ComputeStatusGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusGenerator()) +} + +func Test_WorkspacesComputes_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspacesComputes_Spec to WorkspacesComputes_Spec via AssignPropertiesToWorkspacesComputesSpec & AssignPropertiesFromWorkspacesComputesSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspacesComputesSpec, WorkspacesComputesSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspacesComputesSpec tests if a specific instance of WorkspacesComputes_Spec can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspacesComputesSpec(subject WorkspacesComputes_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 v20210701s.WorkspacesComputes_Spec + err := copied.AssignPropertiesToWorkspacesComputesSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspacesComputes_Spec + err = actual.AssignPropertiesFromWorkspacesComputesSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_WorkspacesComputes_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesComputes_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesComputesSpec, WorkspacesComputesSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesComputesSpec runs a test to see if a specific instance of WorkspacesComputes_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesComputesSpec(subject WorkspacesComputes_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesComputes_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 WorkspacesComputes_Spec instances for property testing - lazily instantiated by +// WorkspacesComputesSpecGenerator() +var workspacesComputesSpecGenerator gopter.Gen + +// WorkspacesComputesSpecGenerator returns a generator of WorkspacesComputes_Spec instances for property testing. +// We first initialize workspacesComputesSpecGenerator 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 WorkspacesComputesSpecGenerator() gopter.Gen { + if workspacesComputesSpecGenerator != nil { + return workspacesComputesSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesComputesSpec(generators) + workspacesComputesSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesComputes_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesComputesSpec(generators) + AddRelatedPropertyGeneratorsForWorkspacesComputesSpec(generators) + workspacesComputesSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesComputes_Spec{}), generators) + + return workspacesComputesSpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesComputesSpec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesComputesSpec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesComputesSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesComputesSpec(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["Properties"] = gen.PtrOf(ComputeGenerator()) + gens["Sku"] = gen.PtrOf(SkuGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataGenerator()) +} + +func Test_Compute_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute to Compute via AssignPropertiesToCompute & AssignPropertiesFromCompute returns original", + prop.ForAll(RunPropertyAssignmentTestForCompute, ComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCompute tests if a specific instance of Compute can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForCompute(subject Compute) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute + err := copied.AssignPropertiesToCompute(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute + err = actual.AssignPropertiesFromCompute(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCompute, ComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCompute runs a test to see if a specific instance of Compute round trips to JSON and back losslessly +func RunJSONSerializationTestForCompute(subject Compute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute + 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 Compute instances for property testing - lazily instantiated by ComputeGenerator() +var computeGenerator gopter.Gen + +// ComputeGenerator returns a generator of Compute instances for property testing. +func ComputeGenerator() gopter.Gen { + if computeGenerator != nil { + return computeGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForCompute(generators) + + // handle OneOf by choosing only one field to instantiate + var gens []gopter.Gen + for propName, propGen := range generators { + gens = append(gens, gen.Struct(reflect.TypeOf(Compute{}), map[string]gopter.Gen{ + propName: propGen, + })) + } + computeGenerator = gen.OneGenOf(gens...) + + return computeGenerator +} + +// AddRelatedPropertyGeneratorsForCompute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCompute(gens map[string]gopter.Gen) { + gens["AKS"] = ComputeAKSGenerator().Map(func(it Compute_AKS) *Compute_AKS { + return &it + }) // generate one case for OneOf type + gens["AmlCompute"] = ComputeAmlComputeGenerator().Map(func(it Compute_AmlCompute) *Compute_AmlCompute { + return &it + }) // generate one case for OneOf type + gens["ComputeInstance"] = ComputeComputeInstanceGenerator().Map(func(it Compute_ComputeInstance) *Compute_ComputeInstance { + return &it + }) // generate one case for OneOf type + gens["DataFactory"] = ComputeDataFactoryGenerator().Map(func(it Compute_DataFactory) *Compute_DataFactory { + return &it + }) // generate one case for OneOf type + gens["DataLakeAnalytics"] = ComputeDataLakeAnalyticsGenerator().Map(func(it Compute_DataLakeAnalytics) *Compute_DataLakeAnalytics { + return &it + }) // generate one case for OneOf type + gens["Databricks"] = ComputeDatabricksGenerator().Map(func(it Compute_Databricks) *Compute_Databricks { + return &it + }) // generate one case for OneOf type + gens["HDInsight"] = ComputeHDInsightGenerator().Map(func(it Compute_HDInsight) *Compute_HDInsight { + return &it + }) // generate one case for OneOf type + gens["SynapseSpark"] = ComputeSynapseSparkGenerator().Map(func(it Compute_SynapseSpark) *Compute_SynapseSpark { + return &it + }) // generate one case for OneOf type + gens["VirtualMachine"] = ComputeVirtualMachineGenerator().Map(func(it Compute_VirtualMachine) *Compute_VirtualMachine { + return &it + }) // generate one case for OneOf type +} + +func Test_Compute_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_Status to Compute_Status via AssignPropertiesToComputeStatus & AssignPropertiesFromComputeStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeStatus, ComputeStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeStatus tests if a specific instance of Compute_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeStatus(subject Compute_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 v20210701s.Compute_Status + err := copied.AssignPropertiesToComputeStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_Status + err = actual.AssignPropertiesFromComputeStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeStatus, ComputeStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeStatus runs a test to see if a specific instance of Compute_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeStatus(subject Compute_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_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 Compute_Status instances for property testing - lazily instantiated by ComputeStatusGenerator() +var computeStatusGenerator gopter.Gen + +// ComputeStatusGenerator returns a generator of Compute_Status instances for property testing. +// We first initialize computeStatusGenerator 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 ComputeStatusGenerator() gopter.Gen { + if computeStatusGenerator != nil { + return computeStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeStatus(generators) + computeStatusGenerator = gen.Struct(reflect.TypeOf(Compute_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeStatus(generators) + AddRelatedPropertyGeneratorsForComputeStatus(generators) + computeStatusGenerator = gen.Struct(reflect.TypeOf(Compute_Status{}), generators) + + return computeStatusGenerator +} + +// AddIndependentPropertyGeneratorsForComputeStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeStatus(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf( + ComputeType_StatusAKS, + ComputeType_StatusAmlCompute, + ComputeType_StatusComputeInstance, + ComputeType_StatusDataFactory, + ComputeType_StatusDataLakeAnalytics, + ComputeType_StatusDatabricks, + ComputeType_StatusHDInsight, + ComputeType_StatusKubernetes, + ComputeType_StatusSynapseSpark, + ComputeType_StatusVirtualMachine)) + gens["CreatedOn"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["IsAttachedCompute"] = gen.PtrOf(gen.Bool()) + gens["ModifiedOn"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.OneConstOf( + ComputeStatusProvisioningStateCanceled, + ComputeStatusProvisioningStateCreating, + ComputeStatusProvisioningStateDeleting, + ComputeStatusProvisioningStateFailed, + ComputeStatusProvisioningStateSucceeded, + ComputeStatusProvisioningStateUnknown, + ComputeStatusProvisioningStateUpdating)) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeStatus(gens map[string]gopter.Gen) { + gens["ProvisioningErrors"] = gen.SliceOf(ErrorResponseStatusGenerator()) +} + +func Test_Compute_AKS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_AKS to Compute_AKS via AssignPropertiesToComputeAKS & AssignPropertiesFromComputeAKS returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeAKS, ComputeAKSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeAKS tests if a specific instance of Compute_AKS can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeAKS(subject Compute_AKS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_AKS + err := copied.AssignPropertiesToComputeAKS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_AKS + err = actual.AssignPropertiesFromComputeAKS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_AKS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_AKS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeAKS, ComputeAKSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeAKS runs a test to see if a specific instance of Compute_AKS round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeAKS(subject Compute_AKS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_AKS + 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 Compute_AKS instances for property testing - lazily instantiated by ComputeAKSGenerator() +var computeAKSGenerator gopter.Gen + +// ComputeAKSGenerator returns a generator of Compute_AKS instances for property testing. +// We first initialize computeAKSGenerator 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 ComputeAKSGenerator() gopter.Gen { + if computeAKSGenerator != nil { + return computeAKSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAKS(generators) + computeAKSGenerator = gen.Struct(reflect.TypeOf(Compute_AKS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAKS(generators) + AddRelatedPropertyGeneratorsForComputeAKS(generators) + computeAKSGenerator = gen.Struct(reflect.TypeOf(Compute_AKS{}), generators) + + return computeAKSGenerator +} + +// AddIndependentPropertyGeneratorsForComputeAKS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeAKS(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeAKSComputeTypeAKS)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeAKS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeAKS(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(AKSPropertiesGenerator()) +} + +func Test_Compute_AmlCompute_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_AmlCompute to Compute_AmlCompute via AssignPropertiesToComputeAmlCompute & AssignPropertiesFromComputeAmlCompute returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeAmlCompute, ComputeAmlComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeAmlCompute tests if a specific instance of Compute_AmlCompute can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeAmlCompute(subject Compute_AmlCompute) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_AmlCompute + err := copied.AssignPropertiesToComputeAmlCompute(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_AmlCompute + err = actual.AssignPropertiesFromComputeAmlCompute(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_AmlCompute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_AmlCompute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeAmlCompute, ComputeAmlComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeAmlCompute runs a test to see if a specific instance of Compute_AmlCompute round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeAmlCompute(subject Compute_AmlCompute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_AmlCompute + 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 Compute_AmlCompute instances for property testing - lazily instantiated by ComputeAmlComputeGenerator() +var computeAmlComputeGenerator gopter.Gen + +// ComputeAmlComputeGenerator returns a generator of Compute_AmlCompute instances for property testing. +// We first initialize computeAmlComputeGenerator 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 ComputeAmlComputeGenerator() gopter.Gen { + if computeAmlComputeGenerator != nil { + return computeAmlComputeGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAmlCompute(generators) + computeAmlComputeGenerator = gen.Struct(reflect.TypeOf(Compute_AmlCompute{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAmlCompute(generators) + AddRelatedPropertyGeneratorsForComputeAmlCompute(generators) + computeAmlComputeGenerator = gen.Struct(reflect.TypeOf(Compute_AmlCompute{}), generators) + + return computeAmlComputeGenerator +} + +// AddIndependentPropertyGeneratorsForComputeAmlCompute is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeAmlCompute(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeAmlComputeComputeTypeAmlCompute)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeAmlCompute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeAmlCompute(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(AmlComputePropertiesGenerator()) +} + +func Test_Compute_ComputeInstance_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_ComputeInstance to Compute_ComputeInstance via AssignPropertiesToComputeComputeInstance & AssignPropertiesFromComputeComputeInstance returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeComputeInstance, ComputeComputeInstanceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeComputeInstance tests if a specific instance of Compute_ComputeInstance can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeComputeInstance(subject Compute_ComputeInstance) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_ComputeInstance + err := copied.AssignPropertiesToComputeComputeInstance(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_ComputeInstance + err = actual.AssignPropertiesFromComputeComputeInstance(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_ComputeInstance_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_ComputeInstance via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeComputeInstance, ComputeComputeInstanceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeComputeInstance runs a test to see if a specific instance of Compute_ComputeInstance round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeComputeInstance(subject Compute_ComputeInstance) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_ComputeInstance + 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 Compute_ComputeInstance instances for property testing - lazily instantiated by +// ComputeComputeInstanceGenerator() +var computeComputeInstanceGenerator gopter.Gen + +// ComputeComputeInstanceGenerator returns a generator of Compute_ComputeInstance instances for property testing. +// We first initialize computeComputeInstanceGenerator 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 ComputeComputeInstanceGenerator() gopter.Gen { + if computeComputeInstanceGenerator != nil { + return computeComputeInstanceGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeComputeInstance(generators) + computeComputeInstanceGenerator = gen.Struct(reflect.TypeOf(Compute_ComputeInstance{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeComputeInstance(generators) + AddRelatedPropertyGeneratorsForComputeComputeInstance(generators) + computeComputeInstanceGenerator = gen.Struct(reflect.TypeOf(Compute_ComputeInstance{}), generators) + + return computeComputeInstanceGenerator +} + +// AddIndependentPropertyGeneratorsForComputeComputeInstance is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeComputeInstance(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeComputeInstanceComputeTypeComputeInstance)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeComputeInstance is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeComputeInstance(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(ComputeInstancePropertiesGenerator()) +} + +func Test_Compute_DataFactory_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_DataFactory to Compute_DataFactory via AssignPropertiesToComputeDataFactory & AssignPropertiesFromComputeDataFactory returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeDataFactory, ComputeDataFactoryGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeDataFactory tests if a specific instance of Compute_DataFactory can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeDataFactory(subject Compute_DataFactory) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_DataFactory + err := copied.AssignPropertiesToComputeDataFactory(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_DataFactory + err = actual.AssignPropertiesFromComputeDataFactory(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_DataFactory_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_DataFactory via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDataFactory, ComputeDataFactoryGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDataFactory runs a test to see if a specific instance of Compute_DataFactory round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDataFactory(subject Compute_DataFactory) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_DataFactory + 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 Compute_DataFactory instances for property testing - lazily instantiated by ComputeDataFactoryGenerator() +var computeDataFactoryGenerator gopter.Gen + +// ComputeDataFactoryGenerator returns a generator of Compute_DataFactory instances for property testing. +func ComputeDataFactoryGenerator() gopter.Gen { + if computeDataFactoryGenerator != nil { + return computeDataFactoryGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataFactory(generators) + computeDataFactoryGenerator = gen.Struct(reflect.TypeOf(Compute_DataFactory{}), generators) + + return computeDataFactoryGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDataFactory is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDataFactory(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeDataFactoryComputeTypeDataFactory)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +func Test_Compute_DataLakeAnalytics_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_DataLakeAnalytics to Compute_DataLakeAnalytics via AssignPropertiesToComputeDataLakeAnalytics & AssignPropertiesFromComputeDataLakeAnalytics returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeDataLakeAnalytics, ComputeDataLakeAnalyticsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeDataLakeAnalytics tests if a specific instance of Compute_DataLakeAnalytics can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeDataLakeAnalytics(subject Compute_DataLakeAnalytics) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_DataLakeAnalytics + err := copied.AssignPropertiesToComputeDataLakeAnalytics(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_DataLakeAnalytics + err = actual.AssignPropertiesFromComputeDataLakeAnalytics(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_DataLakeAnalytics_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_DataLakeAnalytics via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDataLakeAnalytics, ComputeDataLakeAnalyticsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDataLakeAnalytics runs a test to see if a specific instance of Compute_DataLakeAnalytics round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDataLakeAnalytics(subject Compute_DataLakeAnalytics) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_DataLakeAnalytics + 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 Compute_DataLakeAnalytics instances for property testing - lazily instantiated by +// ComputeDataLakeAnalyticsGenerator() +var computeDataLakeAnalyticsGenerator gopter.Gen + +// ComputeDataLakeAnalyticsGenerator returns a generator of Compute_DataLakeAnalytics instances for property testing. +// We first initialize computeDataLakeAnalyticsGenerator 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 ComputeDataLakeAnalyticsGenerator() gopter.Gen { + if computeDataLakeAnalyticsGenerator != nil { + return computeDataLakeAnalyticsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics(generators) + computeDataLakeAnalyticsGenerator = gen.Struct(reflect.TypeOf(Compute_DataLakeAnalytics{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics(generators) + AddRelatedPropertyGeneratorsForComputeDataLakeAnalytics(generators) + computeDataLakeAnalyticsGenerator = gen.Struct(reflect.TypeOf(Compute_DataLakeAnalytics{}), generators) + + return computeDataLakeAnalyticsGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeDataLakeAnalyticsComputeTypeDataLakeAnalytics)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeDataLakeAnalytics is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeDataLakeAnalytics(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(DataLakeAnalyticsPropertiesGenerator()) +} + +func Test_Compute_Databricks_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_Databricks to Compute_Databricks via AssignPropertiesToComputeDatabricks & AssignPropertiesFromComputeDatabricks returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeDatabricks, ComputeDatabricksGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeDatabricks tests if a specific instance of Compute_Databricks can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeDatabricks(subject Compute_Databricks) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_Databricks + err := copied.AssignPropertiesToComputeDatabricks(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_Databricks + err = actual.AssignPropertiesFromComputeDatabricks(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_Databricks_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_Databricks via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDatabricks, ComputeDatabricksGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDatabricks runs a test to see if a specific instance of Compute_Databricks round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDatabricks(subject Compute_Databricks) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_Databricks + 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 Compute_Databricks instances for property testing - lazily instantiated by ComputeDatabricksGenerator() +var computeDatabricksGenerator gopter.Gen + +// ComputeDatabricksGenerator returns a generator of Compute_Databricks instances for property testing. +// We first initialize computeDatabricksGenerator 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 ComputeDatabricksGenerator() gopter.Gen { + if computeDatabricksGenerator != nil { + return computeDatabricksGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDatabricks(generators) + computeDatabricksGenerator = gen.Struct(reflect.TypeOf(Compute_Databricks{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDatabricks(generators) + AddRelatedPropertyGeneratorsForComputeDatabricks(generators) + computeDatabricksGenerator = gen.Struct(reflect.TypeOf(Compute_Databricks{}), generators) + + return computeDatabricksGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDatabricks is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDatabricks(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeDatabricksComputeTypeDatabricks)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeDatabricks is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeDatabricks(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(DatabricksPropertiesGenerator()) +} + +func Test_Compute_HDInsight_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_HDInsight to Compute_HDInsight via AssignPropertiesToComputeHDInsight & AssignPropertiesFromComputeHDInsight returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeHDInsight, ComputeHDInsightGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeHDInsight tests if a specific instance of Compute_HDInsight can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeHDInsight(subject Compute_HDInsight) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_HDInsight + err := copied.AssignPropertiesToComputeHDInsight(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_HDInsight + err = actual.AssignPropertiesFromComputeHDInsight(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_HDInsight_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_HDInsight via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeHDInsight, ComputeHDInsightGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeHDInsight runs a test to see if a specific instance of Compute_HDInsight round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeHDInsight(subject Compute_HDInsight) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_HDInsight + 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 Compute_HDInsight instances for property testing - lazily instantiated by ComputeHDInsightGenerator() +var computeHDInsightGenerator gopter.Gen + +// ComputeHDInsightGenerator returns a generator of Compute_HDInsight instances for property testing. +// We first initialize computeHDInsightGenerator 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 ComputeHDInsightGenerator() gopter.Gen { + if computeHDInsightGenerator != nil { + return computeHDInsightGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeHDInsight(generators) + computeHDInsightGenerator = gen.Struct(reflect.TypeOf(Compute_HDInsight{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeHDInsight(generators) + AddRelatedPropertyGeneratorsForComputeHDInsight(generators) + computeHDInsightGenerator = gen.Struct(reflect.TypeOf(Compute_HDInsight{}), generators) + + return computeHDInsightGenerator +} + +// AddIndependentPropertyGeneratorsForComputeHDInsight is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeHDInsight(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeHDInsightComputeTypeHDInsight)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeHDInsight is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeHDInsight(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(HDInsightPropertiesGenerator()) +} + +func Test_Compute_SynapseSpark_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_SynapseSpark to Compute_SynapseSpark via AssignPropertiesToComputeSynapseSpark & AssignPropertiesFromComputeSynapseSpark returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeSynapseSpark, ComputeSynapseSparkGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeSynapseSpark tests if a specific instance of Compute_SynapseSpark can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeSynapseSpark(subject Compute_SynapseSpark) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_SynapseSpark + err := copied.AssignPropertiesToComputeSynapseSpark(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_SynapseSpark + err = actual.AssignPropertiesFromComputeSynapseSpark(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_SynapseSpark_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_SynapseSpark via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeSynapseSpark, ComputeSynapseSparkGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeSynapseSpark runs a test to see if a specific instance of Compute_SynapseSpark round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeSynapseSpark(subject Compute_SynapseSpark) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_SynapseSpark + 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 Compute_SynapseSpark instances for property testing - lazily instantiated by +// ComputeSynapseSparkGenerator() +var computeSynapseSparkGenerator gopter.Gen + +// ComputeSynapseSparkGenerator returns a generator of Compute_SynapseSpark instances for property testing. +// We first initialize computeSynapseSparkGenerator 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 ComputeSynapseSparkGenerator() gopter.Gen { + if computeSynapseSparkGenerator != nil { + return computeSynapseSparkGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeSynapseSpark(generators) + computeSynapseSparkGenerator = gen.Struct(reflect.TypeOf(Compute_SynapseSpark{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeSynapseSpark(generators) + AddRelatedPropertyGeneratorsForComputeSynapseSpark(generators) + computeSynapseSparkGenerator = gen.Struct(reflect.TypeOf(Compute_SynapseSpark{}), generators) + + return computeSynapseSparkGenerator +} + +// AddIndependentPropertyGeneratorsForComputeSynapseSpark is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeSynapseSpark(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeSynapseSparkComputeTypeSynapseSpark)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeSynapseSpark is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeSynapseSpark(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SynapseSparkPropertiesGenerator()) +} + +func Test_Compute_VirtualMachine_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Compute_VirtualMachine to Compute_VirtualMachine via AssignPropertiesToComputeVirtualMachine & AssignPropertiesFromComputeVirtualMachine returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeVirtualMachine, ComputeVirtualMachineGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeVirtualMachine tests if a specific instance of Compute_VirtualMachine can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeVirtualMachine(subject Compute_VirtualMachine) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.Compute_VirtualMachine + err := copied.AssignPropertiesToComputeVirtualMachine(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Compute_VirtualMachine + err = actual.AssignPropertiesFromComputeVirtualMachine(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Compute_VirtualMachine_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_VirtualMachine via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeVirtualMachine, ComputeVirtualMachineGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeVirtualMachine runs a test to see if a specific instance of Compute_VirtualMachine round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeVirtualMachine(subject Compute_VirtualMachine) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_VirtualMachine + 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 Compute_VirtualMachine instances for property testing - lazily instantiated by +// ComputeVirtualMachineGenerator() +var computeVirtualMachineGenerator gopter.Gen + +// ComputeVirtualMachineGenerator returns a generator of Compute_VirtualMachine instances for property testing. +// We first initialize computeVirtualMachineGenerator 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 ComputeVirtualMachineGenerator() gopter.Gen { + if computeVirtualMachineGenerator != nil { + return computeVirtualMachineGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeVirtualMachine(generators) + computeVirtualMachineGenerator = gen.Struct(reflect.TypeOf(Compute_VirtualMachine{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeVirtualMachine(generators) + AddRelatedPropertyGeneratorsForComputeVirtualMachine(generators) + computeVirtualMachineGenerator = gen.Struct(reflect.TypeOf(Compute_VirtualMachine{}), generators) + + return computeVirtualMachineGenerator +} + +// AddIndependentPropertyGeneratorsForComputeVirtualMachine is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeVirtualMachine(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.OneConstOf(ComputeVirtualMachineComputeTypeVirtualMachine)) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeVirtualMachine is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeVirtualMachine(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(VirtualMachinePropertiesGenerator()) +} + +func Test_ErrorResponse_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ErrorResponse_Status to ErrorResponse_Status via AssignPropertiesToErrorResponseStatus & AssignPropertiesFromErrorResponseStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForErrorResponseStatus, ErrorResponseStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForErrorResponseStatus tests if a specific instance of ErrorResponse_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForErrorResponseStatus(subject ErrorResponse_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 v20210701s.ErrorResponse_Status + err := copied.AssignPropertiesToErrorResponseStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ErrorResponse_Status + err = actual.AssignPropertiesFromErrorResponseStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ErrorResponse_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorResponse_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorResponseStatus, ErrorResponseStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorResponseStatus runs a test to see if a specific instance of ErrorResponse_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorResponseStatus(subject ErrorResponse_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorResponse_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 ErrorResponse_Status instances for property testing - lazily instantiated by +// ErrorResponseStatusGenerator() +var errorResponseStatusGenerator gopter.Gen + +// ErrorResponseStatusGenerator returns a generator of ErrorResponse_Status instances for property testing. +func ErrorResponseStatusGenerator() gopter.Gen { + if errorResponseStatusGenerator != nil { + return errorResponseStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForErrorResponseStatus(generators) + errorResponseStatusGenerator = gen.Struct(reflect.TypeOf(ErrorResponse_Status{}), generators) + + return errorResponseStatusGenerator +} + +// AddRelatedPropertyGeneratorsForErrorResponseStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorResponseStatus(gens map[string]gopter.Gen) { + gens["Error"] = gen.PtrOf(ErrorDetailStatusGenerator()) +} + +func Test_AKSProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from AKSProperties to AKSProperties via AssignPropertiesToAKSProperties & AssignPropertiesFromAKSProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForAKSProperties, AKSPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAKSProperties tests if a specific instance of AKSProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForAKSProperties(subject AKSProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.AKSProperties + err := copied.AssignPropertiesToAKSProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual AKSProperties + err = actual.AssignPropertiesFromAKSProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_AKSProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AKSProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAKSProperties, AKSPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAKSProperties runs a test to see if a specific instance of AKSProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAKSProperties(subject AKSProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AKSProperties + 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 AKSProperties instances for property testing - lazily instantiated by AKSPropertiesGenerator() +var aksPropertiesGenerator gopter.Gen + +// AKSPropertiesGenerator returns a generator of AKSProperties instances for property testing. +// We first initialize aksPropertiesGenerator 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 AKSPropertiesGenerator() gopter.Gen { + if aksPropertiesGenerator != nil { + return aksPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAKSProperties(generators) + aksPropertiesGenerator = gen.Struct(reflect.TypeOf(AKSProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAKSProperties(generators) + AddRelatedPropertyGeneratorsForAKSProperties(generators) + aksPropertiesGenerator = gen.Struct(reflect.TypeOf(AKSProperties{}), generators) + + return aksPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAKSProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAKSProperties(gens map[string]gopter.Gen) { + gens["AgentCount"] = gen.PtrOf(gen.Int()) + gens["AgentVmSize"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterFqdn"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterPurpose"] = gen.PtrOf(gen.OneConstOf(AKSPropertiesClusterPurposeDenseProd, AKSPropertiesClusterPurposeDevTest, AKSPropertiesClusterPurposeFastProd)) + gens["LoadBalancerSubnet"] = gen.PtrOf(gen.AlphaString()) + gens["LoadBalancerType"] = gen.PtrOf(gen.OneConstOf(AKSPropertiesLoadBalancerTypeInternalLoadBalancer, AKSPropertiesLoadBalancerTypePublicIp)) +} + +// AddRelatedPropertyGeneratorsForAKSProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForAKSProperties(gens map[string]gopter.Gen) { + gens["AksNetworkingConfiguration"] = gen.PtrOf(AksNetworkingConfigurationGenerator()) + gens["SslConfiguration"] = gen.PtrOf(SslConfigurationGenerator()) +} + +func Test_AmlComputeProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from AmlComputeProperties to AmlComputeProperties via AssignPropertiesToAmlComputeProperties & AssignPropertiesFromAmlComputeProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForAmlComputeProperties, AmlComputePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAmlComputeProperties tests if a specific instance of AmlComputeProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForAmlComputeProperties(subject AmlComputeProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.AmlComputeProperties + err := copied.AssignPropertiesToAmlComputeProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual AmlComputeProperties + err = actual.AssignPropertiesFromAmlComputeProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_AmlComputeProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AmlComputeProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAmlComputeProperties, AmlComputePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAmlComputeProperties runs a test to see if a specific instance of AmlComputeProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAmlComputeProperties(subject AmlComputeProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AmlComputeProperties + 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 AmlComputeProperties instances for property testing - lazily instantiated by +// AmlComputePropertiesGenerator() +var amlComputePropertiesGenerator gopter.Gen + +// AmlComputePropertiesGenerator returns a generator of AmlComputeProperties instances for property testing. +// We first initialize amlComputePropertiesGenerator 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 AmlComputePropertiesGenerator() gopter.Gen { + if amlComputePropertiesGenerator != nil { + return amlComputePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAmlComputeProperties(generators) + amlComputePropertiesGenerator = gen.Struct(reflect.TypeOf(AmlComputeProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAmlComputeProperties(generators) + AddRelatedPropertyGeneratorsForAmlComputeProperties(generators) + amlComputePropertiesGenerator = gen.Struct(reflect.TypeOf(AmlComputeProperties{}), generators) + + return amlComputePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAmlComputeProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAmlComputeProperties(gens map[string]gopter.Gen) { + gens["EnableNodePublicIp"] = gen.PtrOf(gen.Bool()) + gens["IsolatedNetwork"] = gen.PtrOf(gen.Bool()) + gens["OsType"] = gen.PtrOf(gen.OneConstOf(AmlComputePropertiesOsTypeLinux, AmlComputePropertiesOsTypeWindows)) + gens["RemoteLoginPortPublicAccess"] = gen.PtrOf(gen.OneConstOf(AmlComputePropertiesRemoteLoginPortPublicAccessDisabled, AmlComputePropertiesRemoteLoginPortPublicAccessEnabled, AmlComputePropertiesRemoteLoginPortPublicAccessNotSpecified)) + gens["VmPriority"] = gen.PtrOf(gen.OneConstOf(AmlComputePropertiesVmPriorityDedicated, AmlComputePropertiesVmPriorityLowPriority)) + gens["VmSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForAmlComputeProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForAmlComputeProperties(gens map[string]gopter.Gen) { + gens["ScaleSettings"] = gen.PtrOf(ScaleSettingsGenerator()) + gens["Subnet"] = gen.PtrOf(ResourceIdGenerator()) + gens["UserAccountCredentials"] = gen.PtrOf(UserAccountCredentialsGenerator()) + gens["VirtualMachineImage"] = gen.PtrOf(VirtualMachineImageGenerator()) +} + +func Test_ComputeInstanceProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ComputeInstanceProperties to ComputeInstanceProperties via AssignPropertiesToComputeInstanceProperties & AssignPropertiesFromComputeInstanceProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeInstanceProperties, ComputeInstancePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeInstanceProperties tests if a specific instance of ComputeInstanceProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeInstanceProperties(subject ComputeInstanceProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ComputeInstanceProperties + err := copied.AssignPropertiesToComputeInstanceProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ComputeInstanceProperties + err = actual.AssignPropertiesFromComputeInstanceProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ComputeInstanceProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeInstanceProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeInstanceProperties, ComputeInstancePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeInstanceProperties runs a test to see if a specific instance of ComputeInstanceProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeInstanceProperties(subject ComputeInstanceProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeInstanceProperties + 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 ComputeInstanceProperties instances for property testing - lazily instantiated by +// ComputeInstancePropertiesGenerator() +var computeInstancePropertiesGenerator gopter.Gen + +// ComputeInstancePropertiesGenerator returns a generator of ComputeInstanceProperties instances for property testing. +// We first initialize computeInstancePropertiesGenerator 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 ComputeInstancePropertiesGenerator() gopter.Gen { + if computeInstancePropertiesGenerator != nil { + return computeInstancePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstanceProperties(generators) + computeInstancePropertiesGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstanceProperties(generators) + AddRelatedPropertyGeneratorsForComputeInstanceProperties(generators) + computeInstancePropertiesGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceProperties{}), generators) + + return computeInstancePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForComputeInstanceProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeInstanceProperties(gens map[string]gopter.Gen) { + gens["ApplicationSharingPolicy"] = gen.PtrOf(gen.OneConstOf(ComputeInstancePropertiesApplicationSharingPolicyPersonal, ComputeInstancePropertiesApplicationSharingPolicyShared)) + gens["ComputeInstanceAuthorizationType"] = gen.PtrOf(gen.OneConstOf(ComputeInstancePropertiesComputeInstanceAuthorizationTypePersonal)) + gens["VmSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeInstanceProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeInstanceProperties(gens map[string]gopter.Gen) { + gens["PersonalComputeInstanceSettings"] = gen.PtrOf(PersonalComputeInstanceSettingsGenerator()) + gens["SetupScripts"] = gen.PtrOf(SetupScriptsGenerator()) + gens["SshSettings"] = gen.PtrOf(ComputeInstanceSshSettingsGenerator()) + gens["Subnet"] = gen.PtrOf(ResourceIdGenerator()) +} + +func Test_DataLakeAnalyticsProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from DataLakeAnalyticsProperties to DataLakeAnalyticsProperties via AssignPropertiesToDataLakeAnalyticsProperties & AssignPropertiesFromDataLakeAnalyticsProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForDataLakeAnalyticsProperties, DataLakeAnalyticsPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDataLakeAnalyticsProperties tests if a specific instance of DataLakeAnalyticsProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForDataLakeAnalyticsProperties(subject DataLakeAnalyticsProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.DataLakeAnalyticsProperties + err := copied.AssignPropertiesToDataLakeAnalyticsProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual DataLakeAnalyticsProperties + err = actual.AssignPropertiesFromDataLakeAnalyticsProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_DataLakeAnalyticsProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of DataLakeAnalyticsProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDataLakeAnalyticsProperties, DataLakeAnalyticsPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDataLakeAnalyticsProperties runs a test to see if a specific instance of DataLakeAnalyticsProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForDataLakeAnalyticsProperties(subject DataLakeAnalyticsProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual DataLakeAnalyticsProperties + 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 DataLakeAnalyticsProperties instances for property testing - lazily instantiated by +// DataLakeAnalyticsPropertiesGenerator() +var dataLakeAnalyticsPropertiesGenerator gopter.Gen + +// DataLakeAnalyticsPropertiesGenerator returns a generator of DataLakeAnalyticsProperties instances for property testing. +func DataLakeAnalyticsPropertiesGenerator() gopter.Gen { + if dataLakeAnalyticsPropertiesGenerator != nil { + return dataLakeAnalyticsPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDataLakeAnalyticsProperties(generators) + dataLakeAnalyticsPropertiesGenerator = gen.Struct(reflect.TypeOf(DataLakeAnalyticsProperties{}), generators) + + return dataLakeAnalyticsPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForDataLakeAnalyticsProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDataLakeAnalyticsProperties(gens map[string]gopter.Gen) { + gens["DataLakeStoreAccountName"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_DatabricksProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from DatabricksProperties to DatabricksProperties via AssignPropertiesToDatabricksProperties & AssignPropertiesFromDatabricksProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForDatabricksProperties, DatabricksPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDatabricksProperties tests if a specific instance of DatabricksProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForDatabricksProperties(subject DatabricksProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.DatabricksProperties + err := copied.AssignPropertiesToDatabricksProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual DatabricksProperties + err = actual.AssignPropertiesFromDatabricksProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_DatabricksProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of DatabricksProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDatabricksProperties, DatabricksPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDatabricksProperties runs a test to see if a specific instance of DatabricksProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForDatabricksProperties(subject DatabricksProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual DatabricksProperties + 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 DatabricksProperties instances for property testing - lazily instantiated by +// DatabricksPropertiesGenerator() +var databricksPropertiesGenerator gopter.Gen + +// DatabricksPropertiesGenerator returns a generator of DatabricksProperties instances for property testing. +func DatabricksPropertiesGenerator() gopter.Gen { + if databricksPropertiesGenerator != nil { + return databricksPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDatabricksProperties(generators) + databricksPropertiesGenerator = gen.Struct(reflect.TypeOf(DatabricksProperties{}), generators) + + return databricksPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForDatabricksProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDatabricksProperties(gens map[string]gopter.Gen) { + gens["DatabricksAccessToken"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceUrl"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ErrorDetail_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ErrorDetail_Status to ErrorDetail_Status via AssignPropertiesToErrorDetailStatus & AssignPropertiesFromErrorDetailStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForErrorDetailStatus, ErrorDetailStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForErrorDetailStatus tests if a specific instance of ErrorDetail_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForErrorDetailStatus(subject ErrorDetail_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 v20210701s.ErrorDetail_Status + err := copied.AssignPropertiesToErrorDetailStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ErrorDetail_Status + err = actual.AssignPropertiesFromErrorDetailStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ErrorDetail_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorDetail_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorDetailStatus, ErrorDetailStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorDetailStatus runs a test to see if a specific instance of ErrorDetail_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorDetailStatus(subject ErrorDetail_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorDetail_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 ErrorDetail_Status instances for property testing - lazily instantiated by ErrorDetailStatusGenerator() +var errorDetailStatusGenerator gopter.Gen + +// ErrorDetailStatusGenerator returns a generator of ErrorDetail_Status instances for property testing. +// We first initialize errorDetailStatusGenerator 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 ErrorDetailStatusGenerator() gopter.Gen { + if errorDetailStatusGenerator != nil { + return errorDetailStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatus(generators) + errorDetailStatusGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatus(generators) + AddRelatedPropertyGeneratorsForErrorDetailStatus(generators) + errorDetailStatusGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status{}), generators) + + return errorDetailStatusGenerator +} + +// AddIndependentPropertyGeneratorsForErrorDetailStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorDetailStatus(gens map[string]gopter.Gen) { + gens["Code"] = gen.PtrOf(gen.AlphaString()) + gens["Message"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForErrorDetailStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorDetailStatus(gens map[string]gopter.Gen) { + gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusGenerator()) + gens["Details"] = gen.SliceOf(ErrorDetailStatusUnrolledGenerator()) +} + +func Test_HDInsightProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from HDInsightProperties to HDInsightProperties via AssignPropertiesToHDInsightProperties & AssignPropertiesFromHDInsightProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForHDInsightProperties, HDInsightPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForHDInsightProperties tests if a specific instance of HDInsightProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForHDInsightProperties(subject HDInsightProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.HDInsightProperties + err := copied.AssignPropertiesToHDInsightProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual HDInsightProperties + err = actual.AssignPropertiesFromHDInsightProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_HDInsightProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of HDInsightProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForHDInsightProperties, HDInsightPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForHDInsightProperties runs a test to see if a specific instance of HDInsightProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForHDInsightProperties(subject HDInsightProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual HDInsightProperties + 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 HDInsightProperties instances for property testing - lazily instantiated by +// HDInsightPropertiesGenerator() +var hdInsightPropertiesGenerator gopter.Gen + +// HDInsightPropertiesGenerator returns a generator of HDInsightProperties instances for property testing. +// We first initialize hdInsightPropertiesGenerator 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 HDInsightPropertiesGenerator() gopter.Gen { + if hdInsightPropertiesGenerator != nil { + return hdInsightPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForHDInsightProperties(generators) + hdInsightPropertiesGenerator = gen.Struct(reflect.TypeOf(HDInsightProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForHDInsightProperties(generators) + AddRelatedPropertyGeneratorsForHDInsightProperties(generators) + hdInsightPropertiesGenerator = gen.Struct(reflect.TypeOf(HDInsightProperties{}), generators) + + return hdInsightPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForHDInsightProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForHDInsightProperties(gens map[string]gopter.Gen) { + gens["Address"] = gen.PtrOf(gen.AlphaString()) + gens["SshPort"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForHDInsightProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForHDInsightProperties(gens map[string]gopter.Gen) { + gens["AdministratorAccount"] = gen.PtrOf(VirtualMachineSshCredentialsGenerator()) +} + +func Test_SynapseSparkProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SynapseSparkProperties to SynapseSparkProperties via AssignPropertiesToSynapseSparkProperties & AssignPropertiesFromSynapseSparkProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForSynapseSparkProperties, SynapseSparkPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSynapseSparkProperties tests if a specific instance of SynapseSparkProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSynapseSparkProperties(subject SynapseSparkProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.SynapseSparkProperties + err := copied.AssignPropertiesToSynapseSparkProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SynapseSparkProperties + err = actual.AssignPropertiesFromSynapseSparkProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SynapseSparkProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SynapseSparkProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSynapseSparkProperties, SynapseSparkPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSynapseSparkProperties runs a test to see if a specific instance of SynapseSparkProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSynapseSparkProperties(subject SynapseSparkProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SynapseSparkProperties + 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 SynapseSparkProperties instances for property testing - lazily instantiated by +// SynapseSparkPropertiesGenerator() +var synapseSparkPropertiesGenerator gopter.Gen + +// SynapseSparkPropertiesGenerator returns a generator of SynapseSparkProperties instances for property testing. +// We first initialize synapseSparkPropertiesGenerator 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 SynapseSparkPropertiesGenerator() gopter.Gen { + if synapseSparkPropertiesGenerator != nil { + return synapseSparkPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSynapseSparkProperties(generators) + synapseSparkPropertiesGenerator = gen.Struct(reflect.TypeOf(SynapseSparkProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSynapseSparkProperties(generators) + AddRelatedPropertyGeneratorsForSynapseSparkProperties(generators) + synapseSparkPropertiesGenerator = gen.Struct(reflect.TypeOf(SynapseSparkProperties{}), generators) + + return synapseSparkPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSynapseSparkProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSynapseSparkProperties(gens map[string]gopter.Gen) { + gens["NodeCount"] = gen.PtrOf(gen.Int()) + gens["NodeSize"] = gen.PtrOf(gen.AlphaString()) + gens["NodeSizeFamily"] = gen.PtrOf(gen.AlphaString()) + gens["PoolName"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceGroup"] = gen.PtrOf(gen.AlphaString()) + gens["SparkVersion"] = gen.PtrOf(gen.AlphaString()) + gens["SubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceName"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSynapseSparkProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSynapseSparkProperties(gens map[string]gopter.Gen) { + gens["AutoPauseProperties"] = gen.PtrOf(AutoPausePropertiesGenerator()) + gens["AutoScaleProperties"] = gen.PtrOf(AutoScalePropertiesGenerator()) +} + +func Test_VirtualMachineProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from VirtualMachineProperties to VirtualMachineProperties via AssignPropertiesToVirtualMachineProperties & AssignPropertiesFromVirtualMachineProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForVirtualMachineProperties, VirtualMachinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForVirtualMachineProperties tests if a specific instance of VirtualMachineProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForVirtualMachineProperties(subject VirtualMachineProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.VirtualMachineProperties + err := copied.AssignPropertiesToVirtualMachineProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual VirtualMachineProperties + err = actual.AssignPropertiesFromVirtualMachineProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_VirtualMachineProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineProperties, VirtualMachinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineProperties runs a test to see if a specific instance of VirtualMachineProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineProperties(subject VirtualMachineProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineProperties + 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 VirtualMachineProperties instances for property testing - lazily instantiated by +// VirtualMachinePropertiesGenerator() +var virtualMachinePropertiesGenerator gopter.Gen + +// VirtualMachinePropertiesGenerator returns a generator of VirtualMachineProperties instances for property testing. +// We first initialize virtualMachinePropertiesGenerator 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 VirtualMachinePropertiesGenerator() gopter.Gen { + if virtualMachinePropertiesGenerator != nil { + return virtualMachinePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineProperties(generators) + virtualMachinePropertiesGenerator = gen.Struct(reflect.TypeOf(VirtualMachineProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineProperties(generators) + AddRelatedPropertyGeneratorsForVirtualMachineProperties(generators) + virtualMachinePropertiesGenerator = gen.Struct(reflect.TypeOf(VirtualMachineProperties{}), generators) + + return virtualMachinePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForVirtualMachineProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForVirtualMachineProperties(gens map[string]gopter.Gen) { + gens["Address"] = gen.PtrOf(gen.AlphaString()) + gens["IsNotebookInstanceCompute"] = gen.PtrOf(gen.Bool()) + gens["SshPort"] = gen.PtrOf(gen.Int()) + gens["VirtualMachineSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForVirtualMachineProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForVirtualMachineProperties(gens map[string]gopter.Gen) { + gens["AdministratorAccount"] = gen.PtrOf(VirtualMachineSshCredentialsGenerator()) +} + +func Test_AksNetworkingConfiguration_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from AksNetworkingConfiguration to AksNetworkingConfiguration via AssignPropertiesToAksNetworkingConfiguration & AssignPropertiesFromAksNetworkingConfiguration returns original", + prop.ForAll(RunPropertyAssignmentTestForAksNetworkingConfiguration, AksNetworkingConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAksNetworkingConfiguration tests if a specific instance of AksNetworkingConfiguration can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForAksNetworkingConfiguration(subject AksNetworkingConfiguration) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.AksNetworkingConfiguration + err := copied.AssignPropertiesToAksNetworkingConfiguration(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual AksNetworkingConfiguration + err = actual.AssignPropertiesFromAksNetworkingConfiguration(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_AksNetworkingConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AksNetworkingConfiguration via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAksNetworkingConfiguration, AksNetworkingConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAksNetworkingConfiguration runs a test to see if a specific instance of AksNetworkingConfiguration round trips to JSON and back losslessly +func RunJSONSerializationTestForAksNetworkingConfiguration(subject AksNetworkingConfiguration) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AksNetworkingConfiguration + 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 AksNetworkingConfiguration instances for property testing - lazily instantiated by +// AksNetworkingConfigurationGenerator() +var aksNetworkingConfigurationGenerator gopter.Gen + +// AksNetworkingConfigurationGenerator returns a generator of AksNetworkingConfiguration instances for property testing. +func AksNetworkingConfigurationGenerator() gopter.Gen { + if aksNetworkingConfigurationGenerator != nil { + return aksNetworkingConfigurationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAksNetworkingConfiguration(generators) + aksNetworkingConfigurationGenerator = gen.Struct(reflect.TypeOf(AksNetworkingConfiguration{}), generators) + + return aksNetworkingConfigurationGenerator +} + +// AddIndependentPropertyGeneratorsForAksNetworkingConfiguration is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAksNetworkingConfiguration(gens map[string]gopter.Gen) { + gens["DnsServiceIP"] = gen.PtrOf(gen.AlphaString()) + gens["DockerBridgeCidr"] = gen.PtrOf(gen.AlphaString()) + gens["ServiceCidr"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_AutoPauseProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from AutoPauseProperties to AutoPauseProperties via AssignPropertiesToAutoPauseProperties & AssignPropertiesFromAutoPauseProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForAutoPauseProperties, AutoPausePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAutoPauseProperties tests if a specific instance of AutoPauseProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForAutoPauseProperties(subject AutoPauseProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.AutoPauseProperties + err := copied.AssignPropertiesToAutoPauseProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual AutoPauseProperties + err = actual.AssignPropertiesFromAutoPauseProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_AutoPauseProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AutoPauseProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAutoPauseProperties, AutoPausePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAutoPauseProperties runs a test to see if a specific instance of AutoPauseProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAutoPauseProperties(subject AutoPauseProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AutoPauseProperties + 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 AutoPauseProperties instances for property testing - lazily instantiated by +// AutoPausePropertiesGenerator() +var autoPausePropertiesGenerator gopter.Gen + +// AutoPausePropertiesGenerator returns a generator of AutoPauseProperties instances for property testing. +func AutoPausePropertiesGenerator() gopter.Gen { + if autoPausePropertiesGenerator != nil { + return autoPausePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAutoPauseProperties(generators) + autoPausePropertiesGenerator = gen.Struct(reflect.TypeOf(AutoPauseProperties{}), generators) + + return autoPausePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAutoPauseProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAutoPauseProperties(gens map[string]gopter.Gen) { + gens["DelayInMinutes"] = gen.PtrOf(gen.Int()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) +} + +func Test_AutoScaleProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from AutoScaleProperties to AutoScaleProperties via AssignPropertiesToAutoScaleProperties & AssignPropertiesFromAutoScaleProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForAutoScaleProperties, AutoScalePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAutoScaleProperties tests if a specific instance of AutoScaleProperties can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForAutoScaleProperties(subject AutoScaleProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.AutoScaleProperties + err := copied.AssignPropertiesToAutoScaleProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual AutoScaleProperties + err = actual.AssignPropertiesFromAutoScaleProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_AutoScaleProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AutoScaleProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAutoScaleProperties, AutoScalePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAutoScaleProperties runs a test to see if a specific instance of AutoScaleProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAutoScaleProperties(subject AutoScaleProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AutoScaleProperties + 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 AutoScaleProperties instances for property testing - lazily instantiated by +// AutoScalePropertiesGenerator() +var autoScalePropertiesGenerator gopter.Gen + +// AutoScalePropertiesGenerator returns a generator of AutoScaleProperties instances for property testing. +func AutoScalePropertiesGenerator() gopter.Gen { + if autoScalePropertiesGenerator != nil { + return autoScalePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAutoScaleProperties(generators) + autoScalePropertiesGenerator = gen.Struct(reflect.TypeOf(AutoScaleProperties{}), generators) + + return autoScalePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAutoScaleProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAutoScaleProperties(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["MaxNodeCount"] = gen.PtrOf(gen.Int()) + gens["MinNodeCount"] = gen.PtrOf(gen.Int()) +} + +func Test_ComputeInstanceSshSettings_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ComputeInstanceSshSettings to ComputeInstanceSshSettings via AssignPropertiesToComputeInstanceSshSettings & AssignPropertiesFromComputeInstanceSshSettings returns original", + prop.ForAll(RunPropertyAssignmentTestForComputeInstanceSshSettings, ComputeInstanceSshSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForComputeInstanceSshSettings tests if a specific instance of ComputeInstanceSshSettings can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForComputeInstanceSshSettings(subject ComputeInstanceSshSettings) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ComputeInstanceSshSettings + err := copied.AssignPropertiesToComputeInstanceSshSettings(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ComputeInstanceSshSettings + err = actual.AssignPropertiesFromComputeInstanceSshSettings(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ComputeInstanceSshSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeInstanceSshSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeInstanceSshSettings, ComputeInstanceSshSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeInstanceSshSettings runs a test to see if a specific instance of ComputeInstanceSshSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeInstanceSshSettings(subject ComputeInstanceSshSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeInstanceSshSettings + 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 ComputeInstanceSshSettings instances for property testing - lazily instantiated by +// ComputeInstanceSshSettingsGenerator() +var computeInstanceSshSettingsGenerator gopter.Gen + +// ComputeInstanceSshSettingsGenerator returns a generator of ComputeInstanceSshSettings instances for property testing. +func ComputeInstanceSshSettingsGenerator() gopter.Gen { + if computeInstanceSshSettingsGenerator != nil { + return computeInstanceSshSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstanceSshSettings(generators) + computeInstanceSshSettingsGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceSshSettings{}), generators) + + return computeInstanceSshSettingsGenerator +} + +// AddIndependentPropertyGeneratorsForComputeInstanceSshSettings is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeInstanceSshSettings(gens map[string]gopter.Gen) { + gens["AdminPublicKey"] = gen.PtrOf(gen.AlphaString()) + gens["SshPublicAccess"] = gen.PtrOf(gen.OneConstOf(ComputeInstanceSshSettingsSshPublicAccessDisabled, ComputeInstanceSshSettingsSshPublicAccessEnabled)) +} + +func Test_ErrorAdditionalInfo_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ErrorAdditionalInfo_Status to ErrorAdditionalInfo_Status via AssignPropertiesToErrorAdditionalInfoStatus & AssignPropertiesFromErrorAdditionalInfoStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForErrorAdditionalInfoStatus, ErrorAdditionalInfoStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForErrorAdditionalInfoStatus tests if a specific instance of ErrorAdditionalInfo_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForErrorAdditionalInfoStatus(subject ErrorAdditionalInfo_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 v20210701s.ErrorAdditionalInfo_Status + err := copied.AssignPropertiesToErrorAdditionalInfoStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ErrorAdditionalInfo_Status + err = actual.AssignPropertiesFromErrorAdditionalInfoStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ErrorAdditionalInfo_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorAdditionalInfo_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorAdditionalInfoStatus, ErrorAdditionalInfoStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorAdditionalInfoStatus runs a test to see if a specific instance of ErrorAdditionalInfo_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorAdditionalInfoStatus(subject ErrorAdditionalInfo_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorAdditionalInfo_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 ErrorAdditionalInfo_Status instances for property testing - lazily instantiated by +// ErrorAdditionalInfoStatusGenerator() +var errorAdditionalInfoStatusGenerator gopter.Gen + +// ErrorAdditionalInfoStatusGenerator returns a generator of ErrorAdditionalInfo_Status instances for property testing. +func ErrorAdditionalInfoStatusGenerator() gopter.Gen { + if errorAdditionalInfoStatusGenerator != nil { + return errorAdditionalInfoStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatus(generators) + errorAdditionalInfoStatusGenerator = gen.Struct(reflect.TypeOf(ErrorAdditionalInfo_Status{}), generators) + + return errorAdditionalInfoStatusGenerator +} + +// AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatus(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ErrorDetail_Status_Unrolled_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ErrorDetail_Status_Unrolled to ErrorDetail_Status_Unrolled via AssignPropertiesToErrorDetailStatusUnrolled & AssignPropertiesFromErrorDetailStatusUnrolled returns original", + prop.ForAll(RunPropertyAssignmentTestForErrorDetailStatusUnrolled, ErrorDetailStatusUnrolledGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForErrorDetailStatusUnrolled tests if a specific instance of ErrorDetail_Status_Unrolled can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForErrorDetailStatusUnrolled(subject ErrorDetail_Status_Unrolled) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ErrorDetail_Status_Unrolled + err := copied.AssignPropertiesToErrorDetailStatusUnrolled(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ErrorDetail_Status_Unrolled + err = actual.AssignPropertiesFromErrorDetailStatusUnrolled(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ErrorDetail_Status_Unrolled_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorDetail_Status_Unrolled via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorDetailStatusUnrolled, ErrorDetailStatusUnrolledGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorDetailStatusUnrolled runs a test to see if a specific instance of ErrorDetail_Status_Unrolled round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorDetailStatusUnrolled(subject ErrorDetail_Status_Unrolled) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorDetail_Status_Unrolled + 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 ErrorDetail_Status_Unrolled instances for property testing - lazily instantiated by +// ErrorDetailStatusUnrolledGenerator() +var errorDetailStatusUnrolledGenerator gopter.Gen + +// ErrorDetailStatusUnrolledGenerator returns a generator of ErrorDetail_Status_Unrolled instances for property testing. +// We first initialize errorDetailStatusUnrolledGenerator 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 ErrorDetailStatusUnrolledGenerator() gopter.Gen { + if errorDetailStatusUnrolledGenerator != nil { + return errorDetailStatusUnrolledGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled(generators) + errorDetailStatusUnrolledGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_Unrolled{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled(generators) + AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolled(generators) + errorDetailStatusUnrolledGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_Unrolled{}), generators) + + return errorDetailStatusUnrolledGenerator +} + +// AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled(gens map[string]gopter.Gen) { + gens["Code"] = gen.PtrOf(gen.AlphaString()) + gens["Message"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolled is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolled(gens map[string]gopter.Gen) { + gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusGenerator()) +} + +func Test_PersonalComputeInstanceSettings_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PersonalComputeInstanceSettings to PersonalComputeInstanceSettings via AssignPropertiesToPersonalComputeInstanceSettings & AssignPropertiesFromPersonalComputeInstanceSettings returns original", + prop.ForAll(RunPropertyAssignmentTestForPersonalComputeInstanceSettings, PersonalComputeInstanceSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPersonalComputeInstanceSettings tests if a specific instance of PersonalComputeInstanceSettings can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForPersonalComputeInstanceSettings(subject PersonalComputeInstanceSettings) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.PersonalComputeInstanceSettings + err := copied.AssignPropertiesToPersonalComputeInstanceSettings(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual PersonalComputeInstanceSettings + err = actual.AssignPropertiesFromPersonalComputeInstanceSettings(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_PersonalComputeInstanceSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PersonalComputeInstanceSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPersonalComputeInstanceSettings, PersonalComputeInstanceSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPersonalComputeInstanceSettings runs a test to see if a specific instance of PersonalComputeInstanceSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForPersonalComputeInstanceSettings(subject PersonalComputeInstanceSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PersonalComputeInstanceSettings + 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 PersonalComputeInstanceSettings instances for property testing - lazily instantiated by +// PersonalComputeInstanceSettingsGenerator() +var personalComputeInstanceSettingsGenerator gopter.Gen + +// PersonalComputeInstanceSettingsGenerator returns a generator of PersonalComputeInstanceSettings instances for property testing. +func PersonalComputeInstanceSettingsGenerator() gopter.Gen { + if personalComputeInstanceSettingsGenerator != nil { + return personalComputeInstanceSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettings(generators) + personalComputeInstanceSettingsGenerator = gen.Struct(reflect.TypeOf(PersonalComputeInstanceSettings{}), generators) + + return personalComputeInstanceSettingsGenerator +} + +// AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettings is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettings(gens map[string]gopter.Gen) { + gens["AssignedUser"] = gen.PtrOf(AssignedUserGenerator()) +} + +func Test_ResourceId_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ResourceId to ResourceId via AssignPropertiesToResourceId & AssignPropertiesFromResourceId returns original", + prop.ForAll(RunPropertyAssignmentTestForResourceId, ResourceIdGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForResourceId tests if a specific instance of ResourceId can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForResourceId(subject ResourceId) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ResourceId + err := copied.AssignPropertiesToResourceId(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ResourceId + err = actual.AssignPropertiesFromResourceId(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ResourceId_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ResourceId via JSON returns original", + prop.ForAll(RunJSONSerializationTestForResourceId, ResourceIdGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForResourceId runs a test to see if a specific instance of ResourceId round trips to JSON and back losslessly +func RunJSONSerializationTestForResourceId(subject ResourceId) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ResourceId + 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 ResourceId instances for property testing - lazily instantiated by ResourceIdGenerator() +var resourceIdGenerator gopter.Gen + +// ResourceIdGenerator returns a generator of ResourceId instances for property testing. +func ResourceIdGenerator() gopter.Gen { + if resourceIdGenerator != nil { + return resourceIdGenerator + } + + generators := make(map[string]gopter.Gen) + resourceIdGenerator = gen.Struct(reflect.TypeOf(ResourceId{}), generators) + + return resourceIdGenerator +} + +func Test_ScaleSettings_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScaleSettings to ScaleSettings via AssignPropertiesToScaleSettings & AssignPropertiesFromScaleSettings returns original", + prop.ForAll(RunPropertyAssignmentTestForScaleSettings, ScaleSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScaleSettings tests if a specific instance of ScaleSettings can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForScaleSettings(subject ScaleSettings) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ScaleSettings + err := copied.AssignPropertiesToScaleSettings(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScaleSettings + err = actual.AssignPropertiesFromScaleSettings(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScaleSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScaleSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScaleSettings, ScaleSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScaleSettings runs a test to see if a specific instance of ScaleSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForScaleSettings(subject ScaleSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScaleSettings + 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 ScaleSettings instances for property testing - lazily instantiated by ScaleSettingsGenerator() +var scaleSettingsGenerator gopter.Gen + +// ScaleSettingsGenerator returns a generator of ScaleSettings instances for property testing. +func ScaleSettingsGenerator() gopter.Gen { + if scaleSettingsGenerator != nil { + return scaleSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScaleSettings(generators) + scaleSettingsGenerator = gen.Struct(reflect.TypeOf(ScaleSettings{}), generators) + + return scaleSettingsGenerator +} + +// AddIndependentPropertyGeneratorsForScaleSettings is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScaleSettings(gens map[string]gopter.Gen) { + gens["MaxNodeCount"] = gen.PtrOf(gen.Int()) + gens["MinNodeCount"] = gen.PtrOf(gen.Int()) + gens["NodeIdleTimeBeforeScaleDown"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SetupScripts_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SetupScripts to SetupScripts via AssignPropertiesToSetupScripts & AssignPropertiesFromSetupScripts returns original", + prop.ForAll(RunPropertyAssignmentTestForSetupScripts, SetupScriptsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSetupScripts tests if a specific instance of SetupScripts can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSetupScripts(subject SetupScripts) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.SetupScripts + err := copied.AssignPropertiesToSetupScripts(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SetupScripts + err = actual.AssignPropertiesFromSetupScripts(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SetupScripts_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SetupScripts via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSetupScripts, SetupScriptsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSetupScripts runs a test to see if a specific instance of SetupScripts round trips to JSON and back losslessly +func RunJSONSerializationTestForSetupScripts(subject SetupScripts) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SetupScripts + 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 SetupScripts instances for property testing - lazily instantiated by SetupScriptsGenerator() +var setupScriptsGenerator gopter.Gen + +// SetupScriptsGenerator returns a generator of SetupScripts instances for property testing. +func SetupScriptsGenerator() gopter.Gen { + if setupScriptsGenerator != nil { + return setupScriptsGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForSetupScripts(generators) + setupScriptsGenerator = gen.Struct(reflect.TypeOf(SetupScripts{}), generators) + + return setupScriptsGenerator +} + +// AddRelatedPropertyGeneratorsForSetupScripts is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSetupScripts(gens map[string]gopter.Gen) { + gens["Scripts"] = gen.PtrOf(ScriptsToExecuteGenerator()) +} + +func Test_SslConfiguration_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SslConfiguration to SslConfiguration via AssignPropertiesToSslConfiguration & AssignPropertiesFromSslConfiguration returns original", + prop.ForAll(RunPropertyAssignmentTestForSslConfiguration, SslConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSslConfiguration tests if a specific instance of SslConfiguration can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForSslConfiguration(subject SslConfiguration) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.SslConfiguration + err := copied.AssignPropertiesToSslConfiguration(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SslConfiguration + err = actual.AssignPropertiesFromSslConfiguration(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SslConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SslConfiguration via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSslConfiguration, SslConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSslConfiguration runs a test to see if a specific instance of SslConfiguration round trips to JSON and back losslessly +func RunJSONSerializationTestForSslConfiguration(subject SslConfiguration) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SslConfiguration + 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 SslConfiguration instances for property testing - lazily instantiated by SslConfigurationGenerator() +var sslConfigurationGenerator gopter.Gen + +// SslConfigurationGenerator returns a generator of SslConfiguration instances for property testing. +func SslConfigurationGenerator() gopter.Gen { + if sslConfigurationGenerator != nil { + return sslConfigurationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSslConfiguration(generators) + sslConfigurationGenerator = gen.Struct(reflect.TypeOf(SslConfiguration{}), generators) + + return sslConfigurationGenerator +} + +// AddIndependentPropertyGeneratorsForSslConfiguration is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSslConfiguration(gens map[string]gopter.Gen) { + gens["Cert"] = gen.PtrOf(gen.AlphaString()) + gens["Cname"] = gen.PtrOf(gen.AlphaString()) + gens["Key"] = gen.PtrOf(gen.AlphaString()) + gens["LeafDomainLabel"] = gen.PtrOf(gen.AlphaString()) + gens["OverwriteExistingDomain"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.OneConstOf(SslConfigurationStatusAuto, SslConfigurationStatusDisabled, SslConfigurationStatusEnabled)) +} + +func Test_UserAccountCredentials_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAccountCredentials to UserAccountCredentials via AssignPropertiesToUserAccountCredentials & AssignPropertiesFromUserAccountCredentials returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAccountCredentials, UserAccountCredentialsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAccountCredentials tests if a specific instance of UserAccountCredentials can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForUserAccountCredentials(subject UserAccountCredentials) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.UserAccountCredentials + err := copied.AssignPropertiesToUserAccountCredentials(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAccountCredentials + err = actual.AssignPropertiesFromUserAccountCredentials(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAccountCredentials_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAccountCredentials via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAccountCredentials, UserAccountCredentialsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAccountCredentials runs a test to see if a specific instance of UserAccountCredentials round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAccountCredentials(subject UserAccountCredentials) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAccountCredentials + 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 UserAccountCredentials instances for property testing - lazily instantiated by +// UserAccountCredentialsGenerator() +var userAccountCredentialsGenerator gopter.Gen + +// UserAccountCredentialsGenerator returns a generator of UserAccountCredentials instances for property testing. +func UserAccountCredentialsGenerator() gopter.Gen { + if userAccountCredentialsGenerator != nil { + return userAccountCredentialsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAccountCredentials(generators) + userAccountCredentialsGenerator = gen.Struct(reflect.TypeOf(UserAccountCredentials{}), generators) + + return userAccountCredentialsGenerator +} + +// AddIndependentPropertyGeneratorsForUserAccountCredentials is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAccountCredentials(gens map[string]gopter.Gen) { + gens["AdminUserName"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_VirtualMachineImage_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from VirtualMachineImage to VirtualMachineImage via AssignPropertiesToVirtualMachineImage & AssignPropertiesFromVirtualMachineImage returns original", + prop.ForAll(RunPropertyAssignmentTestForVirtualMachineImage, VirtualMachineImageGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForVirtualMachineImage tests if a specific instance of VirtualMachineImage can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForVirtualMachineImage(subject VirtualMachineImage) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.VirtualMachineImage + err := copied.AssignPropertiesToVirtualMachineImage(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual VirtualMachineImage + err = actual.AssignPropertiesFromVirtualMachineImage(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_VirtualMachineImage_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineImage via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineImage, VirtualMachineImageGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineImage runs a test to see if a specific instance of VirtualMachineImage round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineImage(subject VirtualMachineImage) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineImage + 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 VirtualMachineImage instances for property testing - lazily instantiated by +// VirtualMachineImageGenerator() +var virtualMachineImageGenerator gopter.Gen + +// VirtualMachineImageGenerator returns a generator of VirtualMachineImage instances for property testing. +func VirtualMachineImageGenerator() gopter.Gen { + if virtualMachineImageGenerator != nil { + return virtualMachineImageGenerator + } + + generators := make(map[string]gopter.Gen) + virtualMachineImageGenerator = gen.Struct(reflect.TypeOf(VirtualMachineImage{}), generators) + + return virtualMachineImageGenerator +} + +func Test_VirtualMachineSshCredentials_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from VirtualMachineSshCredentials to VirtualMachineSshCredentials via AssignPropertiesToVirtualMachineSshCredentials & AssignPropertiesFromVirtualMachineSshCredentials returns original", + prop.ForAll(RunPropertyAssignmentTestForVirtualMachineSshCredentials, VirtualMachineSshCredentialsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForVirtualMachineSshCredentials tests if a specific instance of VirtualMachineSshCredentials can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForVirtualMachineSshCredentials(subject VirtualMachineSshCredentials) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.VirtualMachineSshCredentials + err := copied.AssignPropertiesToVirtualMachineSshCredentials(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual VirtualMachineSshCredentials + err = actual.AssignPropertiesFromVirtualMachineSshCredentials(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_VirtualMachineSshCredentials_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineSshCredentials via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineSshCredentials, VirtualMachineSshCredentialsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineSshCredentials runs a test to see if a specific instance of VirtualMachineSshCredentials round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineSshCredentials(subject VirtualMachineSshCredentials) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineSshCredentials + 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 VirtualMachineSshCredentials instances for property testing - lazily instantiated by +// VirtualMachineSshCredentialsGenerator() +var virtualMachineSshCredentialsGenerator gopter.Gen + +// VirtualMachineSshCredentialsGenerator returns a generator of VirtualMachineSshCredentials instances for property testing. +func VirtualMachineSshCredentialsGenerator() gopter.Gen { + if virtualMachineSshCredentialsGenerator != nil { + return virtualMachineSshCredentialsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials(generators) + virtualMachineSshCredentialsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineSshCredentials{}), generators) + + return virtualMachineSshCredentialsGenerator +} + +// AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials(gens map[string]gopter.Gen) { + gens["PrivateKeyData"] = gen.PtrOf(gen.AlphaString()) + gens["PublicKeyData"] = gen.PtrOf(gen.AlphaString()) + gens["Username"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_AssignedUser_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from AssignedUser to AssignedUser via AssignPropertiesToAssignedUser & AssignPropertiesFromAssignedUser returns original", + prop.ForAll(RunPropertyAssignmentTestForAssignedUser, AssignedUserGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAssignedUser tests if a specific instance of AssignedUser can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForAssignedUser(subject AssignedUser) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.AssignedUser + err := copied.AssignPropertiesToAssignedUser(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual AssignedUser + err = actual.AssignPropertiesFromAssignedUser(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_AssignedUser_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AssignedUser via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAssignedUser, AssignedUserGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAssignedUser runs a test to see if a specific instance of AssignedUser round trips to JSON and back losslessly +func RunJSONSerializationTestForAssignedUser(subject AssignedUser) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AssignedUser + 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 AssignedUser instances for property testing - lazily instantiated by AssignedUserGenerator() +var assignedUserGenerator gopter.Gen + +// AssignedUserGenerator returns a generator of AssignedUser instances for property testing. +func AssignedUserGenerator() gopter.Gen { + if assignedUserGenerator != nil { + return assignedUserGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAssignedUser(generators) + assignedUserGenerator = gen.Struct(reflect.TypeOf(AssignedUser{}), generators) + + return assignedUserGenerator +} + +// AddIndependentPropertyGeneratorsForAssignedUser is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAssignedUser(gens map[string]gopter.Gen) { + gens["ObjectId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScriptsToExecute_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScriptsToExecute to ScriptsToExecute via AssignPropertiesToScriptsToExecute & AssignPropertiesFromScriptsToExecute returns original", + prop.ForAll(RunPropertyAssignmentTestForScriptsToExecute, ScriptsToExecuteGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScriptsToExecute tests if a specific instance of ScriptsToExecute can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForScriptsToExecute(subject ScriptsToExecute) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ScriptsToExecute + err := copied.AssignPropertiesToScriptsToExecute(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScriptsToExecute + err = actual.AssignPropertiesFromScriptsToExecute(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScriptsToExecute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScriptsToExecute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScriptsToExecute, ScriptsToExecuteGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScriptsToExecute runs a test to see if a specific instance of ScriptsToExecute round trips to JSON and back losslessly +func RunJSONSerializationTestForScriptsToExecute(subject ScriptsToExecute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScriptsToExecute + 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 ScriptsToExecute instances for property testing - lazily instantiated by ScriptsToExecuteGenerator() +var scriptsToExecuteGenerator gopter.Gen + +// ScriptsToExecuteGenerator returns a generator of ScriptsToExecute instances for property testing. +func ScriptsToExecuteGenerator() gopter.Gen { + if scriptsToExecuteGenerator != nil { + return scriptsToExecuteGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScriptsToExecute(generators) + scriptsToExecuteGenerator = gen.Struct(reflect.TypeOf(ScriptsToExecute{}), generators) + + return scriptsToExecuteGenerator +} + +// AddRelatedPropertyGeneratorsForScriptsToExecute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScriptsToExecute(gens map[string]gopter.Gen) { + gens["CreationScript"] = gen.PtrOf(ScriptReferenceGenerator()) + gens["StartupScript"] = gen.PtrOf(ScriptReferenceGenerator()) +} + +func Test_ScriptReference_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from ScriptReference to ScriptReference via AssignPropertiesToScriptReference & AssignPropertiesFromScriptReference returns original", + prop.ForAll(RunPropertyAssignmentTestForScriptReference, ScriptReferenceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForScriptReference tests if a specific instance of ScriptReference can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForScriptReference(subject ScriptReference) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.ScriptReference + err := copied.AssignPropertiesToScriptReference(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual ScriptReference + err = actual.AssignPropertiesFromScriptReference(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_ScriptReference_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScriptReference via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScriptReference, ScriptReferenceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScriptReference runs a test to see if a specific instance of ScriptReference round trips to JSON and back losslessly +func RunJSONSerializationTestForScriptReference(subject ScriptReference) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScriptReference + 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 ScriptReference instances for property testing - lazily instantiated by ScriptReferenceGenerator() +var scriptReferenceGenerator gopter.Gen + +// ScriptReferenceGenerator returns a generator of ScriptReference instances for property testing. +func ScriptReferenceGenerator() gopter.Gen { + if scriptReferenceGenerator != nil { + return scriptReferenceGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScriptReference(generators) + scriptReferenceGenerator = gen.Struct(reflect.TypeOf(ScriptReference{}), generators) + + return scriptReferenceGenerator +} + +// AddIndependentPropertyGeneratorsForScriptReference is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScriptReference(gens map[string]gopter.Gen) { + gens["ScriptArguments"] = gen.PtrOf(gen.AlphaString()) + gens["ScriptData"] = gen.PtrOf(gen.AlphaString()) + gens["ScriptSource"] = gen.PtrOf(gen.AlphaString()) + gens["Timeout"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen.go new file mode 100644 index 0000000000..8b67e9d688 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen.go @@ -0,0 +1,817 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import ( + "encoding/json" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +type WorkspacesComputes_SpecARM struct { + // Identity: Identity for the resource. + Identity *IdentityARM `json:"identity,omitempty"` + + // Location: Specifies the location of the resource. + Location *string `json:"location,omitempty"` + + // Name: Name of the Azure Machine Learning compute. + Name string `json:"name,omitempty"` + + // Properties: Machine Learning compute object. + Properties *ComputeARM `json:"properties,omitempty"` + + // Sku: Sku of the resource + Sku *SkuARM `json:"sku,omitempty"` + + // SystemData: Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataARM `json:"systemData,omitempty"` + + // Tags: Contains resource tags defined as key/value pairs. + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &WorkspacesComputes_SpecARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01" +func (computes WorkspacesComputes_SpecARM) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetName returns the Name of the resource +func (computes *WorkspacesComputes_SpecARM) GetName() string { + return computes.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/computes" +func (computes *WorkspacesComputes_SpecARM) GetType() string { + return "Microsoft.MachineLearningServices/workspaces/computes" +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Compute +type ComputeARM struct { + // AKS: Mutually exclusive with all other properties + AKS *Compute_AKSARM `json:"aks,omitempty"` + + // AmlCompute: Mutually exclusive with all other properties + AmlCompute *Compute_AmlComputeARM `json:"amlCompute,omitempty"` + + // ComputeInstance: Mutually exclusive with all other properties + ComputeInstance *Compute_ComputeInstanceARM `json:"computeInstance,omitempty"` + + // DataFactory: Mutually exclusive with all other properties + DataFactory *Compute_DataFactoryARM `json:"dataFactory,omitempty"` + + // DataLakeAnalytics: Mutually exclusive with all other properties + DataLakeAnalytics *Compute_DataLakeAnalyticsARM `json:"dataLakeAnalytics,omitempty"` + + // Databricks: Mutually exclusive with all other properties + Databricks *Compute_DatabricksARM `json:"databricks,omitempty"` + + // HDInsight: Mutually exclusive with all other properties + HDInsight *Compute_HDInsightARM `json:"hdInsight,omitempty"` + + // SynapseSpark: Mutually exclusive with all other properties + SynapseSpark *Compute_SynapseSparkARM `json:"synapseSpark,omitempty"` + + // VirtualMachine: Mutually exclusive with all other properties + VirtualMachine *Compute_VirtualMachineARM `json:"virtualMachine,omitempty"` +} + +// MarshalJSON defers JSON marshaling to the first non-nil property, because ComputeARM represents a discriminated union (JSON OneOf) +func (compute ComputeARM) MarshalJSON() ([]byte, error) { + if compute.AKS != nil { + return json.Marshal(compute.AKS) + } + if compute.AmlCompute != nil { + return json.Marshal(compute.AmlCompute) + } + if compute.ComputeInstance != nil { + return json.Marshal(compute.ComputeInstance) + } + if compute.DataFactory != nil { + return json.Marshal(compute.DataFactory) + } + if compute.DataLakeAnalytics != nil { + return json.Marshal(compute.DataLakeAnalytics) + } + if compute.Databricks != nil { + return json.Marshal(compute.Databricks) + } + if compute.HDInsight != nil { + return json.Marshal(compute.HDInsight) + } + if compute.SynapseSpark != nil { + return json.Marshal(compute.SynapseSpark) + } + if compute.VirtualMachine != nil { + return json.Marshal(compute.VirtualMachine) + } + return nil, nil +} + +// UnmarshalJSON unmarshals the ComputeARM +func (compute *ComputeARM) UnmarshalJSON(data []byte) error { + var rawJson map[string]interface{} + err := json.Unmarshal(data, &rawJson) + if err != nil { + return err + } + discriminator := rawJson["computeType"] + if discriminator == "AKS" { + compute.AKS = &Compute_AKSARM{} + return json.Unmarshal(data, compute.AKS) + } + if discriminator == "AmlCompute" { + compute.AmlCompute = &Compute_AmlComputeARM{} + return json.Unmarshal(data, compute.AmlCompute) + } + if discriminator == "ComputeInstance" { + compute.ComputeInstance = &Compute_ComputeInstanceARM{} + return json.Unmarshal(data, compute.ComputeInstance) + } + if discriminator == "DataFactory" { + compute.DataFactory = &Compute_DataFactoryARM{} + return json.Unmarshal(data, compute.DataFactory) + } + if discriminator == "DataLakeAnalytics" { + compute.DataLakeAnalytics = &Compute_DataLakeAnalyticsARM{} + return json.Unmarshal(data, compute.DataLakeAnalytics) + } + if discriminator == "Databricks" { + compute.Databricks = &Compute_DatabricksARM{} + return json.Unmarshal(data, compute.Databricks) + } + if discriminator == "HDInsight" { + compute.HDInsight = &Compute_HDInsightARM{} + return json.Unmarshal(data, compute.HDInsight) + } + if discriminator == "SynapseSpark" { + compute.SynapseSpark = &Compute_SynapseSparkARM{} + return json.Unmarshal(data, compute.SynapseSpark) + } + if discriminator == "VirtualMachine" { + compute.VirtualMachine = &Compute_VirtualMachineARM{} + return json.Unmarshal(data, compute.VirtualMachine) + } + + // No error + return nil +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Identity +type IdentityARM struct { + // Type: The identity type. + Type *IdentityType `json:"type,omitempty"` + + // UserAssignedIdentities: dictionary containing all the user assigned identities, with resourceId of the UAI as key. + UserAssignedIdentities map[string]v1.JSON `json:"userAssignedIdentities,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Sku +type SkuARM struct { + // Name: Name of the sku + Name *string `json:"name,omitempty"` + + // Tier: Tier of the sku like Basic or Enterprise + Tier *string `json:"tier,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SystemData +type SystemDataARM 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 *SystemDataCreatedByType `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 *SystemDataLastModifiedByType `json:"lastModifiedByType,omitempty"` +} + +type Compute_AKSARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeAKSComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: AKS properties + Properties *AKSPropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_AmlComputeARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeAmlComputeComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: AML Compute properties + Properties *AmlComputePropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_ComputeInstanceARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeComputeInstanceComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: Compute Instance properties + Properties *ComputeInstancePropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_DataFactoryARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeDataFactoryComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_DataLakeAnalyticsARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeDataLakeAnalyticsComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *DataLakeAnalyticsPropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_DatabricksARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeDatabricksComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: Properties of Databricks + Properties *DatabricksPropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_HDInsightARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeHDInsightComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Properties: HDInsight compute properties + Properties *HDInsightPropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_SynapseSparkARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeSynapseSparkComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *SynapseSparkPropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +type Compute_VirtualMachineARM struct { + // ComputeLocation: Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType ComputeVirtualMachineComputeType `json:"computeType,omitempty"` + + // Description: The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + + // DisableLocalAuth: Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for + // authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *VirtualMachinePropertiesARM `json:"properties,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +// +kubebuilder:validation:Enum={"None","SystemAssigned","SystemAssigned,UserAssigned","UserAssigned"} +type IdentityType string + +const ( + IdentityTypeNone = IdentityType("None") + IdentityTypeSystemAssigned = IdentityType("SystemAssigned") + IdentityTypeSystemAssignedUserAssigned = IdentityType("SystemAssigned,UserAssigned") + IdentityTypeUserAssigned = IdentityType("UserAssigned") +) + +// +kubebuilder:validation:Enum={"Application","Key","ManagedIdentity","User"} +type SystemDataCreatedByType string + +const ( + SystemDataCreatedByTypeApplication = SystemDataCreatedByType("Application") + SystemDataCreatedByTypeKey = SystemDataCreatedByType("Key") + SystemDataCreatedByTypeManagedIdentity = SystemDataCreatedByType("ManagedIdentity") + SystemDataCreatedByTypeUser = SystemDataCreatedByType("User") +) + +// +kubebuilder:validation:Enum={"Application","Key","ManagedIdentity","User"} +type SystemDataLastModifiedByType string + +const ( + SystemDataLastModifiedByTypeApplication = SystemDataLastModifiedByType("Application") + SystemDataLastModifiedByTypeKey = SystemDataLastModifiedByType("Key") + SystemDataLastModifiedByTypeManagedIdentity = SystemDataLastModifiedByType("ManagedIdentity") + SystemDataLastModifiedByTypeUser = SystemDataLastModifiedByType("User") +) + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AKSProperties +type AKSPropertiesARM struct { + // AgentCount: Number of agents + AgentCount *int `json:"agentCount,omitempty"` + + // AgentVmSize: Agent virtual machine size + AgentVmSize *string `json:"agentVmSize,omitempty"` + + // AksNetworkingConfiguration: Advance configuration for AKS networking + AksNetworkingConfiguration *AksNetworkingConfigurationARM `json:"aksNetworkingConfiguration,omitempty"` + + // ClusterFqdn: Cluster full qualified domain name + ClusterFqdn *string `json:"clusterFqdn,omitempty"` + + // ClusterPurpose: Intended usage of the cluster. + ClusterPurpose *AKSPropertiesClusterPurpose `json:"clusterPurpose,omitempty"` + + // LoadBalancerSubnet: Load Balancer Subnet + LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"` + + // LoadBalancerType: Load Balancer Type. + LoadBalancerType *AKSPropertiesLoadBalancerType `json:"loadBalancerType,omitempty"` + + // SslConfiguration: The ssl configuration for scoring + SslConfiguration *SslConfigurationARM `json:"sslConfiguration,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AmlComputeProperties +type AmlComputePropertiesARM struct { + // EnableNodePublicIp: Enable or disable node public IP address provisioning. Possible values are: Possible values are: + // true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will + // have a private endpoint and no public IPs. + EnableNodePublicIp *bool `json:"enableNodePublicIp,omitempty"` + + // IsolatedNetwork: Network is isolated or not + IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"` + + // OsType: Compute OS Type. + OsType *AmlComputePropertiesOsType `json:"osType,omitempty"` + + // RemoteLoginPortPublicAccess: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh + // port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the + // cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, + // else is open all public nodes. It can be default only during cluster creation time, after creation it will be either + // enabled or disabled. + RemoteLoginPortPublicAccess *AmlComputePropertiesRemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"` + + // ScaleSettings: scale settings for AML Compute + ScaleSettings *ScaleSettingsARM `json:"scaleSettings,omitempty"` + + // Subnet: Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. + Subnet *ResourceIdARM `json:"subnet,omitempty"` + + // UserAccountCredentials: Settings for user account that gets created on each on the nodes of a compute. + UserAccountCredentials *UserAccountCredentialsARM `json:"userAccountCredentials,omitempty"` + + // VirtualMachineImage: Virtual Machine image for Windows AML Compute + VirtualMachineImage *VirtualMachineImageARM `json:"virtualMachineImage,omitempty"` + + // VmPriority: Virtual Machine priority. + VmPriority *AmlComputePropertiesVmPriority `json:"vmPriority,omitempty"` + + // VmSize: Virtual Machine Size + VmSize *string `json:"vmSize,omitempty"` +} + +// +kubebuilder:validation:Enum={"AKS"} +type ComputeAKSComputeType string + +const ComputeAKSComputeTypeAKS = ComputeAKSComputeType("AKS") + +// +kubebuilder:validation:Enum={"AmlCompute"} +type ComputeAmlComputeComputeType string + +const ComputeAmlComputeComputeTypeAmlCompute = ComputeAmlComputeComputeType("AmlCompute") + +// +kubebuilder:validation:Enum={"ComputeInstance"} +type ComputeComputeInstanceComputeType string + +const ComputeComputeInstanceComputeTypeComputeInstance = ComputeComputeInstanceComputeType("ComputeInstance") + +// +kubebuilder:validation:Enum={"DataFactory"} +type ComputeDataFactoryComputeType string + +const ComputeDataFactoryComputeTypeDataFactory = ComputeDataFactoryComputeType("DataFactory") + +// +kubebuilder:validation:Enum={"DataLakeAnalytics"} +type ComputeDataLakeAnalyticsComputeType string + +const ComputeDataLakeAnalyticsComputeTypeDataLakeAnalytics = ComputeDataLakeAnalyticsComputeType("DataLakeAnalytics") + +// +kubebuilder:validation:Enum={"Databricks"} +type ComputeDatabricksComputeType string + +const ComputeDatabricksComputeTypeDatabricks = ComputeDatabricksComputeType("Databricks") + +// +kubebuilder:validation:Enum={"HDInsight"} +type ComputeHDInsightComputeType string + +const ComputeHDInsightComputeTypeHDInsight = ComputeHDInsightComputeType("HDInsight") + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceProperties +type ComputeInstancePropertiesARM struct { + // ApplicationSharingPolicy: Policy for sharing applications on this compute instance among users of parent workspace. If + // Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access + // applications on this instance depending on his/her assigned role. + ApplicationSharingPolicy *ComputeInstancePropertiesApplicationSharingPolicy `json:"applicationSharingPolicy,omitempty"` + + // ComputeInstanceAuthorizationType: The Compute Instance Authorization type. Available values are personal (default). + ComputeInstanceAuthorizationType *ComputeInstancePropertiesComputeInstanceAuthorizationType `json:"computeInstanceAuthorizationType,omitempty"` + + // PersonalComputeInstanceSettings: Settings for a personal compute instance. + PersonalComputeInstanceSettings *PersonalComputeInstanceSettingsARM `json:"personalComputeInstanceSettings,omitempty"` + + // SetupScripts: Details of customized scripts to execute for setting up the cluster. + SetupScripts *SetupScriptsARM `json:"setupScripts,omitempty"` + + // SshSettings: Specifies policy and settings for SSH access. + SshSettings *ComputeInstanceSshSettingsARM `json:"sshSettings,omitempty"` + + // Subnet: Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. + Subnet *ResourceIdARM `json:"subnet,omitempty"` + + // VmSize: Virtual Machine Size + VmSize *string `json:"vmSize,omitempty"` +} + +// +kubebuilder:validation:Enum={"SynapseSpark"} +type ComputeSynapseSparkComputeType string + +const ComputeSynapseSparkComputeTypeSynapseSpark = ComputeSynapseSparkComputeType("SynapseSpark") + +// +kubebuilder:validation:Enum={"VirtualMachine"} +type ComputeVirtualMachineComputeType string + +const ComputeVirtualMachineComputeTypeVirtualMachine = ComputeVirtualMachineComputeType("VirtualMachine") + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DataLakeAnalyticsProperties +type DataLakeAnalyticsPropertiesARM struct { + // DataLakeStoreAccountName: DataLake Store Account Name + DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DatabricksProperties +type DatabricksPropertiesARM struct { + // DatabricksAccessToken: Databricks access token + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + + // WorkspaceUrl: Workspace Url + WorkspaceUrl *string `json:"workspaceUrl,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/HDInsightProperties +type HDInsightPropertiesARM struct { + // Address: Public IP address of the master node of the cluster. + Address *string `json:"address,omitempty"` + + // AdministratorAccount: Admin credentials for virtual machine + AdministratorAccount *VirtualMachineSshCredentialsARM `json:"administratorAccount,omitempty"` + + // SshPort: Port open for ssh connections on the master node of the cluster. + SshPort *int `json:"sshPort,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SynapseSparkProperties +type SynapseSparkPropertiesARM struct { + // AutoPauseProperties: Auto pause properties + AutoPauseProperties *AutoPausePropertiesARM `json:"autoPauseProperties,omitempty"` + + // AutoScaleProperties: Auto scale properties + AutoScaleProperties *AutoScalePropertiesARM `json:"autoScaleProperties,omitempty"` + + // NodeCount: The number of compute nodes currently assigned to the compute. + NodeCount *int `json:"nodeCount,omitempty"` + + // NodeSize: Node size. + NodeSize *string `json:"nodeSize,omitempty"` + + // NodeSizeFamily: Node size family. + NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"` + + // PoolName: Pool name. + PoolName *string `json:"poolName,omitempty"` + + // ResourceGroup: Name of the resource group in which workspace is located. + ResourceGroup *string `json:"resourceGroup,omitempty"` + + // SparkVersion: Spark version. + SparkVersion *string `json:"sparkVersion,omitempty"` + + // SubscriptionId: Azure subscription identifier. + SubscriptionId *string `json:"subscriptionId,omitempty"` + + // WorkspaceName: Name of Azure Machine Learning workspace. + WorkspaceName *string `json:"workspaceName,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineProperties +type VirtualMachinePropertiesARM struct { + // Address: Public IP address of the virtual machine. + Address *string `json:"address,omitempty"` + + // AdministratorAccount: Admin credentials for virtual machine + AdministratorAccount *VirtualMachineSshCredentialsARM `json:"administratorAccount,omitempty"` + + // IsNotebookInstanceCompute: Indicates whether this compute will be used for running notebooks. + IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"` + + // SshPort: Port open for ssh connections. + SshPort *int `json:"sshPort,omitempty"` + + // VirtualMachineSize: Virtual Machine size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` +} + +// +kubebuilder:validation:Enum={"DenseProd","DevTest","FastProd"} +type AKSPropertiesClusterPurpose string + +const ( + AKSPropertiesClusterPurposeDenseProd = AKSPropertiesClusterPurpose("DenseProd") + AKSPropertiesClusterPurposeDevTest = AKSPropertiesClusterPurpose("DevTest") + AKSPropertiesClusterPurposeFastProd = AKSPropertiesClusterPurpose("FastProd") +) + +// +kubebuilder:validation:Enum={"InternalLoadBalancer","PublicIp"} +type AKSPropertiesLoadBalancerType string + +const ( + AKSPropertiesLoadBalancerTypeInternalLoadBalancer = AKSPropertiesLoadBalancerType("InternalLoadBalancer") + AKSPropertiesLoadBalancerTypePublicIp = AKSPropertiesLoadBalancerType("PublicIp") +) + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AksNetworkingConfiguration +type AksNetworkingConfigurationARM struct { + // DnsServiceIP: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address + // range specified in serviceCidr. + DnsServiceIP *string `json:"dnsServiceIP,omitempty"` + + // DockerBridgeCidr: A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP + // ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + + // ServiceCidr: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP + // ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` +} + +// +kubebuilder:validation:Enum={"Linux","Windows"} +type AmlComputePropertiesOsType string + +const ( + AmlComputePropertiesOsTypeLinux = AmlComputePropertiesOsType("Linux") + AmlComputePropertiesOsTypeWindows = AmlComputePropertiesOsType("Windows") +) + +// +kubebuilder:validation:Enum={"Disabled","Enabled","NotSpecified"} +type AmlComputePropertiesRemoteLoginPortPublicAccess string + +const ( + AmlComputePropertiesRemoteLoginPortPublicAccessDisabled = AmlComputePropertiesRemoteLoginPortPublicAccess("Disabled") + AmlComputePropertiesRemoteLoginPortPublicAccessEnabled = AmlComputePropertiesRemoteLoginPortPublicAccess("Enabled") + AmlComputePropertiesRemoteLoginPortPublicAccessNotSpecified = AmlComputePropertiesRemoteLoginPortPublicAccess("NotSpecified") +) + +// +kubebuilder:validation:Enum={"Dedicated","LowPriority"} +type AmlComputePropertiesVmPriority string + +const ( + AmlComputePropertiesVmPriorityDedicated = AmlComputePropertiesVmPriority("Dedicated") + AmlComputePropertiesVmPriorityLowPriority = AmlComputePropertiesVmPriority("LowPriority") +) + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoPauseProperties +type AutoPausePropertiesARM struct { + DelayInMinutes *int `json:"delayInMinutes,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoScaleProperties +type AutoScalePropertiesARM struct { + Enabled *bool `json:"enabled,omitempty"` + MaxNodeCount *int `json:"maxNodeCount,omitempty"` + MinNodeCount *int `json:"minNodeCount,omitempty"` +} + +// +kubebuilder:validation:Enum={"Personal","Shared"} +type ComputeInstancePropertiesApplicationSharingPolicy string + +const ( + ComputeInstancePropertiesApplicationSharingPolicyPersonal = ComputeInstancePropertiesApplicationSharingPolicy("Personal") + ComputeInstancePropertiesApplicationSharingPolicyShared = ComputeInstancePropertiesApplicationSharingPolicy("Shared") +) + +// +kubebuilder:validation:Enum={"personal"} +type ComputeInstancePropertiesComputeInstanceAuthorizationType string + +const ComputeInstancePropertiesComputeInstanceAuthorizationTypePersonal = ComputeInstancePropertiesComputeInstanceAuthorizationType("personal") + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceSshSettings +type ComputeInstanceSshSettingsARM struct { + // AdminPublicKey: Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH + // key pairs. + AdminPublicKey *string `json:"adminPublicKey,omitempty"` + + // SshPublicAccess: State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is + // closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the + // VNet/subnet policy if applicable. + SshPublicAccess *ComputeInstanceSshSettingsSshPublicAccess `json:"sshPublicAccess,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/PersonalComputeInstanceSettings +type PersonalComputeInstanceSettingsARM struct { + // AssignedUser: A user that can be assigned to a compute instance. + AssignedUser *AssignedUserARM `json:"assignedUser,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ResourceId +type ResourceIdARM struct { + Id *string `json:"id,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScaleSettings +type ScaleSettingsARM struct { + // MaxNodeCount: Max number of nodes to use + MaxNodeCount *int `json:"maxNodeCount,omitempty"` + + // MinNodeCount: Min number of nodes to use + MinNodeCount *int `json:"minNodeCount,omitempty"` + + // NodeIdleTimeBeforeScaleDown: Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format. + NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SetupScripts +type SetupScriptsARM struct { + // Scripts: Customized setup scripts + Scripts *ScriptsToExecuteARM `json:"scripts,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SslConfiguration +type SslConfigurationARM struct { + // Cert: Cert data + Cert *string `json:"cert,omitempty"` + + // Cname: CNAME of the cert + Cname *string `json:"cname,omitempty"` + + // Key: Key data + Key *string `json:"key,omitempty"` + + // LeafDomainLabel: Leaf domain label of public endpoint + LeafDomainLabel *string `json:"leafDomainLabel,omitempty"` + + // OverwriteExistingDomain: Indicates whether to overwrite existing domain label. + OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"` + + // Status: Enable or disable ssl for scoring. + Status *SslConfigurationStatus `json:"status,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/UserAccountCredentials +type UserAccountCredentialsARM struct { + // AdminUserName: Name of the administrator user account which can be used to SSH to nodes. + AdminUserName *string `json:"adminUserName,omitempty"` + + // AdminUserPassword: Password of the administrator user account. + AdminUserPassword *string `json:"adminUserPassword,omitempty"` + + // AdminUserSshPublicKey: SSH public key of the administrator user account. + AdminUserSshPublicKey *string `json:"adminUserSshPublicKey,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineImage +type VirtualMachineImageARM struct { + Id *string `json:"id,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineSshCredentials +type VirtualMachineSshCredentialsARM struct { + // Password: Password of admin account + Password *string `json:"password,omitempty"` + + // PrivateKeyData: Private key data + PrivateKeyData *string `json:"privateKeyData,omitempty"` + + // PublicKeyData: Public key data + PublicKeyData *string `json:"publicKeyData,omitempty"` + + // Username: Username of admin account + Username *string `json:"username,omitempty"` +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AssignedUser +type AssignedUserARM struct { + // ObjectId: User’s AAD Object Id. + ObjectId *string `json:"objectId,omitempty"` + + // TenantId: User’s AAD Tenant Id. + TenantId *string `json:"tenantId,omitempty"` +} + +// +kubebuilder:validation:Enum={"Disabled","Enabled"} +type ComputeInstanceSshSettingsSshPublicAccess string + +const ( + ComputeInstanceSshSettingsSshPublicAccessDisabled = ComputeInstanceSshSettingsSshPublicAccess("Disabled") + ComputeInstanceSshSettingsSshPublicAccessEnabled = ComputeInstanceSshSettingsSshPublicAccess("Enabled") +) + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptsToExecute +type ScriptsToExecuteARM struct { + // CreationScript: Script reference + CreationScript *ScriptReferenceARM `json:"creationScript,omitempty"` + + // StartupScript: Script reference + StartupScript *ScriptReferenceARM `json:"startupScript,omitempty"` +} + +// +kubebuilder:validation:Enum={"Auto","Disabled","Enabled"} +type SslConfigurationStatus string + +const ( + SslConfigurationStatusAuto = SslConfigurationStatus("Auto") + SslConfigurationStatusDisabled = SslConfigurationStatus("Disabled") + SslConfigurationStatusEnabled = SslConfigurationStatus("Enabled") +) + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptReference +type ScriptReferenceARM struct { + // ScriptArguments: Optional command line arguments passed to the script to run. + ScriptArguments *string `json:"scriptArguments,omitempty"` + + // ScriptData: The location of scripts in the mounted volume. + ScriptData *string `json:"scriptData,omitempty"` + + // ScriptSource: The storage source of the script: inline, workspace. + ScriptSource *string `json:"scriptSource,omitempty"` + + // Timeout: Optional time period passed to timeout command. + Timeout *string `json:"timeout,omitempty"` +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen_test.go new file mode 100644 index 0000000000..7abf54cb2a --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_computes__spec_arm_types_gen_test.go @@ -0,0 +1,2586 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +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_WorkspacesComputes_SpecARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesComputes_SpecARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesComputesSpecARM, WorkspacesComputesSpecARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesComputesSpecARM runs a test to see if a specific instance of WorkspacesComputes_SpecARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesComputesSpecARM(subject WorkspacesComputes_SpecARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesComputes_SpecARM + 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 WorkspacesComputes_SpecARM instances for property testing - lazily instantiated by +// WorkspacesComputesSpecARMGenerator() +var workspacesComputesSpecARMGenerator gopter.Gen + +// WorkspacesComputesSpecARMGenerator returns a generator of WorkspacesComputes_SpecARM instances for property testing. +// We first initialize workspacesComputesSpecARMGenerator 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 WorkspacesComputesSpecARMGenerator() gopter.Gen { + if workspacesComputesSpecARMGenerator != nil { + return workspacesComputesSpecARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesComputesSpecARM(generators) + workspacesComputesSpecARMGenerator = gen.Struct(reflect.TypeOf(WorkspacesComputes_SpecARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesComputesSpecARM(generators) + AddRelatedPropertyGeneratorsForWorkspacesComputesSpecARM(generators) + workspacesComputesSpecARMGenerator = gen.Struct(reflect.TypeOf(WorkspacesComputes_SpecARM{}), generators) + + return workspacesComputesSpecARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesComputesSpecARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesComputesSpecARM(gens map[string]gopter.Gen) { + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.AlphaString() + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesComputesSpecARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesComputesSpecARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityARMGenerator()) + gens["Properties"] = gen.PtrOf(ComputeARMGenerator()) + gens["Sku"] = gen.PtrOf(SkuARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataARMGenerator()) +} + +func Test_ComputeARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeARM, ComputeARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeARM runs a test to see if a specific instance of ComputeARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeARM(subject ComputeARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeARM + 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 ComputeARM instances for property testing - lazily instantiated by ComputeARMGenerator() +var computeARMGenerator gopter.Gen + +// ComputeARMGenerator returns a generator of ComputeARM instances for property testing. +func ComputeARMGenerator() gopter.Gen { + if computeARMGenerator != nil { + return computeARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForComputeARM(generators) + + // handle OneOf by choosing only one field to instantiate + var gens []gopter.Gen + for propName, propGen := range generators { + gens = append(gens, gen.Struct(reflect.TypeOf(ComputeARM{}), map[string]gopter.Gen{ + propName: propGen, + })) + } + computeARMGenerator = gen.OneGenOf(gens...) + + return computeARMGenerator +} + +// AddRelatedPropertyGeneratorsForComputeARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeARM(gens map[string]gopter.Gen) { + gens["AKS"] = ComputeAKSARMGenerator().Map(func(it Compute_AKSARM) *Compute_AKSARM { + return &it + }) // generate one case for OneOf type + gens["AmlCompute"] = ComputeAmlComputeARMGenerator().Map(func(it Compute_AmlComputeARM) *Compute_AmlComputeARM { + return &it + }) // generate one case for OneOf type + gens["ComputeInstance"] = ComputeComputeInstanceARMGenerator().Map(func(it Compute_ComputeInstanceARM) *Compute_ComputeInstanceARM { + return &it + }) // generate one case for OneOf type + gens["DataFactory"] = ComputeDataFactoryARMGenerator().Map(func(it Compute_DataFactoryARM) *Compute_DataFactoryARM { + return &it + }) // generate one case for OneOf type + gens["DataLakeAnalytics"] = ComputeDataLakeAnalyticsARMGenerator().Map(func(it Compute_DataLakeAnalyticsARM) *Compute_DataLakeAnalyticsARM { + return &it + }) // generate one case for OneOf type + gens["Databricks"] = ComputeDatabricksARMGenerator().Map(func(it Compute_DatabricksARM) *Compute_DatabricksARM { + return &it + }) // generate one case for OneOf type + gens["HDInsight"] = ComputeHDInsightARMGenerator().Map(func(it Compute_HDInsightARM) *Compute_HDInsightARM { + return &it + }) // generate one case for OneOf type + gens["SynapseSpark"] = ComputeSynapseSparkARMGenerator().Map(func(it Compute_SynapseSparkARM) *Compute_SynapseSparkARM { + return &it + }) // generate one case for OneOf type + gens["VirtualMachine"] = ComputeVirtualMachineARMGenerator().Map(func(it Compute_VirtualMachineARM) *Compute_VirtualMachineARM { + return &it + }) // generate one case for OneOf type +} + +func Test_IdentityARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of IdentityARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityARM, IdentityARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityARM runs a test to see if a specific instance of IdentityARM round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityARM(subject IdentityARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual IdentityARM + 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 IdentityARM instances for property testing - lazily instantiated by IdentityARMGenerator() +var identityARMGenerator gopter.Gen + +// IdentityARMGenerator returns a generator of IdentityARM instances for property testing. +func IdentityARMGenerator() gopter.Gen { + if identityARMGenerator != nil { + return identityARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityARM(generators) + identityARMGenerator = gen.Struct(reflect.TypeOf(IdentityARM{}), generators) + + return identityARMGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityARM(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf( + IdentityTypeNone, + IdentityTypeSystemAssigned, + IdentityTypeSystemAssignedUserAssigned, + IdentityTypeUserAssigned)) +} + +func Test_SkuARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SkuARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSkuARM, SkuARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSkuARM runs a test to see if a specific instance of SkuARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSkuARM(subject SkuARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SkuARM + 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 SkuARM instances for property testing - lazily instantiated by SkuARMGenerator() +var skuARMGenerator gopter.Gen + +// SkuARMGenerator returns a generator of SkuARM instances for property testing. +func SkuARMGenerator() gopter.Gen { + if skuARMGenerator != nil { + return skuARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSkuARM(generators) + skuARMGenerator = gen.Struct(reflect.TypeOf(SkuARM{}), generators) + + return skuARMGenerator +} + +// AddIndependentPropertyGeneratorsForSkuARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSkuARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tier"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SystemDataARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemDataARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemDataARM, SystemDataARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemDataARM runs a test to see if a specific instance of SystemDataARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemDataARM(subject SystemDataARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemDataARM + 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 SystemDataARM instances for property testing - lazily instantiated by SystemDataARMGenerator() +var systemDataARMGenerator gopter.Gen + +// SystemDataARMGenerator returns a generator of SystemDataARM instances for property testing. +func SystemDataARMGenerator() gopter.Gen { + if systemDataARMGenerator != nil { + return systemDataARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemDataARM(generators) + systemDataARMGenerator = gen.Struct(reflect.TypeOf(SystemDataARM{}), generators) + + return systemDataARMGenerator +} + +// AddIndependentPropertyGeneratorsForSystemDataARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemDataARM(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataCreatedByTypeApplication, + SystemDataCreatedByTypeKey, + SystemDataCreatedByTypeManagedIdentity, + SystemDataCreatedByTypeUser)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemDataLastModifiedByTypeApplication, + SystemDataLastModifiedByTypeKey, + SystemDataLastModifiedByTypeManagedIdentity, + SystemDataLastModifiedByTypeUser)) +} + +func Test_Compute_AKSARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_AKSARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeAKSARM, ComputeAKSARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeAKSARM runs a test to see if a specific instance of Compute_AKSARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeAKSARM(subject Compute_AKSARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_AKSARM + 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 Compute_AKSARM instances for property testing - lazily instantiated by ComputeAKSARMGenerator() +var computeAKSARMGenerator gopter.Gen + +// ComputeAKSARMGenerator returns a generator of Compute_AKSARM instances for property testing. +// We first initialize computeAKSARMGenerator 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 ComputeAKSARMGenerator() gopter.Gen { + if computeAKSARMGenerator != nil { + return computeAKSARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAKSARM(generators) + computeAKSARMGenerator = gen.Struct(reflect.TypeOf(Compute_AKSARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAKSARM(generators) + AddRelatedPropertyGeneratorsForComputeAKSARM(generators) + computeAKSARMGenerator = gen.Struct(reflect.TypeOf(Compute_AKSARM{}), generators) + + return computeAKSARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeAKSARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeAKSARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeAKSComputeTypeAKS) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeAKSARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeAKSARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(AKSPropertiesARMGenerator()) +} + +func Test_Compute_AmlComputeARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_AmlComputeARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeAmlComputeARM, ComputeAmlComputeARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeAmlComputeARM runs a test to see if a specific instance of Compute_AmlComputeARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeAmlComputeARM(subject Compute_AmlComputeARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_AmlComputeARM + 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 Compute_AmlComputeARM instances for property testing - lazily instantiated by +// ComputeAmlComputeARMGenerator() +var computeAmlComputeARMGenerator gopter.Gen + +// ComputeAmlComputeARMGenerator returns a generator of Compute_AmlComputeARM instances for property testing. +// We first initialize computeAmlComputeARMGenerator 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 ComputeAmlComputeARMGenerator() gopter.Gen { + if computeAmlComputeARMGenerator != nil { + return computeAmlComputeARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAmlComputeARM(generators) + computeAmlComputeARMGenerator = gen.Struct(reflect.TypeOf(Compute_AmlComputeARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAmlComputeARM(generators) + AddRelatedPropertyGeneratorsForComputeAmlComputeARM(generators) + computeAmlComputeARMGenerator = gen.Struct(reflect.TypeOf(Compute_AmlComputeARM{}), generators) + + return computeAmlComputeARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeAmlComputeARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeAmlComputeARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeAmlComputeComputeTypeAmlCompute) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeAmlComputeARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeAmlComputeARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(AmlComputePropertiesARMGenerator()) +} + +func Test_Compute_ComputeInstanceARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_ComputeInstanceARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeComputeInstanceARM, ComputeComputeInstanceARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeComputeInstanceARM runs a test to see if a specific instance of Compute_ComputeInstanceARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeComputeInstanceARM(subject Compute_ComputeInstanceARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_ComputeInstanceARM + 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 Compute_ComputeInstanceARM instances for property testing - lazily instantiated by +// ComputeComputeInstanceARMGenerator() +var computeComputeInstanceARMGenerator gopter.Gen + +// ComputeComputeInstanceARMGenerator returns a generator of Compute_ComputeInstanceARM instances for property testing. +// We first initialize computeComputeInstanceARMGenerator 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 ComputeComputeInstanceARMGenerator() gopter.Gen { + if computeComputeInstanceARMGenerator != nil { + return computeComputeInstanceARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeComputeInstanceARM(generators) + computeComputeInstanceARMGenerator = gen.Struct(reflect.TypeOf(Compute_ComputeInstanceARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeComputeInstanceARM(generators) + AddRelatedPropertyGeneratorsForComputeComputeInstanceARM(generators) + computeComputeInstanceARMGenerator = gen.Struct(reflect.TypeOf(Compute_ComputeInstanceARM{}), generators) + + return computeComputeInstanceARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeComputeInstanceARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeComputeInstanceARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeComputeInstanceComputeTypeComputeInstance) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeComputeInstanceARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeComputeInstanceARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(ComputeInstancePropertiesARMGenerator()) +} + +func Test_Compute_DataFactoryARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_DataFactoryARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDataFactoryARM, ComputeDataFactoryARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDataFactoryARM runs a test to see if a specific instance of Compute_DataFactoryARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDataFactoryARM(subject Compute_DataFactoryARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_DataFactoryARM + 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 Compute_DataFactoryARM instances for property testing - lazily instantiated by +// ComputeDataFactoryARMGenerator() +var computeDataFactoryARMGenerator gopter.Gen + +// ComputeDataFactoryARMGenerator returns a generator of Compute_DataFactoryARM instances for property testing. +func ComputeDataFactoryARMGenerator() gopter.Gen { + if computeDataFactoryARMGenerator != nil { + return computeDataFactoryARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataFactoryARM(generators) + computeDataFactoryARMGenerator = gen.Struct(reflect.TypeOf(Compute_DataFactoryARM{}), generators) + + return computeDataFactoryARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDataFactoryARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDataFactoryARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeDataFactoryComputeTypeDataFactory) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Compute_DataLakeAnalyticsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_DataLakeAnalyticsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDataLakeAnalyticsARM, ComputeDataLakeAnalyticsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDataLakeAnalyticsARM runs a test to see if a specific instance of Compute_DataLakeAnalyticsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDataLakeAnalyticsARM(subject Compute_DataLakeAnalyticsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_DataLakeAnalyticsARM + 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 Compute_DataLakeAnalyticsARM instances for property testing - lazily instantiated by +// ComputeDataLakeAnalyticsARMGenerator() +var computeDataLakeAnalyticsARMGenerator gopter.Gen + +// ComputeDataLakeAnalyticsARMGenerator returns a generator of Compute_DataLakeAnalyticsARM instances for property testing. +// We first initialize computeDataLakeAnalyticsARMGenerator 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 ComputeDataLakeAnalyticsARMGenerator() gopter.Gen { + if computeDataLakeAnalyticsARMGenerator != nil { + return computeDataLakeAnalyticsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataLakeAnalyticsARM(generators) + computeDataLakeAnalyticsARMGenerator = gen.Struct(reflect.TypeOf(Compute_DataLakeAnalyticsARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataLakeAnalyticsARM(generators) + AddRelatedPropertyGeneratorsForComputeDataLakeAnalyticsARM(generators) + computeDataLakeAnalyticsARMGenerator = gen.Struct(reflect.TypeOf(Compute_DataLakeAnalyticsARM{}), generators) + + return computeDataLakeAnalyticsARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDataLakeAnalyticsARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDataLakeAnalyticsARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeDataLakeAnalyticsComputeTypeDataLakeAnalytics) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeDataLakeAnalyticsARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeDataLakeAnalyticsARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(DataLakeAnalyticsPropertiesARMGenerator()) +} + +func Test_Compute_DatabricksARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_DatabricksARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDatabricksARM, ComputeDatabricksARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDatabricksARM runs a test to see if a specific instance of Compute_DatabricksARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDatabricksARM(subject Compute_DatabricksARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_DatabricksARM + 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 Compute_DatabricksARM instances for property testing - lazily instantiated by +// ComputeDatabricksARMGenerator() +var computeDatabricksARMGenerator gopter.Gen + +// ComputeDatabricksARMGenerator returns a generator of Compute_DatabricksARM instances for property testing. +// We first initialize computeDatabricksARMGenerator 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 ComputeDatabricksARMGenerator() gopter.Gen { + if computeDatabricksARMGenerator != nil { + return computeDatabricksARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDatabricksARM(generators) + computeDatabricksARMGenerator = gen.Struct(reflect.TypeOf(Compute_DatabricksARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDatabricksARM(generators) + AddRelatedPropertyGeneratorsForComputeDatabricksARM(generators) + computeDatabricksARMGenerator = gen.Struct(reflect.TypeOf(Compute_DatabricksARM{}), generators) + + return computeDatabricksARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDatabricksARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDatabricksARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeDatabricksComputeTypeDatabricks) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeDatabricksARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeDatabricksARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(DatabricksPropertiesARMGenerator()) +} + +func Test_Compute_HDInsightARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_HDInsightARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeHDInsightARM, ComputeHDInsightARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeHDInsightARM runs a test to see if a specific instance of Compute_HDInsightARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeHDInsightARM(subject Compute_HDInsightARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_HDInsightARM + 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 Compute_HDInsightARM instances for property testing - lazily instantiated by +// ComputeHDInsightARMGenerator() +var computeHDInsightARMGenerator gopter.Gen + +// ComputeHDInsightARMGenerator returns a generator of Compute_HDInsightARM instances for property testing. +// We first initialize computeHDInsightARMGenerator 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 ComputeHDInsightARMGenerator() gopter.Gen { + if computeHDInsightARMGenerator != nil { + return computeHDInsightARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeHDInsightARM(generators) + computeHDInsightARMGenerator = gen.Struct(reflect.TypeOf(Compute_HDInsightARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeHDInsightARM(generators) + AddRelatedPropertyGeneratorsForComputeHDInsightARM(generators) + computeHDInsightARMGenerator = gen.Struct(reflect.TypeOf(Compute_HDInsightARM{}), generators) + + return computeHDInsightARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeHDInsightARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeHDInsightARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeHDInsightComputeTypeHDInsight) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeHDInsightARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeHDInsightARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(HDInsightPropertiesARMGenerator()) +} + +func Test_Compute_SynapseSparkARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_SynapseSparkARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeSynapseSparkARM, ComputeSynapseSparkARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeSynapseSparkARM runs a test to see if a specific instance of Compute_SynapseSparkARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeSynapseSparkARM(subject Compute_SynapseSparkARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_SynapseSparkARM + 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 Compute_SynapseSparkARM instances for property testing - lazily instantiated by +// ComputeSynapseSparkARMGenerator() +var computeSynapseSparkARMGenerator gopter.Gen + +// ComputeSynapseSparkARMGenerator returns a generator of Compute_SynapseSparkARM instances for property testing. +// We first initialize computeSynapseSparkARMGenerator 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 ComputeSynapseSparkARMGenerator() gopter.Gen { + if computeSynapseSparkARMGenerator != nil { + return computeSynapseSparkARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeSynapseSparkARM(generators) + computeSynapseSparkARMGenerator = gen.Struct(reflect.TypeOf(Compute_SynapseSparkARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeSynapseSparkARM(generators) + AddRelatedPropertyGeneratorsForComputeSynapseSparkARM(generators) + computeSynapseSparkARMGenerator = gen.Struct(reflect.TypeOf(Compute_SynapseSparkARM{}), generators) + + return computeSynapseSparkARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeSynapseSparkARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeSynapseSparkARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeSynapseSparkComputeTypeSynapseSpark) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeSynapseSparkARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeSynapseSparkARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SynapseSparkPropertiesARMGenerator()) +} + +func Test_Compute_VirtualMachineARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_VirtualMachineARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeVirtualMachineARM, ComputeVirtualMachineARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeVirtualMachineARM runs a test to see if a specific instance of Compute_VirtualMachineARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeVirtualMachineARM(subject Compute_VirtualMachineARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_VirtualMachineARM + 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 Compute_VirtualMachineARM instances for property testing - lazily instantiated by +// ComputeVirtualMachineARMGenerator() +var computeVirtualMachineARMGenerator gopter.Gen + +// ComputeVirtualMachineARMGenerator returns a generator of Compute_VirtualMachineARM instances for property testing. +// We first initialize computeVirtualMachineARMGenerator 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 ComputeVirtualMachineARMGenerator() gopter.Gen { + if computeVirtualMachineARMGenerator != nil { + return computeVirtualMachineARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeVirtualMachineARM(generators) + computeVirtualMachineARMGenerator = gen.Struct(reflect.TypeOf(Compute_VirtualMachineARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeVirtualMachineARM(generators) + AddRelatedPropertyGeneratorsForComputeVirtualMachineARM(generators) + computeVirtualMachineARMGenerator = gen.Struct(reflect.TypeOf(Compute_VirtualMachineARM{}), generators) + + return computeVirtualMachineARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeVirtualMachineARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeVirtualMachineARM(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.OneConstOf(ComputeVirtualMachineComputeTypeVirtualMachine) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeVirtualMachineARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeVirtualMachineARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(VirtualMachinePropertiesARMGenerator()) +} + +func Test_AKSPropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AKSPropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAKSPropertiesARM, AKSPropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAKSPropertiesARM runs a test to see if a specific instance of AKSPropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAKSPropertiesARM(subject AKSPropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AKSPropertiesARM + 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 AKSPropertiesARM instances for property testing - lazily instantiated by AKSPropertiesARMGenerator() +var aksPropertiesARMGenerator gopter.Gen + +// AKSPropertiesARMGenerator returns a generator of AKSPropertiesARM instances for property testing. +// We first initialize aksPropertiesARMGenerator 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 AKSPropertiesARMGenerator() gopter.Gen { + if aksPropertiesARMGenerator != nil { + return aksPropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAKSPropertiesARM(generators) + aksPropertiesARMGenerator = gen.Struct(reflect.TypeOf(AKSPropertiesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAKSPropertiesARM(generators) + AddRelatedPropertyGeneratorsForAKSPropertiesARM(generators) + aksPropertiesARMGenerator = gen.Struct(reflect.TypeOf(AKSPropertiesARM{}), generators) + + return aksPropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForAKSPropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAKSPropertiesARM(gens map[string]gopter.Gen) { + gens["AgentCount"] = gen.PtrOf(gen.Int()) + gens["AgentVmSize"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterFqdn"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterPurpose"] = gen.PtrOf(gen.OneConstOf(AKSPropertiesClusterPurposeDenseProd, AKSPropertiesClusterPurposeDevTest, AKSPropertiesClusterPurposeFastProd)) + gens["LoadBalancerSubnet"] = gen.PtrOf(gen.AlphaString()) + gens["LoadBalancerType"] = gen.PtrOf(gen.OneConstOf(AKSPropertiesLoadBalancerTypeInternalLoadBalancer, AKSPropertiesLoadBalancerTypePublicIp)) +} + +// AddRelatedPropertyGeneratorsForAKSPropertiesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForAKSPropertiesARM(gens map[string]gopter.Gen) { + gens["AksNetworkingConfiguration"] = gen.PtrOf(AksNetworkingConfigurationARMGenerator()) + gens["SslConfiguration"] = gen.PtrOf(SslConfigurationARMGenerator()) +} + +func Test_AmlComputePropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AmlComputePropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAmlComputePropertiesARM, AmlComputePropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAmlComputePropertiesARM runs a test to see if a specific instance of AmlComputePropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAmlComputePropertiesARM(subject AmlComputePropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AmlComputePropertiesARM + 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 AmlComputePropertiesARM instances for property testing - lazily instantiated by +// AmlComputePropertiesARMGenerator() +var amlComputePropertiesARMGenerator gopter.Gen + +// AmlComputePropertiesARMGenerator returns a generator of AmlComputePropertiesARM instances for property testing. +// We first initialize amlComputePropertiesARMGenerator 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 AmlComputePropertiesARMGenerator() gopter.Gen { + if amlComputePropertiesARMGenerator != nil { + return amlComputePropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAmlComputePropertiesARM(generators) + amlComputePropertiesARMGenerator = gen.Struct(reflect.TypeOf(AmlComputePropertiesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAmlComputePropertiesARM(generators) + AddRelatedPropertyGeneratorsForAmlComputePropertiesARM(generators) + amlComputePropertiesARMGenerator = gen.Struct(reflect.TypeOf(AmlComputePropertiesARM{}), generators) + + return amlComputePropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForAmlComputePropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAmlComputePropertiesARM(gens map[string]gopter.Gen) { + gens["EnableNodePublicIp"] = gen.PtrOf(gen.Bool()) + gens["IsolatedNetwork"] = gen.PtrOf(gen.Bool()) + gens["OsType"] = gen.PtrOf(gen.OneConstOf(AmlComputePropertiesOsTypeLinux, AmlComputePropertiesOsTypeWindows)) + gens["RemoteLoginPortPublicAccess"] = gen.PtrOf(gen.OneConstOf(AmlComputePropertiesRemoteLoginPortPublicAccessDisabled, AmlComputePropertiesRemoteLoginPortPublicAccessEnabled, AmlComputePropertiesRemoteLoginPortPublicAccessNotSpecified)) + gens["VmPriority"] = gen.PtrOf(gen.OneConstOf(AmlComputePropertiesVmPriorityDedicated, AmlComputePropertiesVmPriorityLowPriority)) + gens["VmSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForAmlComputePropertiesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForAmlComputePropertiesARM(gens map[string]gopter.Gen) { + gens["ScaleSettings"] = gen.PtrOf(ScaleSettingsARMGenerator()) + gens["Subnet"] = gen.PtrOf(ResourceIdARMGenerator()) + gens["UserAccountCredentials"] = gen.PtrOf(UserAccountCredentialsARMGenerator()) + gens["VirtualMachineImage"] = gen.PtrOf(VirtualMachineImageARMGenerator()) +} + +func Test_ComputeInstancePropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeInstancePropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeInstancePropertiesARM, ComputeInstancePropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeInstancePropertiesARM runs a test to see if a specific instance of ComputeInstancePropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeInstancePropertiesARM(subject ComputeInstancePropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeInstancePropertiesARM + 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 ComputeInstancePropertiesARM instances for property testing - lazily instantiated by +// ComputeInstancePropertiesARMGenerator() +var computeInstancePropertiesARMGenerator gopter.Gen + +// ComputeInstancePropertiesARMGenerator returns a generator of ComputeInstancePropertiesARM instances for property testing. +// We first initialize computeInstancePropertiesARMGenerator 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 ComputeInstancePropertiesARMGenerator() gopter.Gen { + if computeInstancePropertiesARMGenerator != nil { + return computeInstancePropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstancePropertiesARM(generators) + computeInstancePropertiesARMGenerator = gen.Struct(reflect.TypeOf(ComputeInstancePropertiesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstancePropertiesARM(generators) + AddRelatedPropertyGeneratorsForComputeInstancePropertiesARM(generators) + computeInstancePropertiesARMGenerator = gen.Struct(reflect.TypeOf(ComputeInstancePropertiesARM{}), generators) + + return computeInstancePropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeInstancePropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeInstancePropertiesARM(gens map[string]gopter.Gen) { + gens["ApplicationSharingPolicy"] = gen.PtrOf(gen.OneConstOf(ComputeInstancePropertiesApplicationSharingPolicyPersonal, ComputeInstancePropertiesApplicationSharingPolicyShared)) + gens["ComputeInstanceAuthorizationType"] = gen.PtrOf(gen.OneConstOf(ComputeInstancePropertiesComputeInstanceAuthorizationTypePersonal)) + gens["VmSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeInstancePropertiesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeInstancePropertiesARM(gens map[string]gopter.Gen) { + gens["PersonalComputeInstanceSettings"] = gen.PtrOf(PersonalComputeInstanceSettingsARMGenerator()) + gens["SetupScripts"] = gen.PtrOf(SetupScriptsARMGenerator()) + gens["SshSettings"] = gen.PtrOf(ComputeInstanceSshSettingsARMGenerator()) + gens["Subnet"] = gen.PtrOf(ResourceIdARMGenerator()) +} + +func Test_DataLakeAnalyticsPropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of DataLakeAnalyticsPropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDataLakeAnalyticsPropertiesARM, DataLakeAnalyticsPropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDataLakeAnalyticsPropertiesARM runs a test to see if a specific instance of DataLakeAnalyticsPropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForDataLakeAnalyticsPropertiesARM(subject DataLakeAnalyticsPropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual DataLakeAnalyticsPropertiesARM + 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 DataLakeAnalyticsPropertiesARM instances for property testing - lazily instantiated by +// DataLakeAnalyticsPropertiesARMGenerator() +var dataLakeAnalyticsPropertiesARMGenerator gopter.Gen + +// DataLakeAnalyticsPropertiesARMGenerator returns a generator of DataLakeAnalyticsPropertiesARM instances for property testing. +func DataLakeAnalyticsPropertiesARMGenerator() gopter.Gen { + if dataLakeAnalyticsPropertiesARMGenerator != nil { + return dataLakeAnalyticsPropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDataLakeAnalyticsPropertiesARM(generators) + dataLakeAnalyticsPropertiesARMGenerator = gen.Struct(reflect.TypeOf(DataLakeAnalyticsPropertiesARM{}), generators) + + return dataLakeAnalyticsPropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForDataLakeAnalyticsPropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDataLakeAnalyticsPropertiesARM(gens map[string]gopter.Gen) { + gens["DataLakeStoreAccountName"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_DatabricksPropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of DatabricksPropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDatabricksPropertiesARM, DatabricksPropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDatabricksPropertiesARM runs a test to see if a specific instance of DatabricksPropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForDatabricksPropertiesARM(subject DatabricksPropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual DatabricksPropertiesARM + 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 DatabricksPropertiesARM instances for property testing - lazily instantiated by +// DatabricksPropertiesARMGenerator() +var databricksPropertiesARMGenerator gopter.Gen + +// DatabricksPropertiesARMGenerator returns a generator of DatabricksPropertiesARM instances for property testing. +func DatabricksPropertiesARMGenerator() gopter.Gen { + if databricksPropertiesARMGenerator != nil { + return databricksPropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDatabricksPropertiesARM(generators) + databricksPropertiesARMGenerator = gen.Struct(reflect.TypeOf(DatabricksPropertiesARM{}), generators) + + return databricksPropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForDatabricksPropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDatabricksPropertiesARM(gens map[string]gopter.Gen) { + gens["DatabricksAccessToken"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceUrl"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_HDInsightPropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of HDInsightPropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForHDInsightPropertiesARM, HDInsightPropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForHDInsightPropertiesARM runs a test to see if a specific instance of HDInsightPropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForHDInsightPropertiesARM(subject HDInsightPropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual HDInsightPropertiesARM + 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 HDInsightPropertiesARM instances for property testing - lazily instantiated by +// HDInsightPropertiesARMGenerator() +var hdInsightPropertiesARMGenerator gopter.Gen + +// HDInsightPropertiesARMGenerator returns a generator of HDInsightPropertiesARM instances for property testing. +// We first initialize hdInsightPropertiesARMGenerator 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 HDInsightPropertiesARMGenerator() gopter.Gen { + if hdInsightPropertiesARMGenerator != nil { + return hdInsightPropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForHDInsightPropertiesARM(generators) + hdInsightPropertiesARMGenerator = gen.Struct(reflect.TypeOf(HDInsightPropertiesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForHDInsightPropertiesARM(generators) + AddRelatedPropertyGeneratorsForHDInsightPropertiesARM(generators) + hdInsightPropertiesARMGenerator = gen.Struct(reflect.TypeOf(HDInsightPropertiesARM{}), generators) + + return hdInsightPropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForHDInsightPropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForHDInsightPropertiesARM(gens map[string]gopter.Gen) { + gens["Address"] = gen.PtrOf(gen.AlphaString()) + gens["SshPort"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForHDInsightPropertiesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForHDInsightPropertiesARM(gens map[string]gopter.Gen) { + gens["AdministratorAccount"] = gen.PtrOf(VirtualMachineSshCredentialsARMGenerator()) +} + +func Test_SynapseSparkPropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SynapseSparkPropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSynapseSparkPropertiesARM, SynapseSparkPropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSynapseSparkPropertiesARM runs a test to see if a specific instance of SynapseSparkPropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSynapseSparkPropertiesARM(subject SynapseSparkPropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SynapseSparkPropertiesARM + 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 SynapseSparkPropertiesARM instances for property testing - lazily instantiated by +// SynapseSparkPropertiesARMGenerator() +var synapseSparkPropertiesARMGenerator gopter.Gen + +// SynapseSparkPropertiesARMGenerator returns a generator of SynapseSparkPropertiesARM instances for property testing. +// We first initialize synapseSparkPropertiesARMGenerator 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 SynapseSparkPropertiesARMGenerator() gopter.Gen { + if synapseSparkPropertiesARMGenerator != nil { + return synapseSparkPropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSynapseSparkPropertiesARM(generators) + synapseSparkPropertiesARMGenerator = gen.Struct(reflect.TypeOf(SynapseSparkPropertiesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSynapseSparkPropertiesARM(generators) + AddRelatedPropertyGeneratorsForSynapseSparkPropertiesARM(generators) + synapseSparkPropertiesARMGenerator = gen.Struct(reflect.TypeOf(SynapseSparkPropertiesARM{}), generators) + + return synapseSparkPropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForSynapseSparkPropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSynapseSparkPropertiesARM(gens map[string]gopter.Gen) { + gens["NodeCount"] = gen.PtrOf(gen.Int()) + gens["NodeSize"] = gen.PtrOf(gen.AlphaString()) + gens["NodeSizeFamily"] = gen.PtrOf(gen.AlphaString()) + gens["PoolName"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceGroup"] = gen.PtrOf(gen.AlphaString()) + gens["SparkVersion"] = gen.PtrOf(gen.AlphaString()) + gens["SubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceName"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSynapseSparkPropertiesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSynapseSparkPropertiesARM(gens map[string]gopter.Gen) { + gens["AutoPauseProperties"] = gen.PtrOf(AutoPausePropertiesARMGenerator()) + gens["AutoScaleProperties"] = gen.PtrOf(AutoScalePropertiesARMGenerator()) +} + +func Test_VirtualMachinePropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachinePropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachinePropertiesARM, VirtualMachinePropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachinePropertiesARM runs a test to see if a specific instance of VirtualMachinePropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachinePropertiesARM(subject VirtualMachinePropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachinePropertiesARM + 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 VirtualMachinePropertiesARM instances for property testing - lazily instantiated by +// VirtualMachinePropertiesARMGenerator() +var virtualMachinePropertiesARMGenerator gopter.Gen + +// VirtualMachinePropertiesARMGenerator returns a generator of VirtualMachinePropertiesARM instances for property testing. +// We first initialize virtualMachinePropertiesARMGenerator 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 VirtualMachinePropertiesARMGenerator() gopter.Gen { + if virtualMachinePropertiesARMGenerator != nil { + return virtualMachinePropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachinePropertiesARM(generators) + virtualMachinePropertiesARMGenerator = gen.Struct(reflect.TypeOf(VirtualMachinePropertiesARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachinePropertiesARM(generators) + AddRelatedPropertyGeneratorsForVirtualMachinePropertiesARM(generators) + virtualMachinePropertiesARMGenerator = gen.Struct(reflect.TypeOf(VirtualMachinePropertiesARM{}), generators) + + return virtualMachinePropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForVirtualMachinePropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForVirtualMachinePropertiesARM(gens map[string]gopter.Gen) { + gens["Address"] = gen.PtrOf(gen.AlphaString()) + gens["IsNotebookInstanceCompute"] = gen.PtrOf(gen.Bool()) + gens["SshPort"] = gen.PtrOf(gen.Int()) + gens["VirtualMachineSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForVirtualMachinePropertiesARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForVirtualMachinePropertiesARM(gens map[string]gopter.Gen) { + gens["AdministratorAccount"] = gen.PtrOf(VirtualMachineSshCredentialsARMGenerator()) +} + +func Test_AksNetworkingConfigurationARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AksNetworkingConfigurationARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAksNetworkingConfigurationARM, AksNetworkingConfigurationARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAksNetworkingConfigurationARM runs a test to see if a specific instance of AksNetworkingConfigurationARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAksNetworkingConfigurationARM(subject AksNetworkingConfigurationARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AksNetworkingConfigurationARM + 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 AksNetworkingConfigurationARM instances for property testing - lazily instantiated by +// AksNetworkingConfigurationARMGenerator() +var aksNetworkingConfigurationARMGenerator gopter.Gen + +// AksNetworkingConfigurationARMGenerator returns a generator of AksNetworkingConfigurationARM instances for property testing. +func AksNetworkingConfigurationARMGenerator() gopter.Gen { + if aksNetworkingConfigurationARMGenerator != nil { + return aksNetworkingConfigurationARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAksNetworkingConfigurationARM(generators) + aksNetworkingConfigurationARMGenerator = gen.Struct(reflect.TypeOf(AksNetworkingConfigurationARM{}), generators) + + return aksNetworkingConfigurationARMGenerator +} + +// AddIndependentPropertyGeneratorsForAksNetworkingConfigurationARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAksNetworkingConfigurationARM(gens map[string]gopter.Gen) { + gens["DnsServiceIP"] = gen.PtrOf(gen.AlphaString()) + gens["DockerBridgeCidr"] = gen.PtrOf(gen.AlphaString()) + gens["ServiceCidr"] = gen.PtrOf(gen.AlphaString()) + gens["SubnetId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_AutoPausePropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AutoPausePropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAutoPausePropertiesARM, AutoPausePropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAutoPausePropertiesARM runs a test to see if a specific instance of AutoPausePropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAutoPausePropertiesARM(subject AutoPausePropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AutoPausePropertiesARM + 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 AutoPausePropertiesARM instances for property testing - lazily instantiated by +// AutoPausePropertiesARMGenerator() +var autoPausePropertiesARMGenerator gopter.Gen + +// AutoPausePropertiesARMGenerator returns a generator of AutoPausePropertiesARM instances for property testing. +func AutoPausePropertiesARMGenerator() gopter.Gen { + if autoPausePropertiesARMGenerator != nil { + return autoPausePropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAutoPausePropertiesARM(generators) + autoPausePropertiesARMGenerator = gen.Struct(reflect.TypeOf(AutoPausePropertiesARM{}), generators) + + return autoPausePropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForAutoPausePropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAutoPausePropertiesARM(gens map[string]gopter.Gen) { + gens["DelayInMinutes"] = gen.PtrOf(gen.Int()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) +} + +func Test_AutoScalePropertiesARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AutoScalePropertiesARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAutoScalePropertiesARM, AutoScalePropertiesARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAutoScalePropertiesARM runs a test to see if a specific instance of AutoScalePropertiesARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAutoScalePropertiesARM(subject AutoScalePropertiesARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AutoScalePropertiesARM + 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 AutoScalePropertiesARM instances for property testing - lazily instantiated by +// AutoScalePropertiesARMGenerator() +var autoScalePropertiesARMGenerator gopter.Gen + +// AutoScalePropertiesARMGenerator returns a generator of AutoScalePropertiesARM instances for property testing. +func AutoScalePropertiesARMGenerator() gopter.Gen { + if autoScalePropertiesARMGenerator != nil { + return autoScalePropertiesARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAutoScalePropertiesARM(generators) + autoScalePropertiesARMGenerator = gen.Struct(reflect.TypeOf(AutoScalePropertiesARM{}), generators) + + return autoScalePropertiesARMGenerator +} + +// AddIndependentPropertyGeneratorsForAutoScalePropertiesARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAutoScalePropertiesARM(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["MaxNodeCount"] = gen.PtrOf(gen.Int()) + gens["MinNodeCount"] = gen.PtrOf(gen.Int()) +} + +func Test_ComputeInstanceSshSettingsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeInstanceSshSettingsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeInstanceSshSettingsARM, ComputeInstanceSshSettingsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeInstanceSshSettingsARM runs a test to see if a specific instance of ComputeInstanceSshSettingsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeInstanceSshSettingsARM(subject ComputeInstanceSshSettingsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeInstanceSshSettingsARM + 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 ComputeInstanceSshSettingsARM instances for property testing - lazily instantiated by +// ComputeInstanceSshSettingsARMGenerator() +var computeInstanceSshSettingsARMGenerator gopter.Gen + +// ComputeInstanceSshSettingsARMGenerator returns a generator of ComputeInstanceSshSettingsARM instances for property testing. +func ComputeInstanceSshSettingsARMGenerator() gopter.Gen { + if computeInstanceSshSettingsARMGenerator != nil { + return computeInstanceSshSettingsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstanceSshSettingsARM(generators) + computeInstanceSshSettingsARMGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceSshSettingsARM{}), generators) + + return computeInstanceSshSettingsARMGenerator +} + +// AddIndependentPropertyGeneratorsForComputeInstanceSshSettingsARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeInstanceSshSettingsARM(gens map[string]gopter.Gen) { + gens["AdminPublicKey"] = gen.PtrOf(gen.AlphaString()) + gens["SshPublicAccess"] = gen.PtrOf(gen.OneConstOf(ComputeInstanceSshSettingsSshPublicAccessDisabled, ComputeInstanceSshSettingsSshPublicAccessEnabled)) +} + +func Test_PersonalComputeInstanceSettingsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PersonalComputeInstanceSettingsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPersonalComputeInstanceSettingsARM, PersonalComputeInstanceSettingsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPersonalComputeInstanceSettingsARM runs a test to see if a specific instance of PersonalComputeInstanceSettingsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForPersonalComputeInstanceSettingsARM(subject PersonalComputeInstanceSettingsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PersonalComputeInstanceSettingsARM + 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 PersonalComputeInstanceSettingsARM instances for property testing - lazily instantiated by +// PersonalComputeInstanceSettingsARMGenerator() +var personalComputeInstanceSettingsARMGenerator gopter.Gen + +// PersonalComputeInstanceSettingsARMGenerator returns a generator of PersonalComputeInstanceSettingsARM instances for property testing. +func PersonalComputeInstanceSettingsARMGenerator() gopter.Gen { + if personalComputeInstanceSettingsARMGenerator != nil { + return personalComputeInstanceSettingsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettingsARM(generators) + personalComputeInstanceSettingsARMGenerator = gen.Struct(reflect.TypeOf(PersonalComputeInstanceSettingsARM{}), generators) + + return personalComputeInstanceSettingsARMGenerator +} + +// AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettingsARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettingsARM(gens map[string]gopter.Gen) { + gens["AssignedUser"] = gen.PtrOf(AssignedUserARMGenerator()) +} + +func Test_ResourceIdARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ResourceIdARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForResourceIdARM, ResourceIdARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForResourceIdARM runs a test to see if a specific instance of ResourceIdARM round trips to JSON and back losslessly +func RunJSONSerializationTestForResourceIdARM(subject ResourceIdARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ResourceIdARM + 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 ResourceIdARM instances for property testing - lazily instantiated by ResourceIdARMGenerator() +var resourceIdARMGenerator gopter.Gen + +// ResourceIdARMGenerator returns a generator of ResourceIdARM instances for property testing. +func ResourceIdARMGenerator() gopter.Gen { + if resourceIdARMGenerator != nil { + return resourceIdARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForResourceIdARM(generators) + resourceIdARMGenerator = gen.Struct(reflect.TypeOf(ResourceIdARM{}), generators) + + return resourceIdARMGenerator +} + +// AddIndependentPropertyGeneratorsForResourceIdARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForResourceIdARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScaleSettingsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScaleSettingsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScaleSettingsARM, ScaleSettingsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScaleSettingsARM runs a test to see if a specific instance of ScaleSettingsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForScaleSettingsARM(subject ScaleSettingsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScaleSettingsARM + 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 ScaleSettingsARM instances for property testing - lazily instantiated by ScaleSettingsARMGenerator() +var scaleSettingsARMGenerator gopter.Gen + +// ScaleSettingsARMGenerator returns a generator of ScaleSettingsARM instances for property testing. +func ScaleSettingsARMGenerator() gopter.Gen { + if scaleSettingsARMGenerator != nil { + return scaleSettingsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScaleSettingsARM(generators) + scaleSettingsARMGenerator = gen.Struct(reflect.TypeOf(ScaleSettingsARM{}), generators) + + return scaleSettingsARMGenerator +} + +// AddIndependentPropertyGeneratorsForScaleSettingsARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScaleSettingsARM(gens map[string]gopter.Gen) { + gens["MaxNodeCount"] = gen.PtrOf(gen.Int()) + gens["MinNodeCount"] = gen.PtrOf(gen.Int()) + gens["NodeIdleTimeBeforeScaleDown"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SetupScriptsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SetupScriptsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSetupScriptsARM, SetupScriptsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSetupScriptsARM runs a test to see if a specific instance of SetupScriptsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSetupScriptsARM(subject SetupScriptsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SetupScriptsARM + 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 SetupScriptsARM instances for property testing - lazily instantiated by SetupScriptsARMGenerator() +var setupScriptsARMGenerator gopter.Gen + +// SetupScriptsARMGenerator returns a generator of SetupScriptsARM instances for property testing. +func SetupScriptsARMGenerator() gopter.Gen { + if setupScriptsARMGenerator != nil { + return setupScriptsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForSetupScriptsARM(generators) + setupScriptsARMGenerator = gen.Struct(reflect.TypeOf(SetupScriptsARM{}), generators) + + return setupScriptsARMGenerator +} + +// AddRelatedPropertyGeneratorsForSetupScriptsARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSetupScriptsARM(gens map[string]gopter.Gen) { + gens["Scripts"] = gen.PtrOf(ScriptsToExecuteARMGenerator()) +} + +func Test_SslConfigurationARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SslConfigurationARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSslConfigurationARM, SslConfigurationARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSslConfigurationARM runs a test to see if a specific instance of SslConfigurationARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSslConfigurationARM(subject SslConfigurationARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SslConfigurationARM + 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 SslConfigurationARM instances for property testing - lazily instantiated by +// SslConfigurationARMGenerator() +var sslConfigurationARMGenerator gopter.Gen + +// SslConfigurationARMGenerator returns a generator of SslConfigurationARM instances for property testing. +func SslConfigurationARMGenerator() gopter.Gen { + if sslConfigurationARMGenerator != nil { + return sslConfigurationARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSslConfigurationARM(generators) + sslConfigurationARMGenerator = gen.Struct(reflect.TypeOf(SslConfigurationARM{}), generators) + + return sslConfigurationARMGenerator +} + +// AddIndependentPropertyGeneratorsForSslConfigurationARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSslConfigurationARM(gens map[string]gopter.Gen) { + gens["Cert"] = gen.PtrOf(gen.AlphaString()) + gens["Cname"] = gen.PtrOf(gen.AlphaString()) + gens["Key"] = gen.PtrOf(gen.AlphaString()) + gens["LeafDomainLabel"] = gen.PtrOf(gen.AlphaString()) + gens["OverwriteExistingDomain"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.OneConstOf(SslConfigurationStatusAuto, SslConfigurationStatusDisabled, SslConfigurationStatusEnabled)) +} + +func Test_UserAccountCredentialsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAccountCredentialsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAccountCredentialsARM, UserAccountCredentialsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAccountCredentialsARM runs a test to see if a specific instance of UserAccountCredentialsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAccountCredentialsARM(subject UserAccountCredentialsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAccountCredentialsARM + 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 UserAccountCredentialsARM instances for property testing - lazily instantiated by +// UserAccountCredentialsARMGenerator() +var userAccountCredentialsARMGenerator gopter.Gen + +// UserAccountCredentialsARMGenerator returns a generator of UserAccountCredentialsARM instances for property testing. +func UserAccountCredentialsARMGenerator() gopter.Gen { + if userAccountCredentialsARMGenerator != nil { + return userAccountCredentialsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAccountCredentialsARM(generators) + userAccountCredentialsARMGenerator = gen.Struct(reflect.TypeOf(UserAccountCredentialsARM{}), generators) + + return userAccountCredentialsARMGenerator +} + +// AddIndependentPropertyGeneratorsForUserAccountCredentialsARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAccountCredentialsARM(gens map[string]gopter.Gen) { + gens["AdminUserName"] = gen.PtrOf(gen.AlphaString()) + gens["AdminUserPassword"] = gen.PtrOf(gen.AlphaString()) + gens["AdminUserSshPublicKey"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_VirtualMachineImageARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineImageARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineImageARM, VirtualMachineImageARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineImageARM runs a test to see if a specific instance of VirtualMachineImageARM round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineImageARM(subject VirtualMachineImageARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineImageARM + 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 VirtualMachineImageARM instances for property testing - lazily instantiated by +// VirtualMachineImageARMGenerator() +var virtualMachineImageARMGenerator gopter.Gen + +// VirtualMachineImageARMGenerator returns a generator of VirtualMachineImageARM instances for property testing. +func VirtualMachineImageARMGenerator() gopter.Gen { + if virtualMachineImageARMGenerator != nil { + return virtualMachineImageARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineImageARM(generators) + virtualMachineImageARMGenerator = gen.Struct(reflect.TypeOf(VirtualMachineImageARM{}), generators) + + return virtualMachineImageARMGenerator +} + +// AddIndependentPropertyGeneratorsForVirtualMachineImageARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForVirtualMachineImageARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_VirtualMachineSshCredentialsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineSshCredentialsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineSshCredentialsARM, VirtualMachineSshCredentialsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineSshCredentialsARM runs a test to see if a specific instance of VirtualMachineSshCredentialsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineSshCredentialsARM(subject VirtualMachineSshCredentialsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineSshCredentialsARM + 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 VirtualMachineSshCredentialsARM instances for property testing - lazily instantiated by +// VirtualMachineSshCredentialsARMGenerator() +var virtualMachineSshCredentialsARMGenerator gopter.Gen + +// VirtualMachineSshCredentialsARMGenerator returns a generator of VirtualMachineSshCredentialsARM instances for property testing. +func VirtualMachineSshCredentialsARMGenerator() gopter.Gen { + if virtualMachineSshCredentialsARMGenerator != nil { + return virtualMachineSshCredentialsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineSshCredentialsARM(generators) + virtualMachineSshCredentialsARMGenerator = gen.Struct(reflect.TypeOf(VirtualMachineSshCredentialsARM{}), generators) + + return virtualMachineSshCredentialsARMGenerator +} + +// AddIndependentPropertyGeneratorsForVirtualMachineSshCredentialsARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForVirtualMachineSshCredentialsARM(gens map[string]gopter.Gen) { + gens["Password"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateKeyData"] = gen.PtrOf(gen.AlphaString()) + gens["PublicKeyData"] = gen.PtrOf(gen.AlphaString()) + gens["Username"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_AssignedUserARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AssignedUserARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAssignedUserARM, AssignedUserARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAssignedUserARM runs a test to see if a specific instance of AssignedUserARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAssignedUserARM(subject AssignedUserARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AssignedUserARM + 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 AssignedUserARM instances for property testing - lazily instantiated by AssignedUserARMGenerator() +var assignedUserARMGenerator gopter.Gen + +// AssignedUserARMGenerator returns a generator of AssignedUserARM instances for property testing. +func AssignedUserARMGenerator() gopter.Gen { + if assignedUserARMGenerator != nil { + return assignedUserARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAssignedUserARM(generators) + assignedUserARMGenerator = gen.Struct(reflect.TypeOf(AssignedUserARM{}), generators) + + return assignedUserARMGenerator +} + +// AddIndependentPropertyGeneratorsForAssignedUserARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAssignedUserARM(gens map[string]gopter.Gen) { + gens["ObjectId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScriptsToExecuteARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScriptsToExecuteARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScriptsToExecuteARM, ScriptsToExecuteARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScriptsToExecuteARM runs a test to see if a specific instance of ScriptsToExecuteARM round trips to JSON and back losslessly +func RunJSONSerializationTestForScriptsToExecuteARM(subject ScriptsToExecuteARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScriptsToExecuteARM + 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 ScriptsToExecuteARM instances for property testing - lazily instantiated by +// ScriptsToExecuteARMGenerator() +var scriptsToExecuteARMGenerator gopter.Gen + +// ScriptsToExecuteARMGenerator returns a generator of ScriptsToExecuteARM instances for property testing. +func ScriptsToExecuteARMGenerator() gopter.Gen { + if scriptsToExecuteARMGenerator != nil { + return scriptsToExecuteARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScriptsToExecuteARM(generators) + scriptsToExecuteARMGenerator = gen.Struct(reflect.TypeOf(ScriptsToExecuteARM{}), generators) + + return scriptsToExecuteARMGenerator +} + +// AddRelatedPropertyGeneratorsForScriptsToExecuteARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScriptsToExecuteARM(gens map[string]gopter.Gen) { + gens["CreationScript"] = gen.PtrOf(ScriptReferenceARMGenerator()) + gens["StartupScript"] = gen.PtrOf(ScriptReferenceARMGenerator()) +} + +func Test_ScriptReferenceARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScriptReferenceARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScriptReferenceARM, ScriptReferenceARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScriptReferenceARM runs a test to see if a specific instance of ScriptReferenceARM round trips to JSON and back losslessly +func RunJSONSerializationTestForScriptReferenceARM(subject ScriptReferenceARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScriptReferenceARM + 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 ScriptReferenceARM instances for property testing - lazily instantiated by ScriptReferenceARMGenerator() +var scriptReferenceARMGenerator gopter.Gen + +// ScriptReferenceARMGenerator returns a generator of ScriptReferenceARM instances for property testing. +func ScriptReferenceARMGenerator() gopter.Gen { + if scriptReferenceARMGenerator != nil { + return scriptReferenceARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScriptReferenceARM(generators) + scriptReferenceARMGenerator = gen.Struct(reflect.TypeOf(ScriptReferenceARM{}), generators) + + return scriptReferenceARMGenerator +} + +// AddIndependentPropertyGeneratorsForScriptReferenceARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScriptReferenceARM(gens map[string]gopter.Gen) { + gens["ScriptArguments"] = gen.PtrOf(gen.AlphaString()) + gens["ScriptData"] = gen.PtrOf(gen.AlphaString()) + gens["ScriptSource"] = gen.PtrOf(gen.AlphaString()) + gens["Timeout"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen.go new file mode 100644 index 0000000000..82a93cac15 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen.go @@ -0,0 +1,909 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import ( + "fmt" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + kerrors "k8s.io/apimachinery/pkg/util/errors" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections +type WorkspacesConnection struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec WorkspacesConnections_Spec `json:"spec,omitempty"` + Status WorkspaceConnection_Status `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &WorkspacesConnection{} + +// GetConditions returns the conditions of the resource +func (connection *WorkspacesConnection) GetConditions() conditions.Conditions { + return connection.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (connection *WorkspacesConnection) SetConditions(conditions conditions.Conditions) { + connection.Status.Conditions = conditions +} + +var _ conversion.Convertible = &WorkspacesConnection{} + +// ConvertFrom populates our WorkspacesConnection from the provided hub WorkspacesConnection +func (connection *WorkspacesConnection) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20210701s.WorkspacesConnection) + if !ok { + return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/WorkspacesConnection but received %T instead", hub) + } + + return connection.AssignPropertiesFromWorkspacesConnection(source) +} + +// ConvertTo populates the provided hub WorkspacesConnection from our WorkspacesConnection +func (connection *WorkspacesConnection) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20210701s.WorkspacesConnection) + if !ok { + return fmt.Errorf("expected machinelearningservices/v1beta20210701storage/WorkspacesConnection but received %T instead", hub) + } + + return connection.AssignPropertiesToWorkspacesConnection(destination) +} + +// +kubebuilder:webhook:path=/mutate-machinelearningservices-azure-com-v1beta20210701-workspacesconnection,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspacesconnections,verbs=create;update,versions=v1beta20210701,name=default.v1beta20210701.workspacesconnections.machinelearningservices.azure.com,admissionReviewVersions=v1beta1 + +var _ admission.Defaulter = &WorkspacesConnection{} + +// Default applies defaults to the WorkspacesConnection resource +func (connection *WorkspacesConnection) Default() { + connection.defaultImpl() + var temp interface{} = connection + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (connection *WorkspacesConnection) defaultAzureName() { + if connection.Spec.AzureName == "" { + connection.Spec.AzureName = connection.Name + } +} + +// defaultImpl applies the code generated defaults to the WorkspacesConnection resource +func (connection *WorkspacesConnection) defaultImpl() { connection.defaultAzureName() } + +var _ genruntime.KubernetesResource = &WorkspacesConnection{} + +// AzureName returns the Azure name of the resource +func (connection *WorkspacesConnection) AzureName() string { + return connection.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01" +func (connection WorkspacesConnection) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetResourceKind returns the kind of the resource +func (connection *WorkspacesConnection) GetResourceKind() genruntime.ResourceKind { + return genruntime.ResourceKindNormal +} + +// GetSpec returns the specification of this resource +func (connection *WorkspacesConnection) GetSpec() genruntime.ConvertibleSpec { + return &connection.Spec +} + +// GetStatus returns the status of this resource +func (connection *WorkspacesConnection) GetStatus() genruntime.ConvertibleStatus { + return &connection.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/connections" +func (connection *WorkspacesConnection) GetType() string { + return "Microsoft.MachineLearningServices/workspaces/connections" +} + +// NewEmptyStatus returns a new empty (blank) status +func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleStatus { + return &WorkspaceConnection_Status{} +} + +// Owner returns the ResourceReference of the owner, or nil if there is no owner +func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(connection.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: connection.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (connection *WorkspacesConnection) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*WorkspaceConnection_Status); ok { + connection.Status = *st + return nil + } + + // Convert status to required version + var st WorkspaceConnection_Status + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + connection.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-machinelearningservices-azure-com-v1beta20210701-workspacesconnection,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=machinelearningservices.azure.com,resources=workspacesconnections,verbs=create;update,versions=v1beta20210701,name=validate.v1beta20210701.workspacesconnections.machinelearningservices.azure.com,admissionReviewVersions=v1beta1 + +var _ admission.Validator = &WorkspacesConnection{} + +// ValidateCreate validates the creation of the resource +func (connection *WorkspacesConnection) ValidateCreate() error { + validations := connection.createValidations() + var temp interface{} = connection + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation() + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// ValidateDelete validates the deletion of the resource +func (connection *WorkspacesConnection) ValidateDelete() error { + validations := connection.deleteValidations() + var temp interface{} = connection + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation() + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// ValidateUpdate validates an update of the resource +func (connection *WorkspacesConnection) ValidateUpdate(old runtime.Object) error { + validations := connection.updateValidations() + var temp interface{} = connection + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + var errs []error + for _, validation := range validations { + err := validation(old) + if err != nil { + errs = append(errs, err) + } + } + return kerrors.NewAggregate(errs) +} + +// createValidations validates the creation of the resource +func (connection *WorkspacesConnection) createValidations() []func() error { + return []func() error{connection.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (connection *WorkspacesConnection) deleteValidations() []func() error { + return nil +} + +// updateValidations validates the update of the resource +func (connection *WorkspacesConnection) updateValidations() []func(old runtime.Object) error { + return []func(old runtime.Object) error{ + func(old runtime.Object) error { + return connection.validateResourceReferences() + }, + connection.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (connection *WorkspacesConnection) validateResourceReferences() error { + refs, err := reflecthelpers.FindResourceReferences(&connection.Spec) + if err != nil { + return err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (connection *WorkspacesConnection) validateWriteOnceProperties(old runtime.Object) error { + oldObj, ok := old.(*WorkspacesConnection) + if !ok { + return nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, connection) +} + +// AssignPropertiesFromWorkspacesConnection populates our WorkspacesConnection from the provided source WorkspacesConnection +func (connection *WorkspacesConnection) AssignPropertiesFromWorkspacesConnection(source *v20210701s.WorkspacesConnection) error { + + // ObjectMeta + connection.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec WorkspacesConnections_Spec + err := spec.AssignPropertiesFromWorkspacesConnectionsSpec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspacesConnectionsSpec() to populate field Spec") + } + connection.Spec = spec + + // Status + var status WorkspaceConnection_Status + err = status.AssignPropertiesFromWorkspaceConnectionStatus(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesFromWorkspaceConnectionStatus() to populate field Status") + } + connection.Status = status + + // No error + return nil +} + +// AssignPropertiesToWorkspacesConnection populates the provided destination WorkspacesConnection from our WorkspacesConnection +func (connection *WorkspacesConnection) AssignPropertiesToWorkspacesConnection(destination *v20210701s.WorkspacesConnection) error { + + // ObjectMeta + destination.ObjectMeta = *connection.ObjectMeta.DeepCopy() + + // Spec + var spec v20210701s.WorkspacesConnections_Spec + err := connection.Spec.AssignPropertiesToWorkspacesConnectionsSpec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspacesConnectionsSpec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20210701s.WorkspaceConnection_Status + err = connection.Status.AssignPropertiesToWorkspaceConnectionStatus(&status) + if err != nil { + return errors.Wrap(err, "calling AssignPropertiesToWorkspaceConnectionStatus() 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 (connection *WorkspacesConnection) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: connection.Spec.OriginalVersion(), + Kind: "WorkspacesConnection", + } +} + +// +kubebuilder:object:root=true +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections +type WorkspacesConnectionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []WorkspacesConnection `json:"items"` +} + +type WorkspaceConnection_Status struct { + // AuthType: Authorization type of the workspace connection. + AuthType *string `json:"authType,omitempty"` + + // Category: Category of the workspace connection. + Category *string `json:"category,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // Id: ResourceId of the workspace connection. + Id *string `json:"id,omitempty"` + + // Name: Friendly name of the workspace connection. + Name *string `json:"name,omitempty"` + + // Target: Target of the workspace connection. + Target *string `json:"target,omitempty"` + + // Type: Resource type of workspace connection. + Type *string `json:"type,omitempty"` + + // Value: Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // ValueFormat: format for the workspace connection value + ValueFormat *WorkspaceConnectionPropsStatusValueFormat `json:"valueFormat,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &WorkspaceConnection_Status{} + +// ConvertStatusFrom populates our WorkspaceConnection_Status from the provided source +func (connection *WorkspaceConnection_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20210701s.WorkspaceConnection_Status) + if ok { + // Populate our instance from source + return connection.AssignPropertiesFromWorkspaceConnectionStatus(src) + } + + // Convert to an intermediate form + src = &v20210701s.WorkspaceConnection_Status{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = connection.AssignPropertiesFromWorkspaceConnectionStatus(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our WorkspaceConnection_Status +func (connection *WorkspaceConnection_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20210701s.WorkspaceConnection_Status) + if ok { + // Populate destination from our instance + return connection.AssignPropertiesToWorkspaceConnectionStatus(dst) + } + + // Convert to an intermediate form + dst = &v20210701s.WorkspaceConnection_Status{} + err := connection.AssignPropertiesToWorkspaceConnectionStatus(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &WorkspaceConnection_Status{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (connection *WorkspaceConnection_Status) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &WorkspaceConnection_StatusARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (connection *WorkspaceConnection_Status) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(WorkspaceConnection_StatusARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected WorkspaceConnection_StatusARM, got %T", armInput) + } + + // Set property ‘AuthType’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AuthType != nil { + authType := *typedInput.Properties.AuthType + connection.AuthType = &authType + } + } + + // Set property ‘Category’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Category != nil { + category := *typedInput.Properties.Category + connection.Category = &category + } + } + + // no assignment for property ‘Conditions’ + + // Set property ‘Id’: + if typedInput.Id != nil { + id := *typedInput.Id + connection.Id = &id + } + + // Set property ‘Name’: + if typedInput.Name != nil { + name := *typedInput.Name + connection.Name = &name + } + + // Set property ‘Target’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Target != nil { + target := *typedInput.Properties.Target + connection.Target = &target + } + } + + // Set property ‘Type’: + if typedInput.Type != nil { + typeVar := *typedInput.Type + connection.Type = &typeVar + } + + // Set property ‘Value’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Value != nil { + value := *typedInput.Properties.Value + connection.Value = &value + } + } + + // Set property ‘ValueFormat’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ValueFormat != nil { + valueFormat := *typedInput.Properties.ValueFormat + connection.ValueFormat = &valueFormat + } + } + + // No error + return nil +} + +// AssignPropertiesFromWorkspaceConnectionStatus populates our WorkspaceConnection_Status from the provided source WorkspaceConnection_Status +func (connection *WorkspaceConnection_Status) AssignPropertiesFromWorkspaceConnectionStatus(source *v20210701s.WorkspaceConnection_Status) error { + + // AuthType + connection.AuthType = genruntime.ClonePointerToString(source.AuthType) + + // Category + connection.Category = genruntime.ClonePointerToString(source.Category) + + // Conditions + connection.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // Id + connection.Id = genruntime.ClonePointerToString(source.Id) + + // Name + connection.Name = genruntime.ClonePointerToString(source.Name) + + // Target + connection.Target = genruntime.ClonePointerToString(source.Target) + + // Type + connection.Type = genruntime.ClonePointerToString(source.Type) + + // Value + connection.Value = genruntime.ClonePointerToString(source.Value) + + // ValueFormat + if source.ValueFormat != nil { + valueFormat := WorkspaceConnectionPropsStatusValueFormat(*source.ValueFormat) + connection.ValueFormat = &valueFormat + } else { + connection.ValueFormat = nil + } + + // No error + return nil +} + +// AssignPropertiesToWorkspaceConnectionStatus populates the provided destination WorkspaceConnection_Status from our WorkspaceConnection_Status +func (connection *WorkspaceConnection_Status) AssignPropertiesToWorkspaceConnectionStatus(destination *v20210701s.WorkspaceConnection_Status) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AuthType + destination.AuthType = genruntime.ClonePointerToString(connection.AuthType) + + // Category + destination.Category = genruntime.ClonePointerToString(connection.Category) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(connection.Conditions) + + // Id + destination.Id = genruntime.ClonePointerToString(connection.Id) + + // Name + destination.Name = genruntime.ClonePointerToString(connection.Name) + + // Target + destination.Target = genruntime.ClonePointerToString(connection.Target) + + // Type + destination.Type = genruntime.ClonePointerToString(connection.Type) + + // Value + destination.Value = genruntime.ClonePointerToString(connection.Value) + + // ValueFormat + if connection.ValueFormat != nil { + valueFormat := string(*connection.ValueFormat) + destination.ValueFormat = &valueFormat + } else { + destination.ValueFormat = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type WorkspacesConnections_Spec struct { + // AuthType: Authorization type of the workspace connection. + AuthType *string `json:"authType,omitempty"` + + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + + // Category: Category of the workspace connection. + Category *string `json:"category,omitempty"` + + // Location: Location to deploy resource to + Location *string `json:"location,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 machinelearningservices.azure.com/Workspace resource + Owner *genruntime.KnownResourceReference `group:"machinelearningservices.azure.com" json:"owner,omitempty" kind:"Workspace"` + + // Tags: Name-value pairs to add to the resource + Tags map[string]string `json:"tags,omitempty"` + + // Target: Target of the workspace connection. + Target *string `json:"target,omitempty"` + + // Value: Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // ValueFormat: format for the workspace connection value. + ValueFormat *WorkspaceConnectionPropsValueFormat `json:"valueFormat,omitempty"` +} + +var _ genruntime.ARMTransformer = &WorkspacesConnections_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (connections *WorkspacesConnections_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if connections == nil { + return nil, nil + } + result := &WorkspacesConnections_SpecARM{} + + // Set property ‘Location’: + if connections.Location != nil { + location := *connections.Location + result.Location = &location + } + + // Set property ‘Name’: + result.Name = resolved.Name + + // Set property ‘Properties’: + if connections.AuthType != nil || + connections.Category != nil || + connections.Target != nil || + connections.Value != nil || + connections.ValueFormat != nil { + result.Properties = &WorkspaceConnectionPropsARM{} + } + if connections.AuthType != nil { + authType := *connections.AuthType + result.Properties.AuthType = &authType + } + if connections.Category != nil { + category := *connections.Category + result.Properties.Category = &category + } + if connections.Target != nil { + target := *connections.Target + result.Properties.Target = &target + } + if connections.Value != nil { + value := *connections.Value + result.Properties.Value = &value + } + if connections.ValueFormat != nil { + valueFormat := *connections.ValueFormat + result.Properties.ValueFormat = &valueFormat + } + + // Set property ‘Tags’: + if connections.Tags != nil { + result.Tags = make(map[string]string, len(connections.Tags)) + for key, tagsValue := range connections.Tags { + result.Tags[key] = tagsValue + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (connections *WorkspacesConnections_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &WorkspacesConnections_SpecARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (connections *WorkspacesConnections_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(WorkspacesConnections_SpecARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected WorkspacesConnections_SpecARM, got %T", armInput) + } + + // Set property ‘AuthType’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AuthType != nil { + authType := *typedInput.Properties.AuthType + connections.AuthType = &authType + } + } + + // Set property ‘AzureName’: + connections.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property ‘Category’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Category != nil { + category := *typedInput.Properties.Category + connections.Category = &category + } + } + + // Set property ‘Location’: + if typedInput.Location != nil { + location := *typedInput.Location + connections.Location = &location + } + + // Set property ‘Owner’: + connections.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + } + + // Set property ‘Tags’: + if typedInput.Tags != nil { + connections.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + connections.Tags[key] = value + } + } + + // Set property ‘Target’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Target != nil { + target := *typedInput.Properties.Target + connections.Target = &target + } + } + + // Set property ‘Value’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Value != nil { + value := *typedInput.Properties.Value + connections.Value = &value + } + } + + // Set property ‘ValueFormat’: + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ValueFormat != nil { + valueFormat := *typedInput.Properties.ValueFormat + connections.ValueFormat = &valueFormat + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &WorkspacesConnections_Spec{} + +// ConvertSpecFrom populates our WorkspacesConnections_Spec from the provided source +func (connections *WorkspacesConnections_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20210701s.WorkspacesConnections_Spec) + if ok { + // Populate our instance from source + return connections.AssignPropertiesFromWorkspacesConnectionsSpec(src) + } + + // Convert to an intermediate form + src = &v20210701s.WorkspacesConnections_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = connections.AssignPropertiesFromWorkspacesConnectionsSpec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our WorkspacesConnections_Spec +func (connections *WorkspacesConnections_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20210701s.WorkspacesConnections_Spec) + if ok { + // Populate destination from our instance + return connections.AssignPropertiesToWorkspacesConnectionsSpec(dst) + } + + // Convert to an intermediate form + dst = &v20210701s.WorkspacesConnections_Spec{} + err := connections.AssignPropertiesToWorkspacesConnectionsSpec(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignPropertiesFromWorkspacesConnectionsSpec populates our WorkspacesConnections_Spec from the provided source WorkspacesConnections_Spec +func (connections *WorkspacesConnections_Spec) AssignPropertiesFromWorkspacesConnectionsSpec(source *v20210701s.WorkspacesConnections_Spec) error { + + // AuthType + connections.AuthType = genruntime.ClonePointerToString(source.AuthType) + + // AzureName + connections.AzureName = source.AzureName + + // Category + connections.Category = genruntime.ClonePointerToString(source.Category) + + // Location + connections.Location = genruntime.ClonePointerToString(source.Location) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + connections.Owner = &owner + } else { + connections.Owner = nil + } + + // Tags + connections.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // Target + connections.Target = genruntime.ClonePointerToString(source.Target) + + // Value + connections.Value = genruntime.ClonePointerToString(source.Value) + + // ValueFormat + if source.ValueFormat != nil { + valueFormat := WorkspaceConnectionPropsValueFormat(*source.ValueFormat) + connections.ValueFormat = &valueFormat + } else { + connections.ValueFormat = nil + } + + // No error + return nil +} + +// AssignPropertiesToWorkspacesConnectionsSpec populates the provided destination WorkspacesConnections_Spec from our WorkspacesConnections_Spec +func (connections *WorkspacesConnections_Spec) AssignPropertiesToWorkspacesConnectionsSpec(destination *v20210701s.WorkspacesConnections_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AuthType + destination.AuthType = genruntime.ClonePointerToString(connections.AuthType) + + // AzureName + destination.AzureName = connections.AzureName + + // Category + destination.Category = genruntime.ClonePointerToString(connections.Category) + + // Location + destination.Location = genruntime.ClonePointerToString(connections.Location) + + // OriginalVersion + destination.OriginalVersion = connections.OriginalVersion() + + // Owner + if connections.Owner != nil { + owner := connections.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(connections.Tags) + + // Target + destination.Target = genruntime.ClonePointerToString(connections.Target) + + // Value + destination.Value = genruntime.ClonePointerToString(connections.Value) + + // ValueFormat + if connections.ValueFormat != nil { + valueFormat := string(*connections.ValueFormat) + destination.ValueFormat = &valueFormat + } else { + destination.ValueFormat = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (connections *WorkspacesConnections_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (connections *WorkspacesConnections_Spec) SetAzureName(azureName string) { + connections.AzureName = azureName +} + +// +kubebuilder:validation:Enum={"JSON"} +type WorkspaceConnectionPropsValueFormat string + +const WorkspaceConnectionPropsValueFormatJSON = WorkspaceConnectionPropsValueFormat("JSON") + +func init() { + SchemeBuilder.Register(&WorkspacesConnection{}, &WorkspacesConnectionList{}) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen_test.go new file mode 100644 index 0000000000..668bafa057 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_connection_types_gen_test.go @@ -0,0 +1,382 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import ( + "encoding/json" + v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" + "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_WorkspacesConnection_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspacesConnection to hub returns original", + prop.ForAll(RunResourceConversionTestForWorkspacesConnection, WorkspacesConnectionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForWorkspacesConnection tests if a specific instance of WorkspacesConnection round trips to the hub storage version and back losslessly +func RunResourceConversionTestForWorkspacesConnection(subject WorkspacesConnection) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20210701s.WorkspacesConnection + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual WorkspacesConnection + 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_WorkspacesConnection_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspacesConnection to WorkspacesConnection via AssignPropertiesToWorkspacesConnection & AssignPropertiesFromWorkspacesConnection returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspacesConnection, WorkspacesConnectionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspacesConnection tests if a specific instance of WorkspacesConnection can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspacesConnection(subject WorkspacesConnection) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20210701s.WorkspacesConnection + err := copied.AssignPropertiesToWorkspacesConnection(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspacesConnection + err = actual.AssignPropertiesFromWorkspacesConnection(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_WorkspacesConnection_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesConnection via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesConnection, WorkspacesConnectionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesConnection runs a test to see if a specific instance of WorkspacesConnection round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesConnection(subject WorkspacesConnection) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesConnection + 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 WorkspacesConnection instances for property testing - lazily instantiated by +// WorkspacesConnectionGenerator() +var workspacesConnectionGenerator gopter.Gen + +// WorkspacesConnectionGenerator returns a generator of WorkspacesConnection instances for property testing. +func WorkspacesConnectionGenerator() gopter.Gen { + if workspacesConnectionGenerator != nil { + return workspacesConnectionGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspacesConnection(generators) + workspacesConnectionGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnection{}), generators) + + return workspacesConnectionGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspacesConnection is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesConnection(gens map[string]gopter.Gen) { + gens["Spec"] = WorkspacesConnectionsSpecGenerator() + gens["Status"] = WorkspaceConnectionStatusGenerator() +} + +func Test_WorkspaceConnection_Status_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspaceConnection_Status to WorkspaceConnection_Status via AssignPropertiesToWorkspaceConnectionStatus & AssignPropertiesFromWorkspaceConnectionStatus returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspaceConnectionStatus, WorkspaceConnectionStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspaceConnectionStatus tests if a specific instance of WorkspaceConnection_Status can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspaceConnectionStatus(subject WorkspaceConnection_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 v20210701s.WorkspaceConnection_Status + err := copied.AssignPropertiesToWorkspaceConnectionStatus(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspaceConnection_Status + err = actual.AssignPropertiesFromWorkspaceConnectionStatus(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_WorkspaceConnection_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspaceConnection_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionStatus, WorkspaceConnectionStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceConnectionStatus runs a test to see if a specific instance of WorkspaceConnection_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceConnectionStatus(subject WorkspaceConnection_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceConnection_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 WorkspaceConnection_Status instances for property testing - lazily instantiated by +// WorkspaceConnectionStatusGenerator() +var workspaceConnectionStatusGenerator gopter.Gen + +// WorkspaceConnectionStatusGenerator returns a generator of WorkspaceConnection_Status instances for property testing. +func WorkspaceConnectionStatusGenerator() gopter.Gen { + if workspaceConnectionStatusGenerator != nil { + return workspaceConnectionStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(generators) + workspaceConnectionStatusGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_Status{}), generators) + + return workspaceConnectionStatusGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(gens map[string]gopter.Gen) { + gens["AuthType"] = gen.PtrOf(gen.AlphaString()) + gens["Category"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["Value"] = gen.PtrOf(gen.AlphaString()) + gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsStatusValueFormatJSON)) +} + +func Test_WorkspacesConnections_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from WorkspacesConnections_Spec to WorkspacesConnections_Spec via AssignPropertiesToWorkspacesConnectionsSpec & AssignPropertiesFromWorkspacesConnectionsSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForWorkspacesConnectionsSpec, WorkspacesConnectionsSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForWorkspacesConnectionsSpec tests if a specific instance of WorkspacesConnections_Spec can be assigned to v1beta20210701storage and back losslessly +func RunPropertyAssignmentTestForWorkspacesConnectionsSpec(subject WorkspacesConnections_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 v20210701s.WorkspacesConnections_Spec + err := copied.AssignPropertiesToWorkspacesConnectionsSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual WorkspacesConnections_Spec + err = actual.AssignPropertiesFromWorkspacesConnectionsSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_WorkspacesConnections_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesConnections_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesConnectionsSpec, WorkspacesConnectionsSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesConnectionsSpec runs a test to see if a specific instance of WorkspacesConnections_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesConnectionsSpec(subject WorkspacesConnections_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesConnections_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 WorkspacesConnections_Spec instances for property testing - lazily instantiated by +// WorkspacesConnectionsSpecGenerator() +var workspacesConnectionsSpecGenerator gopter.Gen + +// WorkspacesConnectionsSpecGenerator returns a generator of WorkspacesConnections_Spec instances for property testing. +func WorkspacesConnectionsSpecGenerator() gopter.Gen { + if workspacesConnectionsSpecGenerator != nil { + return workspacesConnectionsSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(generators) + workspacesConnectionsSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_Spec{}), generators) + + return workspacesConnectionsSpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(gens map[string]gopter.Gen) { + gens["AuthType"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["Category"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) + gens["Value"] = gen.PtrOf(gen.AlphaString()) + gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsValueFormatJSON)) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen.go new file mode 100644 index 0000000000..11448397f1 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen.go @@ -0,0 +1,55 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type WorkspacesConnections_SpecARM struct { + // Location: Location to deploy resource to + Location *string `json:"location,omitempty"` + + // Name: Friendly name of the workspace connection + Name string `json:"name,omitempty"` + + // Properties: Workspace Connection specific properties. + Properties *WorkspaceConnectionPropsARM `json:"properties,omitempty"` + + // Tags: Name-value pairs to add to the resource + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &WorkspacesConnections_SpecARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01" +func (connections WorkspacesConnections_SpecARM) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetName returns the Name of the resource +func (connections *WorkspacesConnections_SpecARM) GetName() string { + return connections.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/connections" +func (connections *WorkspacesConnections_SpecARM) GetType() string { + return "Microsoft.MachineLearningServices/workspaces/connections" +} + +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/WorkspaceConnectionProps +type WorkspaceConnectionPropsARM struct { + // AuthType: Authorization type of the workspace connection. + AuthType *string `json:"authType,omitempty"` + + // Category: Category of the workspace connection. + Category *string `json:"category,omitempty"` + + // Target: Target of the workspace connection. + Target *string `json:"target,omitempty"` + + // Value: Value details of the workspace connection. + Value *string `json:"value,omitempty"` + + // ValueFormat: format for the workspace connection value. + ValueFormat *WorkspaceConnectionPropsValueFormat `json:"valueFormat,omitempty"` +} diff --git a/v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen_test.go new file mode 100644 index 0000000000..742a4d539c --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/workspaces_connections__spec_arm_types_gen_test.go @@ -0,0 +1,158 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701 + +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_WorkspacesConnections_SpecARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesConnections_SpecARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesConnectionsSpecARM, WorkspacesConnectionsSpecARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesConnectionsSpecARM runs a test to see if a specific instance of WorkspacesConnections_SpecARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesConnectionsSpecARM(subject WorkspacesConnections_SpecARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesConnections_SpecARM + 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 WorkspacesConnections_SpecARM instances for property testing - lazily instantiated by +// WorkspacesConnectionsSpecARMGenerator() +var workspacesConnectionsSpecARMGenerator gopter.Gen + +// WorkspacesConnectionsSpecARMGenerator returns a generator of WorkspacesConnections_SpecARM instances for property testing. +// We first initialize workspacesConnectionsSpecARMGenerator 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 WorkspacesConnectionsSpecARMGenerator() gopter.Gen { + if workspacesConnectionsSpecARMGenerator != nil { + return workspacesConnectionsSpecARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM(generators) + workspacesConnectionsSpecARMGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_SpecARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM(generators) + AddRelatedPropertyGeneratorsForWorkspacesConnectionsSpecARM(generators) + workspacesConnectionsSpecARMGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_SpecARM{}), generators) + + return workspacesConnectionsSpecARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpecARM(gens map[string]gopter.Gen) { + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.AlphaString() + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesConnectionsSpecARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesConnectionsSpecARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(WorkspaceConnectionPropsARMGenerator()) +} + +func Test_WorkspaceConnectionPropsARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspaceConnectionPropsARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionPropsARM, WorkspaceConnectionPropsARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceConnectionPropsARM runs a test to see if a specific instance of WorkspaceConnectionPropsARM round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceConnectionPropsARM(subject WorkspaceConnectionPropsARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceConnectionPropsARM + 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 WorkspaceConnectionPropsARM instances for property testing - lazily instantiated by +// WorkspaceConnectionPropsARMGenerator() +var workspaceConnectionPropsARMGenerator gopter.Gen + +// WorkspaceConnectionPropsARMGenerator returns a generator of WorkspaceConnectionPropsARM instances for property testing. +func WorkspaceConnectionPropsARMGenerator() gopter.Gen { + if workspaceConnectionPropsARMGenerator != nil { + return workspaceConnectionPropsARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsARM(generators) + workspaceConnectionPropsARMGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnectionPropsARM{}), generators) + + return workspaceConnectionPropsARMGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceConnectionPropsARM(gens map[string]gopter.Gen) { + gens["AuthType"] = gen.PtrOf(gen.AlphaString()) + gens["Category"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) + gens["Value"] = gen.PtrOf(gen.AlphaString()) + gens["ValueFormat"] = gen.PtrOf(gen.OneConstOf(WorkspaceConnectionPropsValueFormatJSON)) +} diff --git a/v2/api/machinelearningservices/v1beta20210701/zz_generated.deepcopy.go b/v2/api/machinelearningservices/v1beta20210701/zz_generated.deepcopy.go new file mode 100644 index 0000000000..6b462e88af --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701/zz_generated.deepcopy.go @@ -0,0 +1,5551 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta20210701 + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AKSProperties) DeepCopyInto(out *AKSProperties) { + *out = *in + if in.AgentCount != nil { + in, out := &in.AgentCount, &out.AgentCount + *out = new(int) + **out = **in + } + if in.AgentVmSize != nil { + in, out := &in.AgentVmSize, &out.AgentVmSize + *out = new(string) + **out = **in + } + if in.AksNetworkingConfiguration != nil { + in, out := &in.AksNetworkingConfiguration, &out.AksNetworkingConfiguration + *out = new(AksNetworkingConfiguration) + (*in).DeepCopyInto(*out) + } + if in.ClusterFqdn != nil { + in, out := &in.ClusterFqdn, &out.ClusterFqdn + *out = new(string) + **out = **in + } + if in.ClusterPurpose != nil { + in, out := &in.ClusterPurpose, &out.ClusterPurpose + *out = new(AKSPropertiesClusterPurpose) + **out = **in + } + if in.LoadBalancerSubnet != nil { + in, out := &in.LoadBalancerSubnet, &out.LoadBalancerSubnet + *out = new(string) + **out = **in + } + if in.LoadBalancerType != nil { + in, out := &in.LoadBalancerType, &out.LoadBalancerType + *out = new(AKSPropertiesLoadBalancerType) + **out = **in + } + if in.SslConfiguration != nil { + in, out := &in.SslConfiguration, &out.SslConfiguration + *out = new(SslConfiguration) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AKSProperties. +func (in *AKSProperties) DeepCopy() *AKSProperties { + if in == nil { + return nil + } + out := new(AKSProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AKSPropertiesARM) DeepCopyInto(out *AKSPropertiesARM) { + *out = *in + if in.AgentCount != nil { + in, out := &in.AgentCount, &out.AgentCount + *out = new(int) + **out = **in + } + if in.AgentVmSize != nil { + in, out := &in.AgentVmSize, &out.AgentVmSize + *out = new(string) + **out = **in + } + if in.AksNetworkingConfiguration != nil { + in, out := &in.AksNetworkingConfiguration, &out.AksNetworkingConfiguration + *out = new(AksNetworkingConfigurationARM) + (*in).DeepCopyInto(*out) + } + if in.ClusterFqdn != nil { + in, out := &in.ClusterFqdn, &out.ClusterFqdn + *out = new(string) + **out = **in + } + if in.ClusterPurpose != nil { + in, out := &in.ClusterPurpose, &out.ClusterPurpose + *out = new(AKSPropertiesClusterPurpose) + **out = **in + } + if in.LoadBalancerSubnet != nil { + in, out := &in.LoadBalancerSubnet, &out.LoadBalancerSubnet + *out = new(string) + **out = **in + } + if in.LoadBalancerType != nil { + in, out := &in.LoadBalancerType, &out.LoadBalancerType + *out = new(AKSPropertiesLoadBalancerType) + **out = **in + } + if in.SslConfiguration != nil { + in, out := &in.SslConfiguration, &out.SslConfiguration + *out = new(SslConfigurationARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AKSPropertiesARM. +func (in *AKSPropertiesARM) DeepCopy() *AKSPropertiesARM { + if in == nil { + return nil + } + out := new(AKSPropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AksNetworkingConfiguration) DeepCopyInto(out *AksNetworkingConfiguration) { + *out = *in + if in.DnsServiceIP != nil { + in, out := &in.DnsServiceIP, &out.DnsServiceIP + *out = new(string) + **out = **in + } + if in.DockerBridgeCidr != nil { + in, out := &in.DockerBridgeCidr, &out.DockerBridgeCidr + *out = new(string) + **out = **in + } + if in.ServiceCidr != nil { + in, out := &in.ServiceCidr, &out.ServiceCidr + *out = new(string) + **out = **in + } + if in.SubnetReference != nil { + in, out := &in.SubnetReference, &out.SubnetReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AksNetworkingConfiguration. +func (in *AksNetworkingConfiguration) DeepCopy() *AksNetworkingConfiguration { + if in == nil { + return nil + } + out := new(AksNetworkingConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AksNetworkingConfigurationARM) DeepCopyInto(out *AksNetworkingConfigurationARM) { + *out = *in + if in.DnsServiceIP != nil { + in, out := &in.DnsServiceIP, &out.DnsServiceIP + *out = new(string) + **out = **in + } + if in.DockerBridgeCidr != nil { + in, out := &in.DockerBridgeCidr, &out.DockerBridgeCidr + *out = new(string) + **out = **in + } + if in.ServiceCidr != nil { + in, out := &in.ServiceCidr, &out.ServiceCidr + *out = new(string) + **out = **in + } + if in.SubnetId != nil { + in, out := &in.SubnetId, &out.SubnetId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AksNetworkingConfigurationARM. +func (in *AksNetworkingConfigurationARM) DeepCopy() *AksNetworkingConfigurationARM { + if in == nil { + return nil + } + out := new(AksNetworkingConfigurationARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AmlComputeProperties) DeepCopyInto(out *AmlComputeProperties) { + *out = *in + if in.EnableNodePublicIp != nil { + in, out := &in.EnableNodePublicIp, &out.EnableNodePublicIp + *out = new(bool) + **out = **in + } + if in.IsolatedNetwork != nil { + in, out := &in.IsolatedNetwork, &out.IsolatedNetwork + *out = new(bool) + **out = **in + } + if in.OsType != nil { + in, out := &in.OsType, &out.OsType + *out = new(AmlComputePropertiesOsType) + **out = **in + } + if in.RemoteLoginPortPublicAccess != nil { + in, out := &in.RemoteLoginPortPublicAccess, &out.RemoteLoginPortPublicAccess + *out = new(AmlComputePropertiesRemoteLoginPortPublicAccess) + **out = **in + } + if in.ScaleSettings != nil { + in, out := &in.ScaleSettings, &out.ScaleSettings + *out = new(ScaleSettings) + (*in).DeepCopyInto(*out) + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(ResourceId) + (*in).DeepCopyInto(*out) + } + if in.UserAccountCredentials != nil { + in, out := &in.UserAccountCredentials, &out.UserAccountCredentials + *out = new(UserAccountCredentials) + (*in).DeepCopyInto(*out) + } + if in.VirtualMachineImage != nil { + in, out := &in.VirtualMachineImage, &out.VirtualMachineImage + *out = new(VirtualMachineImage) + (*in).DeepCopyInto(*out) + } + if in.VmPriority != nil { + in, out := &in.VmPriority, &out.VmPriority + *out = new(AmlComputePropertiesVmPriority) + **out = **in + } + if in.VmSize != nil { + in, out := &in.VmSize, &out.VmSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmlComputeProperties. +func (in *AmlComputeProperties) DeepCopy() *AmlComputeProperties { + if in == nil { + return nil + } + out := new(AmlComputeProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AmlComputePropertiesARM) DeepCopyInto(out *AmlComputePropertiesARM) { + *out = *in + if in.EnableNodePublicIp != nil { + in, out := &in.EnableNodePublicIp, &out.EnableNodePublicIp + *out = new(bool) + **out = **in + } + if in.IsolatedNetwork != nil { + in, out := &in.IsolatedNetwork, &out.IsolatedNetwork + *out = new(bool) + **out = **in + } + if in.OsType != nil { + in, out := &in.OsType, &out.OsType + *out = new(AmlComputePropertiesOsType) + **out = **in + } + if in.RemoteLoginPortPublicAccess != nil { + in, out := &in.RemoteLoginPortPublicAccess, &out.RemoteLoginPortPublicAccess + *out = new(AmlComputePropertiesRemoteLoginPortPublicAccess) + **out = **in + } + if in.ScaleSettings != nil { + in, out := &in.ScaleSettings, &out.ScaleSettings + *out = new(ScaleSettingsARM) + (*in).DeepCopyInto(*out) + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(ResourceIdARM) + (*in).DeepCopyInto(*out) + } + if in.UserAccountCredentials != nil { + in, out := &in.UserAccountCredentials, &out.UserAccountCredentials + *out = new(UserAccountCredentialsARM) + (*in).DeepCopyInto(*out) + } + if in.VirtualMachineImage != nil { + in, out := &in.VirtualMachineImage, &out.VirtualMachineImage + *out = new(VirtualMachineImageARM) + (*in).DeepCopyInto(*out) + } + if in.VmPriority != nil { + in, out := &in.VmPriority, &out.VmPriority + *out = new(AmlComputePropertiesVmPriority) + **out = **in + } + if in.VmSize != nil { + in, out := &in.VmSize, &out.VmSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmlComputePropertiesARM. +func (in *AmlComputePropertiesARM) DeepCopy() *AmlComputePropertiesARM { + if in == nil { + return nil + } + out := new(AmlComputePropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AssignedUser) DeepCopyInto(out *AssignedUser) { + *out = *in + if in.ObjectId != nil { + in, out := &in.ObjectId, &out.ObjectId + *out = new(string) + **out = **in + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssignedUser. +func (in *AssignedUser) DeepCopy() *AssignedUser { + if in == nil { + return nil + } + out := new(AssignedUser) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AssignedUserARM) DeepCopyInto(out *AssignedUserARM) { + *out = *in + if in.ObjectId != nil { + in, out := &in.ObjectId, &out.ObjectId + *out = new(string) + **out = **in + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssignedUserARM. +func (in *AssignedUserARM) DeepCopy() *AssignedUserARM { + if in == nil { + return nil + } + out := new(AssignedUserARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoPauseProperties) DeepCopyInto(out *AutoPauseProperties) { + *out = *in + if in.DelayInMinutes != nil { + in, out := &in.DelayInMinutes, &out.DelayInMinutes + *out = new(int) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoPauseProperties. +func (in *AutoPauseProperties) DeepCopy() *AutoPauseProperties { + if in == nil { + return nil + } + out := new(AutoPauseProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoPausePropertiesARM) DeepCopyInto(out *AutoPausePropertiesARM) { + *out = *in + if in.DelayInMinutes != nil { + in, out := &in.DelayInMinutes, &out.DelayInMinutes + *out = new(int) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoPausePropertiesARM. +func (in *AutoPausePropertiesARM) DeepCopy() *AutoPausePropertiesARM { + if in == nil { + return nil + } + out := new(AutoPausePropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScaleProperties) DeepCopyInto(out *AutoScaleProperties) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.MaxNodeCount != nil { + in, out := &in.MaxNodeCount, &out.MaxNodeCount + *out = new(int) + **out = **in + } + if in.MinNodeCount != nil { + in, out := &in.MinNodeCount, &out.MinNodeCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScaleProperties. +func (in *AutoScaleProperties) DeepCopy() *AutoScaleProperties { + if in == nil { + return nil + } + out := new(AutoScaleProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScalePropertiesARM) DeepCopyInto(out *AutoScalePropertiesARM) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.MaxNodeCount != nil { + in, out := &in.MaxNodeCount, &out.MaxNodeCount + *out = new(int) + **out = **in + } + if in.MinNodeCount != nil { + in, out := &in.MinNodeCount, &out.MinNodeCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalePropertiesARM. +func (in *AutoScalePropertiesARM) DeepCopy() *AutoScalePropertiesARM { + if in == nil { + return nil + } + out := new(AutoScalePropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute) DeepCopyInto(out *Compute) { + *out = *in + if in.AKS != nil { + in, out := &in.AKS, &out.AKS + *out = new(Compute_AKS) + (*in).DeepCopyInto(*out) + } + if in.AmlCompute != nil { + in, out := &in.AmlCompute, &out.AmlCompute + *out = new(Compute_AmlCompute) + (*in).DeepCopyInto(*out) + } + if in.ComputeInstance != nil { + in, out := &in.ComputeInstance, &out.ComputeInstance + *out = new(Compute_ComputeInstance) + (*in).DeepCopyInto(*out) + } + if in.DataFactory != nil { + in, out := &in.DataFactory, &out.DataFactory + *out = new(Compute_DataFactory) + (*in).DeepCopyInto(*out) + } + if in.DataLakeAnalytics != nil { + in, out := &in.DataLakeAnalytics, &out.DataLakeAnalytics + *out = new(Compute_DataLakeAnalytics) + (*in).DeepCopyInto(*out) + } + if in.Databricks != nil { + in, out := &in.Databricks, &out.Databricks + *out = new(Compute_Databricks) + (*in).DeepCopyInto(*out) + } + if in.HDInsight != nil { + in, out := &in.HDInsight, &out.HDInsight + *out = new(Compute_HDInsight) + (*in).DeepCopyInto(*out) + } + if in.SynapseSpark != nil { + in, out := &in.SynapseSpark, &out.SynapseSpark + *out = new(Compute_SynapseSpark) + (*in).DeepCopyInto(*out) + } + if in.VirtualMachine != nil { + in, out := &in.VirtualMachine, &out.VirtualMachine + *out = new(Compute_VirtualMachine) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute. +func (in *Compute) DeepCopy() *Compute { + if in == nil { + return nil + } + out := new(Compute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeARM) DeepCopyInto(out *ComputeARM) { + *out = *in + if in.AKS != nil { + in, out := &in.AKS, &out.AKS + *out = new(Compute_AKSARM) + (*in).DeepCopyInto(*out) + } + if in.AmlCompute != nil { + in, out := &in.AmlCompute, &out.AmlCompute + *out = new(Compute_AmlComputeARM) + (*in).DeepCopyInto(*out) + } + if in.ComputeInstance != nil { + in, out := &in.ComputeInstance, &out.ComputeInstance + *out = new(Compute_ComputeInstanceARM) + (*in).DeepCopyInto(*out) + } + if in.DataFactory != nil { + in, out := &in.DataFactory, &out.DataFactory + *out = new(Compute_DataFactoryARM) + (*in).DeepCopyInto(*out) + } + if in.DataLakeAnalytics != nil { + in, out := &in.DataLakeAnalytics, &out.DataLakeAnalytics + *out = new(Compute_DataLakeAnalyticsARM) + (*in).DeepCopyInto(*out) + } + if in.Databricks != nil { + in, out := &in.Databricks, &out.Databricks + *out = new(Compute_DatabricksARM) + (*in).DeepCopyInto(*out) + } + if in.HDInsight != nil { + in, out := &in.HDInsight, &out.HDInsight + *out = new(Compute_HDInsightARM) + (*in).DeepCopyInto(*out) + } + if in.SynapseSpark != nil { + in, out := &in.SynapseSpark, &out.SynapseSpark + *out = new(Compute_SynapseSparkARM) + (*in).DeepCopyInto(*out) + } + if in.VirtualMachine != nil { + in, out := &in.VirtualMachine, &out.VirtualMachine + *out = new(Compute_VirtualMachineARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeARM. +func (in *ComputeARM) DeepCopy() *ComputeARM { + if in == nil { + return nil + } + out := new(ComputeARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeInstanceProperties) DeepCopyInto(out *ComputeInstanceProperties) { + *out = *in + if in.ApplicationSharingPolicy != nil { + in, out := &in.ApplicationSharingPolicy, &out.ApplicationSharingPolicy + *out = new(ComputeInstancePropertiesApplicationSharingPolicy) + **out = **in + } + if in.ComputeInstanceAuthorizationType != nil { + in, out := &in.ComputeInstanceAuthorizationType, &out.ComputeInstanceAuthorizationType + *out = new(ComputeInstancePropertiesComputeInstanceAuthorizationType) + **out = **in + } + if in.PersonalComputeInstanceSettings != nil { + in, out := &in.PersonalComputeInstanceSettings, &out.PersonalComputeInstanceSettings + *out = new(PersonalComputeInstanceSettings) + (*in).DeepCopyInto(*out) + } + if in.SetupScripts != nil { + in, out := &in.SetupScripts, &out.SetupScripts + *out = new(SetupScripts) + (*in).DeepCopyInto(*out) + } + if in.SshSettings != nil { + in, out := &in.SshSettings, &out.SshSettings + *out = new(ComputeInstanceSshSettings) + (*in).DeepCopyInto(*out) + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(ResourceId) + (*in).DeepCopyInto(*out) + } + if in.VmSize != nil { + in, out := &in.VmSize, &out.VmSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeInstanceProperties. +func (in *ComputeInstanceProperties) DeepCopy() *ComputeInstanceProperties { + if in == nil { + return nil + } + out := new(ComputeInstanceProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeInstancePropertiesARM) DeepCopyInto(out *ComputeInstancePropertiesARM) { + *out = *in + if in.ApplicationSharingPolicy != nil { + in, out := &in.ApplicationSharingPolicy, &out.ApplicationSharingPolicy + *out = new(ComputeInstancePropertiesApplicationSharingPolicy) + **out = **in + } + if in.ComputeInstanceAuthorizationType != nil { + in, out := &in.ComputeInstanceAuthorizationType, &out.ComputeInstanceAuthorizationType + *out = new(ComputeInstancePropertiesComputeInstanceAuthorizationType) + **out = **in + } + if in.PersonalComputeInstanceSettings != nil { + in, out := &in.PersonalComputeInstanceSettings, &out.PersonalComputeInstanceSettings + *out = new(PersonalComputeInstanceSettingsARM) + (*in).DeepCopyInto(*out) + } + if in.SetupScripts != nil { + in, out := &in.SetupScripts, &out.SetupScripts + *out = new(SetupScriptsARM) + (*in).DeepCopyInto(*out) + } + if in.SshSettings != nil { + in, out := &in.SshSettings, &out.SshSettings + *out = new(ComputeInstanceSshSettingsARM) + (*in).DeepCopyInto(*out) + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(ResourceIdARM) + (*in).DeepCopyInto(*out) + } + if in.VmSize != nil { + in, out := &in.VmSize, &out.VmSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeInstancePropertiesARM. +func (in *ComputeInstancePropertiesARM) DeepCopy() *ComputeInstancePropertiesARM { + if in == nil { + return nil + } + out := new(ComputeInstancePropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeInstanceSshSettings) DeepCopyInto(out *ComputeInstanceSshSettings) { + *out = *in + if in.AdminPublicKey != nil { + in, out := &in.AdminPublicKey, &out.AdminPublicKey + *out = new(string) + **out = **in + } + if in.SshPublicAccess != nil { + in, out := &in.SshPublicAccess, &out.SshPublicAccess + *out = new(ComputeInstanceSshSettingsSshPublicAccess) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeInstanceSshSettings. +func (in *ComputeInstanceSshSettings) DeepCopy() *ComputeInstanceSshSettings { + if in == nil { + return nil + } + out := new(ComputeInstanceSshSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeInstanceSshSettingsARM) DeepCopyInto(out *ComputeInstanceSshSettingsARM) { + *out = *in + if in.AdminPublicKey != nil { + in, out := &in.AdminPublicKey, &out.AdminPublicKey + *out = new(string) + **out = **in + } + if in.SshPublicAccess != nil { + in, out := &in.SshPublicAccess, &out.SshPublicAccess + *out = new(ComputeInstanceSshSettingsSshPublicAccess) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeInstanceSshSettingsARM. +func (in *ComputeInstanceSshSettingsARM) DeepCopy() *ComputeInstanceSshSettingsARM { + if in == nil { + return nil + } + out := new(ComputeInstanceSshSettingsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeResource_Status) DeepCopyInto(out *ComputeResource_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.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.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Compute_Status) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeResource_Status. +func (in *ComputeResource_Status) DeepCopy() *ComputeResource_Status { + if in == nil { + return nil + } + out := new(ComputeResource_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 *ComputeResource_StatusARM) DeepCopyInto(out *ComputeResource_StatusARM) { + *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_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Compute_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_StatusARM) + (*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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeResource_StatusARM. +func (in *ComputeResource_StatusARM) DeepCopy() *ComputeResource_StatusARM { + if in == nil { + return nil + } + out := new(ComputeResource_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_AKS) DeepCopyInto(out *Compute_AKS) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeAKSComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(AKSProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_AKS. +func (in *Compute_AKS) DeepCopy() *Compute_AKS { + if in == nil { + return nil + } + out := new(Compute_AKS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_AKSARM) DeepCopyInto(out *Compute_AKSARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(AKSPropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_AKSARM. +func (in *Compute_AKSARM) DeepCopy() *Compute_AKSARM { + if in == nil { + return nil + } + out := new(Compute_AKSARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_AmlCompute) DeepCopyInto(out *Compute_AmlCompute) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeAmlComputeComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(AmlComputeProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_AmlCompute. +func (in *Compute_AmlCompute) DeepCopy() *Compute_AmlCompute { + if in == nil { + return nil + } + out := new(Compute_AmlCompute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_AmlComputeARM) DeepCopyInto(out *Compute_AmlComputeARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(AmlComputePropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_AmlComputeARM. +func (in *Compute_AmlComputeARM) DeepCopy() *Compute_AmlComputeARM { + if in == nil { + return nil + } + out := new(Compute_AmlComputeARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_ComputeInstance) DeepCopyInto(out *Compute_ComputeInstance) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeComputeInstanceComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(ComputeInstanceProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_ComputeInstance. +func (in *Compute_ComputeInstance) DeepCopy() *Compute_ComputeInstance { + if in == nil { + return nil + } + out := new(Compute_ComputeInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_ComputeInstanceARM) DeepCopyInto(out *Compute_ComputeInstanceARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(ComputeInstancePropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_ComputeInstanceARM. +func (in *Compute_ComputeInstanceARM) DeepCopy() *Compute_ComputeInstanceARM { + if in == nil { + return nil + } + out := new(Compute_ComputeInstanceARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_DataFactory) DeepCopyInto(out *Compute_DataFactory) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeDataFactoryComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_DataFactory. +func (in *Compute_DataFactory) DeepCopy() *Compute_DataFactory { + if in == nil { + return nil + } + out := new(Compute_DataFactory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_DataFactoryARM) DeepCopyInto(out *Compute_DataFactoryARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_DataFactoryARM. +func (in *Compute_DataFactoryARM) DeepCopy() *Compute_DataFactoryARM { + if in == nil { + return nil + } + out := new(Compute_DataFactoryARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_DataLakeAnalytics) DeepCopyInto(out *Compute_DataLakeAnalytics) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeDataLakeAnalyticsComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(DataLakeAnalyticsProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_DataLakeAnalytics. +func (in *Compute_DataLakeAnalytics) DeepCopy() *Compute_DataLakeAnalytics { + if in == nil { + return nil + } + out := new(Compute_DataLakeAnalytics) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_DataLakeAnalyticsARM) DeepCopyInto(out *Compute_DataLakeAnalyticsARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(DataLakeAnalyticsPropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_DataLakeAnalyticsARM. +func (in *Compute_DataLakeAnalyticsARM) DeepCopy() *Compute_DataLakeAnalyticsARM { + if in == nil { + return nil + } + out := new(Compute_DataLakeAnalyticsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_Databricks) DeepCopyInto(out *Compute_Databricks) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeDatabricksComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(DatabricksProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_Databricks. +func (in *Compute_Databricks) DeepCopy() *Compute_Databricks { + if in == nil { + return nil + } + out := new(Compute_Databricks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_DatabricksARM) DeepCopyInto(out *Compute_DatabricksARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(DatabricksPropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_DatabricksARM. +func (in *Compute_DatabricksARM) DeepCopy() *Compute_DatabricksARM { + if in == nil { + return nil + } + out := new(Compute_DatabricksARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_HDInsight) DeepCopyInto(out *Compute_HDInsight) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeHDInsightComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(HDInsightProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_HDInsight. +func (in *Compute_HDInsight) DeepCopy() *Compute_HDInsight { + if in == nil { + return nil + } + out := new(Compute_HDInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_HDInsightARM) DeepCopyInto(out *Compute_HDInsightARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(HDInsightPropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_HDInsightARM. +func (in *Compute_HDInsightARM) DeepCopy() *Compute_HDInsightARM { + if in == nil { + return nil + } + out := new(Compute_HDInsightARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_Status) DeepCopyInto(out *Compute_Status) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeType_Status) + **out = **in + } + if in.CreatedOn != nil { + in, out := &in.CreatedOn, &out.CreatedOn + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.IsAttachedCompute != nil { + in, out := &in.IsAttachedCompute, &out.IsAttachedCompute + *out = new(bool) + **out = **in + } + if in.ModifiedOn != nil { + in, out := &in.ModifiedOn, &out.ModifiedOn + *out = new(string) + **out = **in + } + if in.ProvisioningErrors != nil { + in, out := &in.ProvisioningErrors, &out.ProvisioningErrors + *out = make([]ErrorResponse_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(ComputeStatusProvisioningState) + **out = **in + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_Status. +func (in *Compute_Status) DeepCopy() *Compute_Status { + if in == nil { + return nil + } + out := new(Compute_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 *Compute_StatusARM) DeepCopyInto(out *Compute_StatusARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeType_Status) + **out = **in + } + if in.CreatedOn != nil { + in, out := &in.CreatedOn, &out.CreatedOn + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.IsAttachedCompute != nil { + in, out := &in.IsAttachedCompute, &out.IsAttachedCompute + *out = new(bool) + **out = **in + } + if in.ModifiedOn != nil { + in, out := &in.ModifiedOn, &out.ModifiedOn + *out = new(string) + **out = **in + } + if in.ProvisioningErrors != nil { + in, out := &in.ProvisioningErrors, &out.ProvisioningErrors + *out = make([]ErrorResponse_StatusARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(ComputeStatusProvisioningState) + **out = **in + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_StatusARM. +func (in *Compute_StatusARM) DeepCopy() *Compute_StatusARM { + if in == nil { + return nil + } + out := new(Compute_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_SynapseSpark) DeepCopyInto(out *Compute_SynapseSpark) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeSynapseSparkComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SynapseSparkProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_SynapseSpark. +func (in *Compute_SynapseSpark) DeepCopy() *Compute_SynapseSpark { + if in == nil { + return nil + } + out := new(Compute_SynapseSpark) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_SynapseSparkARM) DeepCopyInto(out *Compute_SynapseSparkARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SynapseSparkPropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_SynapseSparkARM. +func (in *Compute_SynapseSparkARM) DeepCopy() *Compute_SynapseSparkARM { + if in == nil { + return nil + } + out := new(Compute_SynapseSparkARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_VirtualMachine) DeepCopyInto(out *Compute_VirtualMachine) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(ComputeVirtualMachineComputeType) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(VirtualMachineProperties) + (*in).DeepCopyInto(*out) + } + if in.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_VirtualMachine. +func (in *Compute_VirtualMachine) DeepCopy() *Compute_VirtualMachine { + if in == nil { + return nil + } + out := new(Compute_VirtualMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_VirtualMachineARM) DeepCopyInto(out *Compute_VirtualMachineARM) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(VirtualMachinePropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_VirtualMachineARM. +func (in *Compute_VirtualMachineARM) DeepCopy() *Compute_VirtualMachineARM { + if in == nil { + return nil + } + out := new(Compute_VirtualMachineARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CosmosDbSettings) DeepCopyInto(out *CosmosDbSettings) { + *out = *in + if in.CollectionsThroughput != nil { + in, out := &in.CollectionsThroughput, &out.CollectionsThroughput + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosmosDbSettings. +func (in *CosmosDbSettings) DeepCopy() *CosmosDbSettings { + if in == nil { + return nil + } + out := new(CosmosDbSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CosmosDbSettingsARM) DeepCopyInto(out *CosmosDbSettingsARM) { + *out = *in + if in.CollectionsThroughput != nil { + in, out := &in.CollectionsThroughput, &out.CollectionsThroughput + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosmosDbSettingsARM. +func (in *CosmosDbSettingsARM) DeepCopy() *CosmosDbSettingsARM { + if in == nil { + return nil + } + out := new(CosmosDbSettingsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CosmosDbSettings_Status) DeepCopyInto(out *CosmosDbSettings_Status) { + *out = *in + if in.CollectionsThroughput != nil { + in, out := &in.CollectionsThroughput, &out.CollectionsThroughput + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosmosDbSettings_Status. +func (in *CosmosDbSettings_Status) DeepCopy() *CosmosDbSettings_Status { + if in == nil { + return nil + } + out := new(CosmosDbSettings_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 *CosmosDbSettings_StatusARM) DeepCopyInto(out *CosmosDbSettings_StatusARM) { + *out = *in + if in.CollectionsThroughput != nil { + in, out := &in.CollectionsThroughput, &out.CollectionsThroughput + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosmosDbSettings_StatusARM. +func (in *CosmosDbSettings_StatusARM) DeepCopy() *CosmosDbSettings_StatusARM { + if in == nil { + return nil + } + out := new(CosmosDbSettings_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataLakeAnalyticsProperties) DeepCopyInto(out *DataLakeAnalyticsProperties) { + *out = *in + if in.DataLakeStoreAccountName != nil { + in, out := &in.DataLakeStoreAccountName, &out.DataLakeStoreAccountName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataLakeAnalyticsProperties. +func (in *DataLakeAnalyticsProperties) DeepCopy() *DataLakeAnalyticsProperties { + if in == nil { + return nil + } + out := new(DataLakeAnalyticsProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataLakeAnalyticsPropertiesARM) DeepCopyInto(out *DataLakeAnalyticsPropertiesARM) { + *out = *in + if in.DataLakeStoreAccountName != nil { + in, out := &in.DataLakeStoreAccountName, &out.DataLakeStoreAccountName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataLakeAnalyticsPropertiesARM. +func (in *DataLakeAnalyticsPropertiesARM) DeepCopy() *DataLakeAnalyticsPropertiesARM { + if in == nil { + return nil + } + out := new(DataLakeAnalyticsPropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabricksProperties) DeepCopyInto(out *DatabricksProperties) { + *out = *in + if in.DatabricksAccessToken != nil { + in, out := &in.DatabricksAccessToken, &out.DatabricksAccessToken + *out = new(string) + **out = **in + } + if in.WorkspaceUrl != nil { + in, out := &in.WorkspaceUrl, &out.WorkspaceUrl + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabricksProperties. +func (in *DatabricksProperties) DeepCopy() *DatabricksProperties { + if in == nil { + return nil + } + out := new(DatabricksProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabricksPropertiesARM) DeepCopyInto(out *DatabricksPropertiesARM) { + *out = *in + if in.DatabricksAccessToken != nil { + in, out := &in.DatabricksAccessToken, &out.DatabricksAccessToken + *out = new(string) + **out = **in + } + if in.WorkspaceUrl != nil { + in, out := &in.WorkspaceUrl, &out.WorkspaceUrl + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabricksPropertiesARM. +func (in *DatabricksPropertiesARM) DeepCopy() *DatabricksPropertiesARM { + if in == nil { + return nil + } + out := new(DatabricksPropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionProperty) DeepCopyInto(out *EncryptionProperty) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityForCmk) + (*in).DeepCopyInto(*out) + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = new(KeyVaultProperties) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EncryptionPropertyStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionProperty. +func (in *EncryptionProperty) DeepCopy() *EncryptionProperty { + if in == nil { + return nil + } + out := new(EncryptionProperty) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionPropertyARM) DeepCopyInto(out *EncryptionPropertyARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityForCmkARM) + (*in).DeepCopyInto(*out) + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = new(KeyVaultPropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EncryptionPropertyStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionPropertyARM. +func (in *EncryptionPropertyARM) DeepCopy() *EncryptionPropertyARM { + if in == nil { + return nil + } + out := new(EncryptionPropertyARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionProperty_Status) DeepCopyInto(out *EncryptionProperty_Status) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityForCmk_Status) + (*in).DeepCopyInto(*out) + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = new(KeyVaultProperties_Status) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EncryptionPropertyStatusStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionProperty_Status. +func (in *EncryptionProperty_Status) DeepCopy() *EncryptionProperty_Status { + if in == nil { + return nil + } + out := new(EncryptionProperty_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 *EncryptionProperty_StatusARM) DeepCopyInto(out *EncryptionProperty_StatusARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityForCmk_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = new(KeyVaultProperties_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EncryptionPropertyStatusStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionProperty_StatusARM. +func (in *EncryptionProperty_StatusARM) DeepCopy() *EncryptionProperty_StatusARM { + if in == nil { + return nil + } + out := new(EncryptionProperty_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorAdditionalInfo_Status) DeepCopyInto(out *ErrorAdditionalInfo_Status) { + *out = *in + if in.Info != nil { + in, out := &in.Info, &out.Info + *out = make(map[string]v1.JSON, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorAdditionalInfo_Status. +func (in *ErrorAdditionalInfo_Status) DeepCopy() *ErrorAdditionalInfo_Status { + if in == nil { + return nil + } + out := new(ErrorAdditionalInfo_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 *ErrorAdditionalInfo_StatusARM) DeepCopyInto(out *ErrorAdditionalInfo_StatusARM) { + *out = *in + if in.Info != nil { + in, out := &in.Info, &out.Info + *out = make(map[string]v1.JSON, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorAdditionalInfo_StatusARM. +func (in *ErrorAdditionalInfo_StatusARM) DeepCopy() *ErrorAdditionalInfo_StatusARM { + if in == nil { + return nil + } + out := new(ErrorAdditionalInfo_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorDetail_Status) DeepCopyInto(out *ErrorDetail_Status) { + *out = *in + if in.AdditionalInfo != nil { + in, out := &in.AdditionalInfo, &out.AdditionalInfo + *out = make([]ErrorAdditionalInfo_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Details != nil { + in, out := &in.Details, &out.Details + *out = make([]ErrorDetail_Status_Unrolled, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorDetail_Status. +func (in *ErrorDetail_Status) DeepCopy() *ErrorDetail_Status { + if in == nil { + return nil + } + out := new(ErrorDetail_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 *ErrorDetail_StatusARM) DeepCopyInto(out *ErrorDetail_StatusARM) { + *out = *in + if in.AdditionalInfo != nil { + in, out := &in.AdditionalInfo, &out.AdditionalInfo + *out = make([]ErrorAdditionalInfo_StatusARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Details != nil { + in, out := &in.Details, &out.Details + *out = make([]ErrorDetail_Status_UnrolledARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorDetail_StatusARM. +func (in *ErrorDetail_StatusARM) DeepCopy() *ErrorDetail_StatusARM { + if in == nil { + return nil + } + out := new(ErrorDetail_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorDetail_Status_Unrolled) DeepCopyInto(out *ErrorDetail_Status_Unrolled) { + *out = *in + if in.AdditionalInfo != nil { + in, out := &in.AdditionalInfo, &out.AdditionalInfo + *out = make([]ErrorAdditionalInfo_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorDetail_Status_Unrolled. +func (in *ErrorDetail_Status_Unrolled) DeepCopy() *ErrorDetail_Status_Unrolled { + if in == nil { + return nil + } + out := new(ErrorDetail_Status_Unrolled) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorDetail_Status_UnrolledARM) DeepCopyInto(out *ErrorDetail_Status_UnrolledARM) { + *out = *in + if in.AdditionalInfo != nil { + in, out := &in.AdditionalInfo, &out.AdditionalInfo + *out = make([]ErrorAdditionalInfo_StatusARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorDetail_Status_UnrolledARM. +func (in *ErrorDetail_Status_UnrolledARM) DeepCopy() *ErrorDetail_Status_UnrolledARM { + if in == nil { + return nil + } + out := new(ErrorDetail_Status_UnrolledARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorResponse_Status) DeepCopyInto(out *ErrorResponse_Status) { + *out = *in + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(ErrorDetail_Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorResponse_Status. +func (in *ErrorResponse_Status) DeepCopy() *ErrorResponse_Status { + if in == nil { + return nil + } + out := new(ErrorResponse_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 *ErrorResponse_StatusARM) DeepCopyInto(out *ErrorResponse_StatusARM) { + *out = *in + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(ErrorDetail_StatusARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorResponse_StatusARM. +func (in *ErrorResponse_StatusARM) DeepCopy() *ErrorResponse_StatusARM { + if in == nil { + return nil + } + out := new(ErrorResponse_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HDInsightProperties) DeepCopyInto(out *HDInsightProperties) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.AdministratorAccount != nil { + in, out := &in.AdministratorAccount, &out.AdministratorAccount + *out = new(VirtualMachineSshCredentials) + (*in).DeepCopyInto(*out) + } + if in.SshPort != nil { + in, out := &in.SshPort, &out.SshPort + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDInsightProperties. +func (in *HDInsightProperties) DeepCopy() *HDInsightProperties { + if in == nil { + return nil + } + out := new(HDInsightProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HDInsightPropertiesARM) DeepCopyInto(out *HDInsightPropertiesARM) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.AdministratorAccount != nil { + in, out := &in.AdministratorAccount, &out.AdministratorAccount + *out = new(VirtualMachineSshCredentialsARM) + (*in).DeepCopyInto(*out) + } + if in.SshPort != nil { + in, out := &in.SshPort, &out.SshPort + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDInsightPropertiesARM. +func (in *HDInsightPropertiesARM) DeepCopy() *HDInsightPropertiesARM { + if in == nil { + return nil + } + out := new(HDInsightPropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity) DeepCopyInto(out *Identity) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(IdentityType) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]v1.JSON, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// 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 *IdentityARM) DeepCopyInto(out *IdentityARM) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(IdentityType) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]v1.JSON, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityARM. +func (in *IdentityARM) DeepCopy() *IdentityARM { + if in == nil { + return nil + } + out := new(IdentityARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityForCmk) DeepCopyInto(out *IdentityForCmk) { + *out = *in + if in.UserAssignedIdentity != nil { + in, out := &in.UserAssignedIdentity, &out.UserAssignedIdentity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityForCmk. +func (in *IdentityForCmk) DeepCopy() *IdentityForCmk { + if in == nil { + return nil + } + out := new(IdentityForCmk) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityForCmkARM) DeepCopyInto(out *IdentityForCmkARM) { + *out = *in + if in.UserAssignedIdentity != nil { + in, out := &in.UserAssignedIdentity, &out.UserAssignedIdentity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityForCmkARM. +func (in *IdentityForCmkARM) DeepCopy() *IdentityForCmkARM { + if in == nil { + return nil + } + out := new(IdentityForCmkARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityForCmk_Status) DeepCopyInto(out *IdentityForCmk_Status) { + *out = *in + if in.UserAssignedIdentity != nil { + in, out := &in.UserAssignedIdentity, &out.UserAssignedIdentity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityForCmk_Status. +func (in *IdentityForCmk_Status) DeepCopy() *IdentityForCmk_Status { + if in == nil { + return nil + } + out := new(IdentityForCmk_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 *IdentityForCmk_StatusARM) DeepCopyInto(out *IdentityForCmk_StatusARM) { + *out = *in + if in.UserAssignedIdentity != nil { + in, out := &in.UserAssignedIdentity, &out.UserAssignedIdentity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityForCmk_StatusARM. +func (in *IdentityForCmk_StatusARM) DeepCopy() *IdentityForCmk_StatusARM { + if in == nil { + return nil + } + out := new(IdentityForCmk_StatusARM) + 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(IdentityStatusType) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]UserAssignedIdentity_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 *Identity_StatusARM) DeepCopyInto(out *Identity_StatusARM) { + *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(IdentityStatusType) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]UserAssignedIdentity_StatusARM, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity_StatusARM. +func (in *Identity_StatusARM) DeepCopy() *Identity_StatusARM { + if in == nil { + return nil + } + out := new(Identity_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyVaultProperties) DeepCopyInto(out *KeyVaultProperties) { + *out = *in + if in.IdentityClientId != nil { + in, out := &in.IdentityClientId, &out.IdentityClientId + *out = new(string) + **out = **in + } + if in.KeyIdentifier != nil { + in, out := &in.KeyIdentifier, &out.KeyIdentifier + *out = new(string) + **out = **in + } + if in.KeyVaultArmId != nil { + in, out := &in.KeyVaultArmId, &out.KeyVaultArmId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultProperties. +func (in *KeyVaultProperties) DeepCopy() *KeyVaultProperties { + if in == nil { + return nil + } + out := new(KeyVaultProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyVaultPropertiesARM) DeepCopyInto(out *KeyVaultPropertiesARM) { + *out = *in + if in.IdentityClientId != nil { + in, out := &in.IdentityClientId, &out.IdentityClientId + *out = new(string) + **out = **in + } + if in.KeyIdentifier != nil { + in, out := &in.KeyIdentifier, &out.KeyIdentifier + *out = new(string) + **out = **in + } + if in.KeyVaultArmId != nil { + in, out := &in.KeyVaultArmId, &out.KeyVaultArmId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultPropertiesARM. +func (in *KeyVaultPropertiesARM) DeepCopy() *KeyVaultPropertiesARM { + if in == nil { + return nil + } + out := new(KeyVaultPropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyVaultProperties_Status) DeepCopyInto(out *KeyVaultProperties_Status) { + *out = *in + if in.IdentityClientId != nil { + in, out := &in.IdentityClientId, &out.IdentityClientId + *out = new(string) + **out = **in + } + if in.KeyIdentifier != nil { + in, out := &in.KeyIdentifier, &out.KeyIdentifier + *out = new(string) + **out = **in + } + if in.KeyVaultArmId != nil { + in, out := &in.KeyVaultArmId, &out.KeyVaultArmId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultProperties_Status. +func (in *KeyVaultProperties_Status) DeepCopy() *KeyVaultProperties_Status { + if in == nil { + return nil + } + out := new(KeyVaultProperties_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 *KeyVaultProperties_StatusARM) DeepCopyInto(out *KeyVaultProperties_StatusARM) { + *out = *in + if in.IdentityClientId != nil { + in, out := &in.IdentityClientId, &out.IdentityClientId + *out = new(string) + **out = **in + } + if in.KeyIdentifier != nil { + in, out := &in.KeyIdentifier, &out.KeyIdentifier + *out = new(string) + **out = **in + } + if in.KeyVaultArmId != nil { + in, out := &in.KeyVaultArmId, &out.KeyVaultArmId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultProperties_StatusARM. +func (in *KeyVaultProperties_StatusARM) DeepCopy() *KeyVaultProperties_StatusARM { + if in == nil { + return nil + } + out := new(KeyVaultProperties_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NotebookPreparationError_Status) DeepCopyInto(out *NotebookPreparationError_Status) { + *out = *in + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } + if in.StatusCode != nil { + in, out := &in.StatusCode, &out.StatusCode + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotebookPreparationError_Status. +func (in *NotebookPreparationError_Status) DeepCopy() *NotebookPreparationError_Status { + if in == nil { + return nil + } + out := new(NotebookPreparationError_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 *NotebookPreparationError_StatusARM) DeepCopyInto(out *NotebookPreparationError_StatusARM) { + *out = *in + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } + if in.StatusCode != nil { + in, out := &in.StatusCode, &out.StatusCode + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotebookPreparationError_StatusARM. +func (in *NotebookPreparationError_StatusARM) DeepCopy() *NotebookPreparationError_StatusARM { + if in == nil { + return nil + } + out := new(NotebookPreparationError_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NotebookResourceInfo_Status) DeepCopyInto(out *NotebookResourceInfo_Status) { + *out = *in + if in.Fqdn != nil { + in, out := &in.Fqdn, &out.Fqdn + *out = new(string) + **out = **in + } + if in.NotebookPreparationError != nil { + in, out := &in.NotebookPreparationError, &out.NotebookPreparationError + *out = new(NotebookPreparationError_Status) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotebookResourceInfo_Status. +func (in *NotebookResourceInfo_Status) DeepCopy() *NotebookResourceInfo_Status { + if in == nil { + return nil + } + out := new(NotebookResourceInfo_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 *NotebookResourceInfo_StatusARM) DeepCopyInto(out *NotebookResourceInfo_StatusARM) { + *out = *in + if in.Fqdn != nil { + in, out := &in.Fqdn, &out.Fqdn + *out = new(string) + **out = **in + } + if in.NotebookPreparationError != nil { + in, out := &in.NotebookPreparationError, &out.NotebookPreparationError + *out = new(NotebookPreparationError_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotebookResourceInfo_StatusARM. +func (in *NotebookResourceInfo_StatusARM) DeepCopy() *NotebookResourceInfo_StatusARM { + if in == nil { + return nil + } + out := new(NotebookResourceInfo_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersonalComputeInstanceSettings) DeepCopyInto(out *PersonalComputeInstanceSettings) { + *out = *in + if in.AssignedUser != nil { + in, out := &in.AssignedUser, &out.AssignedUser + *out = new(AssignedUser) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersonalComputeInstanceSettings. +func (in *PersonalComputeInstanceSettings) DeepCopy() *PersonalComputeInstanceSettings { + if in == nil { + return nil + } + out := new(PersonalComputeInstanceSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersonalComputeInstanceSettingsARM) DeepCopyInto(out *PersonalComputeInstanceSettingsARM) { + *out = *in + if in.AssignedUser != nil { + in, out := &in.AssignedUser, &out.AssignedUser + *out = new(AssignedUserARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersonalComputeInstanceSettingsARM. +func (in *PersonalComputeInstanceSettingsARM) DeepCopy() *PersonalComputeInstanceSettingsARM { + if in == nil { + return nil + } + out := new(PersonalComputeInstanceSettingsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateEndpointConnection_Status_SubResourceEmbedded) DeepCopyInto(out *PrivateEndpointConnection_Status_SubResourceEmbedded) { + *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.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_Status) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateEndpointConnection_Status_SubResourceEmbedded. +func (in *PrivateEndpointConnection_Status_SubResourceEmbedded) DeepCopy() *PrivateEndpointConnection_Status_SubResourceEmbedded { + if in == nil { + return nil + } + out := new(PrivateEndpointConnection_Status_SubResourceEmbedded) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateEndpointConnection_Status_SubResourceEmbeddedARM) DeepCopyInto(out *PrivateEndpointConnection_Status_SubResourceEmbeddedARM) { + *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_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_StatusARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateEndpointConnection_Status_SubResourceEmbeddedARM. +func (in *PrivateEndpointConnection_Status_SubResourceEmbeddedARM) DeepCopy() *PrivateEndpointConnection_Status_SubResourceEmbeddedARM { + if in == nil { + return nil + } + out := new(PrivateEndpointConnection_Status_SubResourceEmbeddedARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceId) DeepCopyInto(out *ResourceId) { + *out = *in + if in.Reference != nil { + in, out := &in.Reference, &out.Reference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceId. +func (in *ResourceId) DeepCopy() *ResourceId { + if in == nil { + return nil + } + out := new(ResourceId) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceIdARM) DeepCopyInto(out *ResourceIdARM) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceIdARM. +func (in *ResourceIdARM) DeepCopy() *ResourceIdARM { + if in == nil { + return nil + } + out := new(ResourceIdARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleSettings) DeepCopyInto(out *ScaleSettings) { + *out = *in + if in.MaxNodeCount != nil { + in, out := &in.MaxNodeCount, &out.MaxNodeCount + *out = new(int) + **out = **in + } + if in.MinNodeCount != nil { + in, out := &in.MinNodeCount, &out.MinNodeCount + *out = new(int) + **out = **in + } + if in.NodeIdleTimeBeforeScaleDown != nil { + in, out := &in.NodeIdleTimeBeforeScaleDown, &out.NodeIdleTimeBeforeScaleDown + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleSettings. +func (in *ScaleSettings) DeepCopy() *ScaleSettings { + if in == nil { + return nil + } + out := new(ScaleSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleSettingsARM) DeepCopyInto(out *ScaleSettingsARM) { + *out = *in + if in.MaxNodeCount != nil { + in, out := &in.MaxNodeCount, &out.MaxNodeCount + *out = new(int) + **out = **in + } + if in.MinNodeCount != nil { + in, out := &in.MinNodeCount, &out.MinNodeCount + *out = new(int) + **out = **in + } + if in.NodeIdleTimeBeforeScaleDown != nil { + in, out := &in.NodeIdleTimeBeforeScaleDown, &out.NodeIdleTimeBeforeScaleDown + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleSettingsARM. +func (in *ScaleSettingsARM) DeepCopy() *ScaleSettingsARM { + if in == nil { + return nil + } + out := new(ScaleSettingsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScriptReference) DeepCopyInto(out *ScriptReference) { + *out = *in + if in.ScriptArguments != nil { + in, out := &in.ScriptArguments, &out.ScriptArguments + *out = new(string) + **out = **in + } + if in.ScriptData != nil { + in, out := &in.ScriptData, &out.ScriptData + *out = new(string) + **out = **in + } + if in.ScriptSource != nil { + in, out := &in.ScriptSource, &out.ScriptSource + *out = new(string) + **out = **in + } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptReference. +func (in *ScriptReference) DeepCopy() *ScriptReference { + if in == nil { + return nil + } + out := new(ScriptReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScriptReferenceARM) DeepCopyInto(out *ScriptReferenceARM) { + *out = *in + if in.ScriptArguments != nil { + in, out := &in.ScriptArguments, &out.ScriptArguments + *out = new(string) + **out = **in + } + if in.ScriptData != nil { + in, out := &in.ScriptData, &out.ScriptData + *out = new(string) + **out = **in + } + if in.ScriptSource != nil { + in, out := &in.ScriptSource, &out.ScriptSource + *out = new(string) + **out = **in + } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptReferenceARM. +func (in *ScriptReferenceARM) DeepCopy() *ScriptReferenceARM { + if in == nil { + return nil + } + out := new(ScriptReferenceARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScriptsToExecute) DeepCopyInto(out *ScriptsToExecute) { + *out = *in + if in.CreationScript != nil { + in, out := &in.CreationScript, &out.CreationScript + *out = new(ScriptReference) + (*in).DeepCopyInto(*out) + } + if in.StartupScript != nil { + in, out := &in.StartupScript, &out.StartupScript + *out = new(ScriptReference) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptsToExecute. +func (in *ScriptsToExecute) DeepCopy() *ScriptsToExecute { + if in == nil { + return nil + } + out := new(ScriptsToExecute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScriptsToExecuteARM) DeepCopyInto(out *ScriptsToExecuteARM) { + *out = *in + if in.CreationScript != nil { + in, out := &in.CreationScript, &out.CreationScript + *out = new(ScriptReferenceARM) + (*in).DeepCopyInto(*out) + } + if in.StartupScript != nil { + in, out := &in.StartupScript, &out.StartupScript + *out = new(ScriptReferenceARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptsToExecuteARM. +func (in *ScriptsToExecuteARM) DeepCopy() *ScriptsToExecuteARM { + if in == nil { + return nil + } + out := new(ScriptsToExecuteARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceManagedResourcesSettings) DeepCopyInto(out *ServiceManagedResourcesSettings) { + *out = *in + if in.CosmosDb != nil { + in, out := &in.CosmosDb, &out.CosmosDb + *out = new(CosmosDbSettings) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceManagedResourcesSettings. +func (in *ServiceManagedResourcesSettings) DeepCopy() *ServiceManagedResourcesSettings { + if in == nil { + return nil + } + out := new(ServiceManagedResourcesSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceManagedResourcesSettingsARM) DeepCopyInto(out *ServiceManagedResourcesSettingsARM) { + *out = *in + if in.CosmosDb != nil { + in, out := &in.CosmosDb, &out.CosmosDb + *out = new(CosmosDbSettingsARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceManagedResourcesSettingsARM. +func (in *ServiceManagedResourcesSettingsARM) DeepCopy() *ServiceManagedResourcesSettingsARM { + if in == nil { + return nil + } + out := new(ServiceManagedResourcesSettingsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceManagedResourcesSettings_Status) DeepCopyInto(out *ServiceManagedResourcesSettings_Status) { + *out = *in + if in.CosmosDb != nil { + in, out := &in.CosmosDb, &out.CosmosDb + *out = new(CosmosDbSettings_Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceManagedResourcesSettings_Status. +func (in *ServiceManagedResourcesSettings_Status) DeepCopy() *ServiceManagedResourcesSettings_Status { + if in == nil { + return nil + } + out := new(ServiceManagedResourcesSettings_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 *ServiceManagedResourcesSettings_StatusARM) DeepCopyInto(out *ServiceManagedResourcesSettings_StatusARM) { + *out = *in + if in.CosmosDb != nil { + in, out := &in.CosmosDb, &out.CosmosDb + *out = new(CosmosDbSettings_StatusARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceManagedResourcesSettings_StatusARM. +func (in *ServiceManagedResourcesSettings_StatusARM) DeepCopy() *ServiceManagedResourcesSettings_StatusARM { + if in == nil { + return nil + } + out := new(ServiceManagedResourcesSettings_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SetupScripts) DeepCopyInto(out *SetupScripts) { + *out = *in + if in.Scripts != nil { + in, out := &in.Scripts, &out.Scripts + *out = new(ScriptsToExecute) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SetupScripts. +func (in *SetupScripts) DeepCopy() *SetupScripts { + if in == nil { + return nil + } + out := new(SetupScripts) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SetupScriptsARM) DeepCopyInto(out *SetupScriptsARM) { + *out = *in + if in.Scripts != nil { + in, out := &in.Scripts, &out.Scripts + *out = new(ScriptsToExecuteARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SetupScriptsARM. +func (in *SetupScriptsARM) DeepCopy() *SetupScriptsARM { + if in == nil { + return nil + } + out := new(SetupScriptsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedPrivateLinkResourcePropertyARM) DeepCopyInto(out *SharedPrivateLinkResourcePropertyARM) { + *out = *in + if in.GroupId != nil { + in, out := &in.GroupId, &out.GroupId + *out = new(string) + **out = **in + } + if in.PrivateLinkResourceId != nil { + in, out := &in.PrivateLinkResourceId, &out.PrivateLinkResourceId + *out = new(string) + **out = **in + } + if in.RequestMessage != nil { + in, out := &in.RequestMessage, &out.RequestMessage + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(SharedPrivateLinkResourcePropertyStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedPrivateLinkResourcePropertyARM. +func (in *SharedPrivateLinkResourcePropertyARM) DeepCopy() *SharedPrivateLinkResourcePropertyARM { + if in == nil { + return nil + } + out := new(SharedPrivateLinkResourcePropertyARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedPrivateLinkResourceProperty_StatusARM) DeepCopyInto(out *SharedPrivateLinkResourceProperty_StatusARM) { + *out = *in + if in.GroupId != nil { + in, out := &in.GroupId, &out.GroupId + *out = new(string) + **out = **in + } + if in.PrivateLinkResourceId != nil { + in, out := &in.PrivateLinkResourceId, &out.PrivateLinkResourceId + *out = new(string) + **out = **in + } + if in.RequestMessage != nil { + in, out := &in.RequestMessage, &out.RequestMessage + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(PrivateEndpointServiceConnectionStatus_Status) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedPrivateLinkResourceProperty_StatusARM. +func (in *SharedPrivateLinkResourceProperty_StatusARM) DeepCopy() *SharedPrivateLinkResourceProperty_StatusARM { + if in == nil { + return nil + } + out := new(SharedPrivateLinkResourceProperty_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedPrivateLinkResource_Status) DeepCopyInto(out *SharedPrivateLinkResource_Status) { + *out = *in + if in.GroupId != nil { + in, out := &in.GroupId, &out.GroupId + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateLinkResourceId != nil { + in, out := &in.PrivateLinkResourceId, &out.PrivateLinkResourceId + *out = new(string) + **out = **in + } + if in.RequestMessage != nil { + in, out := &in.RequestMessage, &out.RequestMessage + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(PrivateEndpointServiceConnectionStatus_Status) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedPrivateLinkResource_Status. +func (in *SharedPrivateLinkResource_Status) DeepCopy() *SharedPrivateLinkResource_Status { + if in == nil { + return nil + } + out := new(SharedPrivateLinkResource_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 *SharedPrivateLinkResource_StatusARM) DeepCopyInto(out *SharedPrivateLinkResource_StatusARM) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SharedPrivateLinkResourceProperty_StatusARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedPrivateLinkResource_StatusARM. +func (in *SharedPrivateLinkResource_StatusARM) DeepCopy() *SharedPrivateLinkResource_StatusARM { + if in == nil { + return nil + } + out := new(SharedPrivateLinkResource_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sku) DeepCopyInto(out *Sku) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku. +func (in *Sku) DeepCopy() *Sku { + if in == nil { + return nil + } + out := new(Sku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SkuARM) DeepCopyInto(out *SkuARM) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SkuARM. +func (in *SkuARM) DeepCopy() *SkuARM { + if in == nil { + return nil + } + out := new(SkuARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sku_Status) DeepCopyInto(out *Sku_Status) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku_Status. +func (in *Sku_Status) DeepCopy() *Sku_Status { + if in == nil { + return nil + } + out := new(Sku_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 *Sku_StatusARM) DeepCopyInto(out *Sku_StatusARM) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku_StatusARM. +func (in *Sku_StatusARM) DeepCopy() *Sku_StatusARM { + if in == nil { + return nil + } + out := new(Sku_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SslConfiguration) DeepCopyInto(out *SslConfiguration) { + *out = *in + if in.Cert != nil { + in, out := &in.Cert, &out.Cert + *out = new(string) + **out = **in + } + if in.Cname != nil { + in, out := &in.Cname, &out.Cname + *out = new(string) + **out = **in + } + if in.Key != nil { + in, out := &in.Key, &out.Key + *out = new(string) + **out = **in + } + if in.LeafDomainLabel != nil { + in, out := &in.LeafDomainLabel, &out.LeafDomainLabel + *out = new(string) + **out = **in + } + if in.OverwriteExistingDomain != nil { + in, out := &in.OverwriteExistingDomain, &out.OverwriteExistingDomain + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(SslConfigurationStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SslConfiguration. +func (in *SslConfiguration) DeepCopy() *SslConfiguration { + if in == nil { + return nil + } + out := new(SslConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SslConfigurationARM) DeepCopyInto(out *SslConfigurationARM) { + *out = *in + if in.Cert != nil { + in, out := &in.Cert, &out.Cert + *out = new(string) + **out = **in + } + if in.Cname != nil { + in, out := &in.Cname, &out.Cname + *out = new(string) + **out = **in + } + if in.Key != nil { + in, out := &in.Key, &out.Key + *out = new(string) + **out = **in + } + if in.LeafDomainLabel != nil { + in, out := &in.LeafDomainLabel, &out.LeafDomainLabel + *out = new(string) + **out = **in + } + if in.OverwriteExistingDomain != nil { + in, out := &in.OverwriteExistingDomain, &out.OverwriteExistingDomain + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(SslConfigurationStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SslConfigurationARM. +func (in *SslConfigurationARM) DeepCopy() *SslConfigurationARM { + if in == nil { + return nil + } + out := new(SslConfigurationARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SynapseSparkProperties) DeepCopyInto(out *SynapseSparkProperties) { + *out = *in + if in.AutoPauseProperties != nil { + in, out := &in.AutoPauseProperties, &out.AutoPauseProperties + *out = new(AutoPauseProperties) + (*in).DeepCopyInto(*out) + } + if in.AutoScaleProperties != nil { + in, out := &in.AutoScaleProperties, &out.AutoScaleProperties + *out = new(AutoScaleProperties) + (*in).DeepCopyInto(*out) + } + if in.NodeCount != nil { + in, out := &in.NodeCount, &out.NodeCount + *out = new(int) + **out = **in + } + if in.NodeSize != nil { + in, out := &in.NodeSize, &out.NodeSize + *out = new(string) + **out = **in + } + if in.NodeSizeFamily != nil { + in, out := &in.NodeSizeFamily, &out.NodeSizeFamily + *out = new(string) + **out = **in + } + if in.PoolName != nil { + in, out := &in.PoolName, &out.PoolName + *out = new(string) + **out = **in + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(string) + **out = **in + } + if in.SparkVersion != nil { + in, out := &in.SparkVersion, &out.SparkVersion + *out = new(string) + **out = **in + } + if in.SubscriptionId != nil { + in, out := &in.SubscriptionId, &out.SubscriptionId + *out = new(string) + **out = **in + } + if in.WorkspaceName != nil { + in, out := &in.WorkspaceName, &out.WorkspaceName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SynapseSparkProperties. +func (in *SynapseSparkProperties) DeepCopy() *SynapseSparkProperties { + if in == nil { + return nil + } + out := new(SynapseSparkProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SynapseSparkPropertiesARM) DeepCopyInto(out *SynapseSparkPropertiesARM) { + *out = *in + if in.AutoPauseProperties != nil { + in, out := &in.AutoPauseProperties, &out.AutoPauseProperties + *out = new(AutoPausePropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.AutoScaleProperties != nil { + in, out := &in.AutoScaleProperties, &out.AutoScaleProperties + *out = new(AutoScalePropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.NodeCount != nil { + in, out := &in.NodeCount, &out.NodeCount + *out = new(int) + **out = **in + } + if in.NodeSize != nil { + in, out := &in.NodeSize, &out.NodeSize + *out = new(string) + **out = **in + } + if in.NodeSizeFamily != nil { + in, out := &in.NodeSizeFamily, &out.NodeSizeFamily + *out = new(string) + **out = **in + } + if in.PoolName != nil { + in, out := &in.PoolName, &out.PoolName + *out = new(string) + **out = **in + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(string) + **out = **in + } + if in.SparkVersion != nil { + in, out := &in.SparkVersion, &out.SparkVersion + *out = new(string) + **out = **in + } + if in.SubscriptionId != nil { + in, out := &in.SubscriptionId, &out.SubscriptionId + *out = new(string) + **out = **in + } + if in.WorkspaceName != nil { + in, out := &in.WorkspaceName, &out.WorkspaceName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SynapseSparkPropertiesARM. +func (in *SynapseSparkPropertiesARM) DeepCopy() *SynapseSparkPropertiesARM { + if in == nil { + return nil + } + out := new(SynapseSparkPropertiesARM) + 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) DeepCopyInto(out *SystemData) { + *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(SystemDataCreatedByType) + **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(SystemDataLastModifiedByType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData. +func (in *SystemData) DeepCopy() *SystemData { + if in == nil { + return nil + } + out := new(SystemData) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemDataARM) DeepCopyInto(out *SystemDataARM) { + *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(SystemDataCreatedByType) + **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(SystemDataLastModifiedByType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemDataARM. +func (in *SystemDataARM) DeepCopy() *SystemDataARM { + if in == nil { + return nil + } + out := new(SystemDataARM) + 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(SystemDataStatusCreatedByType) + **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(SystemDataStatusLastModifiedByType) + **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 *SystemData_StatusARM) DeepCopyInto(out *SystemData_StatusARM) { + *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(SystemDataStatusCreatedByType) + **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(SystemDataStatusLastModifiedByType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_StatusARM. +func (in *SystemData_StatusARM) DeepCopy() *SystemData_StatusARM { + if in == nil { + return nil + } + out := new(SystemData_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAccountCredentials) DeepCopyInto(out *UserAccountCredentials) { + *out = *in + if in.AdminUserName != nil { + in, out := &in.AdminUserName, &out.AdminUserName + *out = new(string) + **out = **in + } + if in.AdminUserPassword != nil { + in, out := &in.AdminUserPassword, &out.AdminUserPassword + *out = new(genruntime.SecretReference) + **out = **in + } + if in.AdminUserSshPublicKey != nil { + in, out := &in.AdminUserSshPublicKey, &out.AdminUserSshPublicKey + *out = new(genruntime.SecretReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAccountCredentials. +func (in *UserAccountCredentials) DeepCopy() *UserAccountCredentials { + if in == nil { + return nil + } + out := new(UserAccountCredentials) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAccountCredentialsARM) DeepCopyInto(out *UserAccountCredentialsARM) { + *out = *in + if in.AdminUserName != nil { + in, out := &in.AdminUserName, &out.AdminUserName + *out = new(string) + **out = **in + } + if in.AdminUserPassword != nil { + in, out := &in.AdminUserPassword, &out.AdminUserPassword + *out = new(string) + **out = **in + } + if in.AdminUserSshPublicKey != nil { + in, out := &in.AdminUserSshPublicKey, &out.AdminUserSshPublicKey + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAccountCredentialsARM. +func (in *UserAccountCredentialsARM) DeepCopy() *UserAccountCredentialsARM { + if in == nil { + return nil + } + out := new(UserAccountCredentialsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentity_Status) DeepCopyInto(out *UserAssignedIdentity_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.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentity_Status. +func (in *UserAssignedIdentity_Status) DeepCopy() *UserAssignedIdentity_Status { + if in == nil { + return nil + } + out := new(UserAssignedIdentity_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 *UserAssignedIdentity_StatusARM) DeepCopyInto(out *UserAssignedIdentity_StatusARM) { + *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.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentity_StatusARM. +func (in *UserAssignedIdentity_StatusARM) DeepCopy() *UserAssignedIdentity_StatusARM { + if in == nil { + return nil + } + out := new(UserAssignedIdentity_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImage) DeepCopyInto(out *VirtualMachineImage) { + *out = *in + if in.Reference != nil { + in, out := &in.Reference, &out.Reference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImage. +func (in *VirtualMachineImage) DeepCopy() *VirtualMachineImage { + if in == nil { + return nil + } + out := new(VirtualMachineImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineImageARM) DeepCopyInto(out *VirtualMachineImageARM) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImageARM. +func (in *VirtualMachineImageARM) DeepCopy() *VirtualMachineImageARM { + if in == nil { + return nil + } + out := new(VirtualMachineImageARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineProperties) DeepCopyInto(out *VirtualMachineProperties) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.AdministratorAccount != nil { + in, out := &in.AdministratorAccount, &out.AdministratorAccount + *out = new(VirtualMachineSshCredentials) + (*in).DeepCopyInto(*out) + } + if in.IsNotebookInstanceCompute != nil { + in, out := &in.IsNotebookInstanceCompute, &out.IsNotebookInstanceCompute + *out = new(bool) + **out = **in + } + if in.SshPort != nil { + in, out := &in.SshPort, &out.SshPort + *out = new(int) + **out = **in + } + if in.VirtualMachineSize != nil { + in, out := &in.VirtualMachineSize, &out.VirtualMachineSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineProperties. +func (in *VirtualMachineProperties) DeepCopy() *VirtualMachineProperties { + if in == nil { + return nil + } + out := new(VirtualMachineProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePropertiesARM) DeepCopyInto(out *VirtualMachinePropertiesARM) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.AdministratorAccount != nil { + in, out := &in.AdministratorAccount, &out.AdministratorAccount + *out = new(VirtualMachineSshCredentialsARM) + (*in).DeepCopyInto(*out) + } + if in.IsNotebookInstanceCompute != nil { + in, out := &in.IsNotebookInstanceCompute, &out.IsNotebookInstanceCompute + *out = new(bool) + **out = **in + } + if in.SshPort != nil { + in, out := &in.SshPort, &out.SshPort + *out = new(int) + **out = **in + } + if in.VirtualMachineSize != nil { + in, out := &in.VirtualMachineSize, &out.VirtualMachineSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePropertiesARM. +func (in *VirtualMachinePropertiesARM) DeepCopy() *VirtualMachinePropertiesARM { + if in == nil { + return nil + } + out := new(VirtualMachinePropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSshCredentials) DeepCopyInto(out *VirtualMachineSshCredentials) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(genruntime.SecretReference) + **out = **in + } + if in.PrivateKeyData != nil { + in, out := &in.PrivateKeyData, &out.PrivateKeyData + *out = new(string) + **out = **in + } + if in.PublicKeyData != nil { + in, out := &in.PublicKeyData, &out.PublicKeyData + *out = new(string) + **out = **in + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSshCredentials. +func (in *VirtualMachineSshCredentials) DeepCopy() *VirtualMachineSshCredentials { + if in == nil { + return nil + } + out := new(VirtualMachineSshCredentials) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSshCredentialsARM) DeepCopyInto(out *VirtualMachineSshCredentialsARM) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.PrivateKeyData != nil { + in, out := &in.PrivateKeyData, &out.PrivateKeyData + *out = new(string) + **out = **in + } + if in.PublicKeyData != nil { + in, out := &in.PublicKeyData, &out.PublicKeyData + *out = new(string) + **out = **in + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSshCredentialsARM. +func (in *VirtualMachineSshCredentialsARM) DeepCopy() *VirtualMachineSshCredentialsARM { + if in == nil { + return nil + } + out := new(VirtualMachineSshCredentialsARM) + 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 *WorkspaceConnectionPropsARM) DeepCopyInto(out *WorkspaceConnectionPropsARM) { + *out = *in + if in.AuthType != nil { + in, out := &in.AuthType, &out.AuthType + *out = new(string) + **out = **in + } + if in.Category != nil { + in, out := &in.Category, &out.Category + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.ValueFormat != nil { + in, out := &in.ValueFormat, &out.ValueFormat + *out = new(WorkspaceConnectionPropsValueFormat) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceConnectionPropsARM. +func (in *WorkspaceConnectionPropsARM) DeepCopy() *WorkspaceConnectionPropsARM { + if in == nil { + return nil + } + out := new(WorkspaceConnectionPropsARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceConnectionProps_StatusARM) DeepCopyInto(out *WorkspaceConnectionProps_StatusARM) { + *out = *in + if in.AuthType != nil { + in, out := &in.AuthType, &out.AuthType + *out = new(string) + **out = **in + } + if in.Category != nil { + in, out := &in.Category, &out.Category + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.ValueFormat != nil { + in, out := &in.ValueFormat, &out.ValueFormat + *out = new(WorkspaceConnectionPropsStatusValueFormat) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceConnectionProps_StatusARM. +func (in *WorkspaceConnectionProps_StatusARM) DeepCopy() *WorkspaceConnectionProps_StatusARM { + if in == nil { + return nil + } + out := new(WorkspaceConnectionProps_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceConnection_Status) DeepCopyInto(out *WorkspaceConnection_Status) { + *out = *in + if in.AuthType != nil { + in, out := &in.AuthType, &out.AuthType + *out = new(string) + **out = **in + } + if in.Category != nil { + in, out := &in.Category, &out.Category + *out = new(string) + **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.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.ValueFormat != nil { + in, out := &in.ValueFormat, &out.ValueFormat + *out = new(WorkspaceConnectionPropsStatusValueFormat) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceConnection_Status. +func (in *WorkspaceConnection_Status) DeepCopy() *WorkspaceConnection_Status { + if in == nil { + return nil + } + out := new(WorkspaceConnection_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 *WorkspaceConnection_StatusARM) DeepCopyInto(out *WorkspaceConnection_StatusARM) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(WorkspaceConnectionProps_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceConnection_StatusARM. +func (in *WorkspaceConnection_StatusARM) DeepCopy() *WorkspaceConnection_StatusARM { + if in == nil { + return nil + } + out := new(WorkspaceConnection_StatusARM) + 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.AppInsightsInstrumentationKey != nil { + in, out := &in.AppInsightsInstrumentationKey, &out.AppInsightsInstrumentationKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.ContainerRegistryPassword != nil { + in, out := &in.ContainerRegistryPassword, &out.ContainerRegistryPassword + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.ContainerRegistryPassword2 != nil { + in, out := &in.ContainerRegistryPassword2, &out.ContainerRegistryPassword2 + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.ContainerRegistryUserName != nil { + in, out := &in.ContainerRegistryUserName, &out.ContainerRegistryUserName + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryNotebookAccessKey != nil { + in, out := &in.PrimaryNotebookAccessKey, &out.PrimaryNotebookAccessKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryNotebookAccessKey != nil { + in, out := &in.SecondaryNotebookAccessKey, &out.SecondaryNotebookAccessKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.UserStorageKey != nil { + in, out := &in.UserStorageKey, &out.UserStorageKey + *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.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 *WorkspaceProperties_StatusARM) DeepCopyInto(out *WorkspaceProperties_StatusARM) { + *out = *in + if in.AllowPublicAccessWhenBehindVnet != nil { + in, out := &in.AllowPublicAccessWhenBehindVnet, &out.AllowPublicAccessWhenBehindVnet + *out = new(bool) + **out = **in + } + if in.ApplicationInsights != nil { + in, out := &in.ApplicationInsights, &out.ApplicationInsights + *out = new(string) + **out = **in + } + if in.ContainerRegistry != nil { + in, out := &in.ContainerRegistry, &out.ContainerRegistry + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DiscoveryUrl != nil { + in, out := &in.DiscoveryUrl, &out.DiscoveryUrl + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(EncryptionProperty_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.HbiWorkspace != nil { + in, out := &in.HbiWorkspace, &out.HbiWorkspace + *out = new(bool) + **out = **in + } + if in.ImageBuildCompute != nil { + in, out := &in.ImageBuildCompute, &out.ImageBuildCompute + *out = new(string) + **out = **in + } + if in.KeyVault != nil { + in, out := &in.KeyVault, &out.KeyVault + *out = new(string) + **out = **in + } + if in.MlFlowTrackingUri != nil { + in, out := &in.MlFlowTrackingUri, &out.MlFlowTrackingUri + *out = new(string) + **out = **in + } + if in.NotebookInfo != nil { + in, out := &in.NotebookInfo, &out.NotebookInfo + *out = new(NotebookResourceInfo_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.PrimaryUserAssignedIdentity != nil { + in, out := &in.PrimaryUserAssignedIdentity, &out.PrimaryUserAssignedIdentity + *out = new(string) + **out = **in + } + if in.PrivateEndpointConnections != nil { + in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections + *out = make([]PrivateEndpointConnection_Status_SubResourceEmbeddedARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PrivateLinkCount != nil { + in, out := &in.PrivateLinkCount, &out.PrivateLinkCount + *out = new(int) + **out = **in + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(WorkspacePropertiesStatusProvisioningState) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(WorkspacePropertiesStatusPublicNetworkAccess) + **out = **in + } + if in.ServiceManagedResourcesSettings != nil { + in, out := &in.ServiceManagedResourcesSettings, &out.ServiceManagedResourcesSettings + *out = new(ServiceManagedResourcesSettings_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.ServiceProvisionedResourceGroup != nil { + in, out := &in.ServiceProvisionedResourceGroup, &out.ServiceProvisionedResourceGroup + *out = new(string) + **out = **in + } + if in.SharedPrivateLinkResources != nil { + in, out := &in.SharedPrivateLinkResources, &out.SharedPrivateLinkResources + *out = make([]SharedPrivateLinkResource_StatusARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.StorageAccount != nil { + in, out := &in.StorageAccount, &out.StorageAccount + *out = new(string) + **out = **in + } + if in.StorageHnsEnabled != nil { + in, out := &in.StorageHnsEnabled, &out.StorageHnsEnabled + *out = new(bool) + **out = **in + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } + if in.WorkspaceId != nil { + in, out := &in.WorkspaceId, &out.WorkspaceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceProperties_StatusARM. +func (in *WorkspaceProperties_StatusARM) DeepCopy() *WorkspaceProperties_StatusARM { + if in == nil { + return nil + } + out := new(WorkspaceProperties_StatusARM) + 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.AllowPublicAccessWhenBehindVnet != nil { + in, out := &in.AllowPublicAccessWhenBehindVnet, &out.AllowPublicAccessWhenBehindVnet + *out = new(bool) + **out = **in + } + if in.ApplicationInsights != nil { + in, out := &in.ApplicationInsights, &out.ApplicationInsights + *out = new(string) + **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.ContainerRegistry != nil { + in, out := &in.ContainerRegistry, &out.ContainerRegistry + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DiscoveryUrl != nil { + in, out := &in.DiscoveryUrl, &out.DiscoveryUrl + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(EncryptionProperty_Status) + (*in).DeepCopyInto(*out) + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.HbiWorkspace != nil { + in, out := &in.HbiWorkspace, &out.HbiWorkspace + *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.ImageBuildCompute != nil { + in, out := &in.ImageBuildCompute, &out.ImageBuildCompute + *out = new(string) + **out = **in + } + if in.KeyVault != nil { + in, out := &in.KeyVault, &out.KeyVault + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MlFlowTrackingUri != nil { + in, out := &in.MlFlowTrackingUri, &out.MlFlowTrackingUri + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.NotebookInfo != nil { + in, out := &in.NotebookInfo, &out.NotebookInfo + *out = new(NotebookResourceInfo_Status) + (*in).DeepCopyInto(*out) + } + if in.PrimaryUserAssignedIdentity != nil { + in, out := &in.PrimaryUserAssignedIdentity, &out.PrimaryUserAssignedIdentity + *out = new(string) + **out = **in + } + if in.PrivateEndpointConnections != nil { + in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections + *out = make([]PrivateEndpointConnection_Status_SubResourceEmbedded, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PrivateLinkCount != nil { + in, out := &in.PrivateLinkCount, &out.PrivateLinkCount + *out = new(int) + **out = **in + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(WorkspacePropertiesStatusProvisioningState) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(WorkspacePropertiesStatusPublicNetworkAccess) + **out = **in + } + if in.ServiceManagedResourcesSettings != nil { + in, out := &in.ServiceManagedResourcesSettings, &out.ServiceManagedResourcesSettings + *out = new(ServiceManagedResourcesSettings_Status) + (*in).DeepCopyInto(*out) + } + if in.ServiceProvisionedResourceGroup != nil { + in, out := &in.ServiceProvisionedResourceGroup, &out.ServiceProvisionedResourceGroup + *out = new(string) + **out = **in + } + if in.SharedPrivateLinkResources != nil { + in, out := &in.SharedPrivateLinkResources, &out.SharedPrivateLinkResources + *out = make([]SharedPrivateLinkResource_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_Status) + (*in).DeepCopyInto(*out) + } + if in.StorageAccount != nil { + in, out := &in.StorageAccount, &out.StorageAccount + *out = new(string) + **out = **in + } + if in.StorageHnsEnabled != nil { + in, out := &in.StorageHnsEnabled, &out.StorageHnsEnabled + *out = new(bool) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_Status) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.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.WorkspaceId != nil { + in, out := &in.WorkspaceId, &out.WorkspaceId + *out = new(string) + **out = **in + } +} + +// 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_StatusARM) DeepCopyInto(out *Workspace_StatusARM) { + *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_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(WorkspaceProperties_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_StatusARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_StatusARM) + (*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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspace_StatusARM. +func (in *Workspace_StatusARM) DeepCopy() *Workspace_StatusARM { + if in == nil { + return nil + } + out := new(Workspace_StatusARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspacesCompute) DeepCopyInto(out *WorkspacesCompute) { + *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 WorkspacesCompute. +func (in *WorkspacesCompute) DeepCopy() *WorkspacesCompute { + if in == nil { + return nil + } + out := new(WorkspacesCompute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesCompute) 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 *WorkspacesComputeList) DeepCopyInto(out *WorkspacesComputeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]WorkspacesCompute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesComputeList. +func (in *WorkspacesComputeList) DeepCopy() *WorkspacesComputeList { + if in == nil { + return nil + } + out := new(WorkspacesComputeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesComputeList) 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 *WorkspacesComputes_Spec) DeepCopyInto(out *WorkspacesComputes_Spec) { + *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.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Compute) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData) + (*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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesComputes_Spec. +func (in *WorkspacesComputes_Spec) DeepCopy() *WorkspacesComputes_Spec { + if in == nil { + return nil + } + out := new(WorkspacesComputes_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspacesComputes_SpecARM) DeepCopyInto(out *WorkspacesComputes_SpecARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityARM) + (*in).DeepCopyInto(*out) + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(ComputeARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SkuARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemDataARM) + (*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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesComputes_SpecARM. +func (in *WorkspacesComputes_SpecARM) DeepCopy() *WorkspacesComputes_SpecARM { + if in == nil { + return nil + } + out := new(WorkspacesComputes_SpecARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspacesConnection) DeepCopyInto(out *WorkspacesConnection) { + *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 WorkspacesConnection. +func (in *WorkspacesConnection) DeepCopy() *WorkspacesConnection { + if in == nil { + return nil + } + out := new(WorkspacesConnection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesConnection) 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 *WorkspacesConnectionList) DeepCopyInto(out *WorkspacesConnectionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]WorkspacesConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesConnectionList. +func (in *WorkspacesConnectionList) DeepCopy() *WorkspacesConnectionList { + if in == nil { + return nil + } + out := new(WorkspacesConnectionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesConnectionList) 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 *WorkspacesConnections_Spec) DeepCopyInto(out *WorkspacesConnections_Spec) { + *out = *in + if in.AuthType != nil { + in, out := &in.AuthType, &out.AuthType + *out = new(string) + **out = **in + } + if in.Category != nil { + in, out := &in.Category, &out.Category + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.ValueFormat != nil { + in, out := &in.ValueFormat, &out.ValueFormat + *out = new(WorkspaceConnectionPropsValueFormat) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesConnections_Spec. +func (in *WorkspacesConnections_Spec) DeepCopy() *WorkspacesConnections_Spec { + if in == nil { + return nil + } + out := new(WorkspacesConnections_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspacesConnections_SpecARM) DeepCopyInto(out *WorkspacesConnections_SpecARM) { + *out = *in + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(WorkspaceConnectionPropsARM) + (*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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesConnections_SpecARM. +func (in *WorkspacesConnections_SpecARM) DeepCopy() *WorkspacesConnections_SpecARM { + if in == nil { + return nil + } + out := new(WorkspacesConnections_SpecARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspaces_Spec) DeepCopyInto(out *Workspaces_Spec) { + *out = *in + if in.AllowPublicAccessWhenBehindVnet != nil { + in, out := &in.AllowPublicAccessWhenBehindVnet, &out.AllowPublicAccessWhenBehindVnet + *out = new(bool) + **out = **in + } + if in.ApplicationInsightsReference != nil { + in, out := &in.ApplicationInsightsReference, &out.ApplicationInsightsReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.ContainerRegistryReference != nil { + in, out := &in.ContainerRegistryReference, &out.ContainerRegistryReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DiscoveryUrl != nil { + in, out := &in.DiscoveryUrl, &out.DiscoveryUrl + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(EncryptionProperty) + (*in).DeepCopyInto(*out) + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.HbiWorkspace != nil { + in, out := &in.HbiWorkspace, &out.HbiWorkspace + *out = new(bool) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.ImageBuildCompute != nil { + in, out := &in.ImageBuildCompute, &out.ImageBuildCompute + *out = new(string) + **out = **in + } + if in.KeyVaultReference != nil { + in, out := &in.KeyVaultReference, &out.KeyVaultReference + *out = new(genruntime.ResourceReference) + **out = **in + } + 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.PrimaryUserAssignedIdentityReference != nil { + in, out := &in.PrimaryUserAssignedIdentityReference, &out.PrimaryUserAssignedIdentityReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(WorkspacesSpecPropertiesPublicNetworkAccess) + **out = **in + } + if in.ServiceManagedResourcesSettings != nil { + in, out := &in.ServiceManagedResourcesSettings, &out.ServiceManagedResourcesSettings + *out = new(ServiceManagedResourcesSettings) + (*in).DeepCopyInto(*out) + } + if in.SharedPrivateLinkResources != nil { + in, out := &in.SharedPrivateLinkResources, &out.SharedPrivateLinkResources + *out = make([]Workspaces_Spec_Properties_SharedPrivateLinkResources, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku) + (*in).DeepCopyInto(*out) + } + if in.StorageAccountReference != nil { + in, out := &in.StorageAccountReference, &out.StorageAccountReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData) + (*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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspaces_Spec. +func (in *Workspaces_Spec) DeepCopy() *Workspaces_Spec { + if in == nil { + return nil + } + out := new(Workspaces_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspaces_SpecARM) DeepCopyInto(out *Workspaces_SpecARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityARM) + (*in).DeepCopyInto(*out) + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Workspaces_Spec_PropertiesARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SkuARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemDataARM) + (*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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspaces_SpecARM. +func (in *Workspaces_SpecARM) DeepCopy() *Workspaces_SpecARM { + if in == nil { + return nil + } + out := new(Workspaces_SpecARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspaces_Spec_PropertiesARM) DeepCopyInto(out *Workspaces_Spec_PropertiesARM) { + *out = *in + if in.AllowPublicAccessWhenBehindVnet != nil { + in, out := &in.AllowPublicAccessWhenBehindVnet, &out.AllowPublicAccessWhenBehindVnet + *out = new(bool) + **out = **in + } + if in.ApplicationInsights != nil { + in, out := &in.ApplicationInsights, &out.ApplicationInsights + *out = new(string) + **out = **in + } + if in.ContainerRegistry != nil { + in, out := &in.ContainerRegistry, &out.ContainerRegistry + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DiscoveryUrl != nil { + in, out := &in.DiscoveryUrl, &out.DiscoveryUrl + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(EncryptionPropertyARM) + (*in).DeepCopyInto(*out) + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.HbiWorkspace != nil { + in, out := &in.HbiWorkspace, &out.HbiWorkspace + *out = new(bool) + **out = **in + } + if in.ImageBuildCompute != nil { + in, out := &in.ImageBuildCompute, &out.ImageBuildCompute + *out = new(string) + **out = **in + } + if in.KeyVault != nil { + in, out := &in.KeyVault, &out.KeyVault + *out = new(string) + **out = **in + } + if in.PrimaryUserAssignedIdentity != nil { + in, out := &in.PrimaryUserAssignedIdentity, &out.PrimaryUserAssignedIdentity + *out = new(string) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(WorkspacesSpecPropertiesPublicNetworkAccess) + **out = **in + } + if in.ServiceManagedResourcesSettings != nil { + in, out := &in.ServiceManagedResourcesSettings, &out.ServiceManagedResourcesSettings + *out = new(ServiceManagedResourcesSettingsARM) + (*in).DeepCopyInto(*out) + } + if in.SharedPrivateLinkResources != nil { + in, out := &in.SharedPrivateLinkResources, &out.SharedPrivateLinkResources + *out = make([]Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.StorageAccount != nil { + in, out := &in.StorageAccount, &out.StorageAccount + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspaces_Spec_PropertiesARM. +func (in *Workspaces_Spec_PropertiesARM) DeepCopy() *Workspaces_Spec_PropertiesARM { + if in == nil { + return nil + } + out := new(Workspaces_Spec_PropertiesARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspaces_Spec_Properties_SharedPrivateLinkResources) DeepCopyInto(out *Workspaces_Spec_Properties_SharedPrivateLinkResources) { + *out = *in + if in.GroupId != nil { + in, out := &in.GroupId, &out.GroupId + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateLinkResourceReference != nil { + in, out := &in.PrivateLinkResourceReference, &out.PrivateLinkResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.RequestMessage != nil { + in, out := &in.RequestMessage, &out.RequestMessage + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(SharedPrivateLinkResourcePropertyStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspaces_Spec_Properties_SharedPrivateLinkResources. +func (in *Workspaces_Spec_Properties_SharedPrivateLinkResources) DeepCopy() *Workspaces_Spec_Properties_SharedPrivateLinkResources { + if in == nil { + return nil + } + out := new(Workspaces_Spec_Properties_SharedPrivateLinkResources) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM) DeepCopyInto(out *Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SharedPrivateLinkResourcePropertyARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM. +func (in *Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM) DeepCopy() *Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM { + if in == nil { + return nil + } + out := new(Workspaces_Spec_Properties_SharedPrivateLinkResourcesARM) + in.DeepCopyInto(out) + return out +} diff --git a/v2/api/machinelearningservices/v1beta20210701storage/groupversion_info_gen.go b/v2/api/machinelearningservices/v1beta20210701storage/groupversion_info_gen.go new file mode 100644 index 0000000000..315dade345 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/groupversion_info_gen.go @@ -0,0 +1,31 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1beta20210701storage contains API Schema definitions for the machinelearningservices v1beta20210701storage API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=machinelearningservices.azure.com +package v1beta20210701storage + +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: "machinelearningservices.azure.com", Version: "v1beta20210701storage"} + + // 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/machinelearningservices/v1beta20210701storage/workspace_types_gen.go b/v2/api/machinelearningservices/v1beta20210701storage/workspace_types_gen.go new file mode 100644 index 0000000000..2c4d17e6c2 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/workspace_types_gen.go @@ -0,0 +1,471 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources=workspaces,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources={workspaces/status,workspaces/finalizers},verbs=get;update;patch + +// +kubebuilder:object:root=true +// +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 v1beta20210701.Workspace +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces +type Workspace struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Workspaces_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 _ 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 "2021-07-01" +func (workspace Workspace) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetResourceKind returns the kind of the resource +func (workspace *Workspace) GetResourceKind() genruntime.ResourceKind { + return genruntime.ResourceKindNormal +} + +// 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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces" +func (workspace *Workspace) GetType() string { + return "Microsoft.MachineLearningServices/workspaces" +} + +// NewEmptyStatus returns a new empty (blank) status +func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Workspace_Status{} +} + +// Owner returns the ResourceReference of the owner, or nil if there is no owner +func (workspace *Workspace) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(workspace.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: workspace.Spec.Owner.Name, + } +} + +// 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 errors.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 v1beta20210701.Workspace +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces +type WorkspaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Workspace `json:"items"` +} + +// Storage version of v1beta20210701.APIVersion +// +kubebuilder:validation:Enum={"2021-07-01"} +type APIVersion string + +const APIVersionValue = APIVersion("2021-07-01") + +// Storage version of v1beta20210701.Workspace_Status +type Workspace_Status struct { + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + ApplicationInsights *string `json:"applicationInsights,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + ContainerRegistry *string `json:"containerRegistry,omitempty"` + Description *string `json:"description,omitempty"` + DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + Encryption *EncryptionProperty_Status `json:"encryption,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + Id *string `json:"id,omitempty"` + Identity *Identity_Status `json:"identity,omitempty"` + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + KeyVault *string `json:"keyVault,omitempty"` + Location *string `json:"location,omitempty"` + MlFlowTrackingUri *string `json:"mlFlowTrackingUri,omitempty"` + Name *string `json:"name,omitempty"` + NotebookInfo *NotebookResourceInfo_Status `json:"notebookInfo,omitempty"` + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + PrivateEndpointConnections []PrivateEndpointConnection_Status_SubResourceEmbedded `json:"privateEndpointConnections,omitempty"` + PrivateLinkCount *int `json:"privateLinkCount,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings_Status `json:"serviceManagedResourcesSettings,omitempty"` + ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"` + SharedPrivateLinkResources []SharedPrivateLinkResource_Status `json:"sharedPrivateLinkResources,omitempty"` + Sku *Sku_Status `json:"sku,omitempty"` + StorageAccount *string `json:"storageAccount,omitempty"` + StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty"` + SystemData *SystemData_Status `json:"systemData,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + Type *string `json:"type,omitempty"` + WorkspaceId *string `json:"workspaceId,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 errors.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 errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(workspace) +} + +// Storage version of v1beta20210701.Workspaces_Spec +type Workspaces_Spec struct { + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + + // ApplicationInsightsReference: ARM id of the application insights associated with this workspace. This cannot be changed + // once the workspace has been created + ApplicationInsightsReference *genruntime.ResourceReference `armReference:"ApplicationInsights" json:"applicationInsightsReference,omitempty"` + + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + + // ContainerRegistryReference: ARM id of the container registry associated with this workspace. This cannot be changed once + // the workspace has been created + ContainerRegistryReference *genruntime.ResourceReference `armReference:"ContainerRegistry" json:"containerRegistryReference,omitempty"` + Description *string `json:"description,omitempty"` + DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + Encryption *EncryptionProperty `json:"encryption,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + Identity *Identity `json:"identity,omitempty"` + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + + // KeyVaultReference: ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has + // been created + KeyVaultReference *genruntime.ResourceReference `armReference:"KeyVault" json:"keyVaultReference,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"` + + // PrimaryUserAssignedIdentityReference: The user assigned identity resource id that represents the workspace identity. + PrimaryUserAssignedIdentityReference *genruntime.ResourceReference `armReference:"PrimaryUserAssignedIdentity" json:"primaryUserAssignedIdentityReference,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` + SharedPrivateLinkResources []Workspaces_Spec_Properties_SharedPrivateLinkResources `json:"sharedPrivateLinkResources,omitempty"` + Sku *Sku `json:"sku,omitempty"` + + // StorageAccountReference: ARM id of the storage account associated with this workspace. This cannot be changed once the + // workspace has been created + StorageAccountReference *genruntime.ResourceReference `armReference:"StorageAccount" json:"storageAccountReference,omitempty"` + SystemData *SystemData `json:"systemData,omitempty"` + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Workspaces_Spec{} + +// ConvertSpecFrom populates our Workspaces_Spec from the provided source +func (workspaces *Workspaces_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == workspaces { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(workspaces) +} + +// ConvertSpecTo populates the provided destination from our Workspaces_Spec +func (workspaces *Workspaces_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == workspaces { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(workspaces) +} + +// Storage version of v1beta20210701.EncryptionProperty +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/EncryptionProperty +type EncryptionProperty struct { + Identity *IdentityForCmk `json:"identity,omitempty"` + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Status *string `json:"status,omitempty"` +} + +// Storage version of v1beta20210701.EncryptionProperty_Status +type EncryptionProperty_Status struct { + Identity *IdentityForCmk_Status `json:"identity,omitempty"` + KeyVaultProperties *KeyVaultProperties_Status `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Status *string `json:"status,omitempty"` +} + +// Storage version of v1beta20210701.Identity +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Identity +type Identity struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` + UserAssignedIdentities map[string]v1.JSON `json:"userAssignedIdentities,omitempty"` +} + +// Storage version of v1beta20210701.Identity_Status +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]UserAssignedIdentity_Status `json:"userAssignedIdentities,omitempty"` +} + +// Storage version of v1beta20210701.NotebookResourceInfo_Status +type NotebookResourceInfo_Status struct { + Fqdn *string `json:"fqdn,omitempty"` + NotebookPreparationError *NotebookPreparationError_Status `json:"notebookPreparationError,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +// Storage version of v1beta20210701.PrivateEndpointConnection_Status_SubResourceEmbedded +type PrivateEndpointConnection_Status_SubResourceEmbedded struct { + Id *string `json:"id,omitempty"` + Identity *Identity_Status `json:"identity,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Sku *Sku_Status `json:"sku,omitempty"` + SystemData *SystemData_Status `json:"systemData,omitempty"` +} + +// Storage version of v1beta20210701.ServiceManagedResourcesSettings +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ServiceManagedResourcesSettings +type ServiceManagedResourcesSettings struct { + CosmosDb *CosmosDbSettings `json:"cosmosDb,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.ServiceManagedResourcesSettings_Status +type ServiceManagedResourcesSettings_Status struct { + CosmosDb *CosmosDbSettings_Status `json:"cosmosDb,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.SharedPrivateLinkResource_Status +type SharedPrivateLinkResource_Status struct { + GroupId *string `json:"groupId,omitempty"` + Name *string `json:"name,omitempty"` + PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequestMessage *string `json:"requestMessage,omitempty"` + Status *string `json:"status,omitempty"` +} + +// Storage version of v1beta20210701.Sku +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Sku +type Sku struct { + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// Storage version of v1beta20210701.Sku_Status +type Sku_Status struct { + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// Storage version of v1beta20210701.SystemData +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SystemData +type SystemData 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 v1beta20210701.SystemData_Status +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 v1beta20210701.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 { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *WorkspaceOperatorSecrets `json:"secrets,omitempty"` +} + +// Storage version of v1beta20210701.Workspaces_Spec_Properties_SharedPrivateLinkResources +type Workspaces_Spec_Properties_SharedPrivateLinkResources struct { + GroupId *string `json:"groupId,omitempty"` + Name *string `json:"name,omitempty"` + + // PrivateLinkResourceReference: The resource id that private link links to. + PrivateLinkResourceReference *genruntime.ResourceReference `armReference:"PrivateLinkResourceId" json:"privateLinkResourceReference,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequestMessage *string `json:"requestMessage,omitempty"` + Status *string `json:"status,omitempty"` +} + +// Storage version of v1beta20210701.CosmosDbSettings +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/CosmosDbSettings +type CosmosDbSettings struct { + CollectionsThroughput *int `json:"collectionsThroughput,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.CosmosDbSettings_Status +type CosmosDbSettings_Status struct { + CollectionsThroughput *int `json:"collectionsThroughput,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.IdentityForCmk +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/IdentityForCmk +type IdentityForCmk struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +// Storage version of v1beta20210701.IdentityForCmk_Status +type IdentityForCmk_Status struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +// Storage version of v1beta20210701.KeyVaultProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/KeyVaultProperties +type KeyVaultProperties struct { + IdentityClientId *string `json:"identityClientId,omitempty"` + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + KeyVaultArmId *string `json:"keyVaultArmId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.KeyVaultProperties_Status +type KeyVaultProperties_Status struct { + IdentityClientId *string `json:"identityClientId,omitempty"` + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + KeyVaultArmId *string `json:"keyVaultArmId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.NotebookPreparationError_Status +type NotebookPreparationError_Status struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +// Storage version of v1beta20210701.UserAssignedIdentity_Status +type UserAssignedIdentity_Status struct { + ClientId *string `json:"clientId,omitempty"` + PrincipalId *string `json:"principalId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} + +// Storage version of v1beta20210701.WorkspaceOperatorSecrets +type WorkspaceOperatorSecrets struct { + AppInsightsInstrumentationKey *genruntime.SecretDestination `json:"appInsightsInstrumentationKey,omitempty"` + ContainerRegistryPassword *genruntime.SecretDestination `json:"containerRegistryPassword,omitempty"` + ContainerRegistryPassword2 *genruntime.SecretDestination `json:"containerRegistryPassword2,omitempty"` + ContainerRegistryUserName *genruntime.SecretDestination `json:"containerRegistryUserName,omitempty"` + PrimaryNotebookAccessKey *genruntime.SecretDestination `json:"primaryNotebookAccessKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryNotebookAccessKey *genruntime.SecretDestination `json:"secondaryNotebookAccessKey,omitempty"` + UserStorageKey *genruntime.SecretDestination `json:"userStorageKey,omitempty"` +} + +func init() { + SchemeBuilder.Register(&Workspace{}, &WorkspaceList{}) +} diff --git a/v2/api/machinelearningservices/v1beta20210701storage/workspace_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701storage/workspace_types_gen_test.go new file mode 100644 index 0000000000..25cbc21f27 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/workspace_types_gen_test.go @@ -0,0 +1,1797 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701storage + +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_Workspace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + 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"] = WorkspacesSpecGenerator() + gens["Status"] = WorkspaceStatusGenerator() +} + +func Test_Workspace_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspace_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceStatus, WorkspaceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceStatus runs a test to see if a specific instance of Workspace_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceStatus(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 WorkspaceStatusGenerator() +var workspaceStatusGenerator gopter.Gen + +// WorkspaceStatusGenerator returns a generator of Workspace_Status instances for property testing. +// We first initialize workspaceStatusGenerator 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 WorkspaceStatusGenerator() gopter.Gen { + if workspaceStatusGenerator != nil { + return workspaceStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceStatus(generators) + workspaceStatusGenerator = 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) + AddIndependentPropertyGeneratorsForWorkspaceStatus(generators) + AddRelatedPropertyGeneratorsForWorkspaceStatus(generators) + workspaceStatusGenerator = gen.Struct(reflect.TypeOf(Workspace_Status{}), generators) + + return workspaceStatusGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceStatus(gens map[string]gopter.Gen) { + gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool()) + gens["ApplicationInsights"] = gen.PtrOf(gen.AlphaString()) + gens["ContainerRegistry"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString()) + gens["FriendlyName"] = gen.PtrOf(gen.AlphaString()) + gens["HbiWorkspace"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVault"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MlFlowTrackingUri"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PrimaryUserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateLinkCount"] = gen.PtrOf(gen.Int()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString()) + gens["ServiceProvisionedResourceGroup"] = gen.PtrOf(gen.AlphaString()) + gens["StorageAccount"] = gen.PtrOf(gen.AlphaString()) + gens["StorageHnsEnabled"] = gen.PtrOf(gen.Bool()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspaceStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspaceStatus(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionPropertyStatusGenerator()) + gens["Identity"] = gen.PtrOf(IdentityStatusGenerator()) + gens["NotebookInfo"] = gen.PtrOf(NotebookResourceInfoStatusGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator()) + gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsStatusGenerator()) + gens["SharedPrivateLinkResources"] = gen.SliceOf(SharedPrivateLinkResourceStatusGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusGenerator()) +} + +func Test_Workspaces_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspaces_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesSpec, WorkspacesSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesSpec runs a test to see if a specific instance of Workspaces_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesSpec(subject Workspaces_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspaces_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 Workspaces_Spec instances for property testing - lazily instantiated by WorkspacesSpecGenerator() +var workspacesSpecGenerator gopter.Gen + +// WorkspacesSpecGenerator returns a generator of Workspaces_Spec instances for property testing. +// We first initialize workspacesSpecGenerator 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 WorkspacesSpecGenerator() gopter.Gen { + if workspacesSpecGenerator != nil { + return workspacesSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpec(generators) + workspacesSpecGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpec(generators) + AddRelatedPropertyGeneratorsForWorkspacesSpec(generators) + workspacesSpecGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec{}), generators) + + return workspacesSpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesSpec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesSpec(gens map[string]gopter.Gen) { + gens["AllowPublicAccessWhenBehindVnet"] = gen.PtrOf(gen.Bool()) + gens["AzureName"] = gen.AlphaString() + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DiscoveryUrl"] = gen.PtrOf(gen.AlphaString()) + gens["FriendlyName"] = gen.PtrOf(gen.AlphaString()) + gens["HbiWorkspace"] = gen.PtrOf(gen.Bool()) + gens["ImageBuildCompute"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() + gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesSpec(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionPropertyGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(WorkspaceOperatorSpecGenerator()) + gens["ServiceManagedResourcesSettings"] = gen.PtrOf(ServiceManagedResourcesSettingsGenerator()) + gens["SharedPrivateLinkResources"] = gen.SliceOf(WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator()) + gens["Sku"] = gen.PtrOf(SkuGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataGenerator()) +} + +func Test_EncryptionProperty_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of EncryptionProperty via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryptionProperty, EncryptionPropertyGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryptionProperty runs a test to see if a specific instance of EncryptionProperty round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryptionProperty(subject EncryptionProperty) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual EncryptionProperty + 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 EncryptionProperty instances for property testing - lazily instantiated by EncryptionPropertyGenerator() +var encryptionPropertyGenerator gopter.Gen + +// EncryptionPropertyGenerator returns a generator of EncryptionProperty instances for property testing. +// We first initialize encryptionPropertyGenerator 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 EncryptionPropertyGenerator() gopter.Gen { + if encryptionPropertyGenerator != nil { + return encryptionPropertyGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionProperty(generators) + encryptionPropertyGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionProperty(generators) + AddRelatedPropertyGeneratorsForEncryptionProperty(generators) + encryptionPropertyGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty{}), generators) + + return encryptionPropertyGenerator +} + +// AddIndependentPropertyGeneratorsForEncryptionProperty is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryptionProperty(gens map[string]gopter.Gen) { + gens["Status"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForEncryptionProperty is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryptionProperty(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityForCmkGenerator()) + gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesGenerator()) +} + +func Test_EncryptionProperty_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of EncryptionProperty_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryptionPropertyStatus, EncryptionPropertyStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryptionPropertyStatus runs a test to see if a specific instance of EncryptionProperty_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryptionPropertyStatus(subject EncryptionProperty_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual EncryptionProperty_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 EncryptionProperty_Status instances for property testing - lazily instantiated by +// EncryptionPropertyStatusGenerator() +var encryptionPropertyStatusGenerator gopter.Gen + +// EncryptionPropertyStatusGenerator returns a generator of EncryptionProperty_Status instances for property testing. +// We first initialize encryptionPropertyStatusGenerator 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 EncryptionPropertyStatusGenerator() gopter.Gen { + if encryptionPropertyStatusGenerator != nil { + return encryptionPropertyStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyStatus(generators) + encryptionPropertyStatusGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryptionPropertyStatus(generators) + AddRelatedPropertyGeneratorsForEncryptionPropertyStatus(generators) + encryptionPropertyStatusGenerator = gen.Struct(reflect.TypeOf(EncryptionProperty_Status{}), generators) + + return encryptionPropertyStatusGenerator +} + +// AddIndependentPropertyGeneratorsForEncryptionPropertyStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryptionPropertyStatus(gens map[string]gopter.Gen) { + gens["Status"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForEncryptionPropertyStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryptionPropertyStatus(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityForCmkStatusGenerator()) + gens["KeyVaultProperties"] = gen.PtrOf(KeyVaultPropertiesStatusGenerator()) +} + +func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + 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. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(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()) +} + +func Test_Identity_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityStatus, IdentityStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityStatus runs a test to see if a specific instance of Identity_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityStatus(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 IdentityStatusGenerator() +var identityStatusGenerator gopter.Gen + +// IdentityStatusGenerator returns a generator of Identity_Status instances for property testing. +// We first initialize identityStatusGenerator 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 IdentityStatusGenerator() gopter.Gen { + if identityStatusGenerator != nil { + return identityStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityStatus(generators) + identityStatusGenerator = 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) + AddIndependentPropertyGeneratorsForIdentityStatus(generators) + AddRelatedPropertyGeneratorsForIdentityStatus(generators) + identityStatusGenerator = gen.Struct(reflect.TypeOf(Identity_Status{}), generators) + + return identityStatusGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityStatus(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForIdentityStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentityStatus(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentityStatusGenerator()) +} + +func Test_NotebookResourceInfo_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NotebookResourceInfo_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNotebookResourceInfoStatus, NotebookResourceInfoStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNotebookResourceInfoStatus runs a test to see if a specific instance of NotebookResourceInfo_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForNotebookResourceInfoStatus(subject NotebookResourceInfo_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NotebookResourceInfo_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 NotebookResourceInfo_Status instances for property testing - lazily instantiated by +// NotebookResourceInfoStatusGenerator() +var notebookResourceInfoStatusGenerator gopter.Gen + +// NotebookResourceInfoStatusGenerator returns a generator of NotebookResourceInfo_Status instances for property testing. +// We first initialize notebookResourceInfoStatusGenerator 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 NotebookResourceInfoStatusGenerator() gopter.Gen { + if notebookResourceInfoStatusGenerator != nil { + return notebookResourceInfoStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus(generators) + notebookResourceInfoStatusGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus(generators) + AddRelatedPropertyGeneratorsForNotebookResourceInfoStatus(generators) + notebookResourceInfoStatusGenerator = gen.Struct(reflect.TypeOf(NotebookResourceInfo_Status{}), generators) + + return notebookResourceInfoStatusGenerator +} + +// AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNotebookResourceInfoStatus(gens map[string]gopter.Gen) { + gens["Fqdn"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNotebookResourceInfoStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNotebookResourceInfoStatus(gens map[string]gopter.Gen) { + gens["NotebookPreparationError"] = gen.PtrOf(NotebookPreparationErrorStatusGenerator()) +} + +func Test_PrivateEndpointConnection_Status_SubResourceEmbedded_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PrivateEndpointConnection_Status_SubResourceEmbedded via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbedded, PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbedded runs a test to see if a specific instance of PrivateEndpointConnection_Status_SubResourceEmbedded round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnectionStatusSubResourceEmbedded(subject PrivateEndpointConnection_Status_SubResourceEmbedded) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateEndpointConnection_Status_SubResourceEmbedded + 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 PrivateEndpointConnection_Status_SubResourceEmbedded instances for property testing - lazily +// instantiated by PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator() +var privateEndpointConnectionStatusSubResourceEmbeddedGenerator gopter.Gen + +// PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator returns a generator of PrivateEndpointConnection_Status_SubResourceEmbedded instances for property testing. +// We first initialize privateEndpointConnectionStatusSubResourceEmbeddedGenerator 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 PrivateEndpointConnectionStatusSubResourceEmbeddedGenerator() gopter.Gen { + if privateEndpointConnectionStatusSubResourceEmbeddedGenerator != nil { + return privateEndpointConnectionStatusSubResourceEmbeddedGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(generators) + privateEndpointConnectionStatusSubResourceEmbeddedGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbedded{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(generators) + AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(generators) + privateEndpointConnectionStatusSubResourceEmbeddedGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_Status_SubResourceEmbedded{}), generators) + + return privateEndpointConnectionStatusSubResourceEmbeddedGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForPrivateEndpointConnectionStatusSubResourceEmbedded(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityStatusGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusGenerator()) +} + +func Test_ServiceManagedResourcesSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ServiceManagedResourcesSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettings, ServiceManagedResourcesSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForServiceManagedResourcesSettings runs a test to see if a specific instance of ServiceManagedResourcesSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForServiceManagedResourcesSettings(subject ServiceManagedResourcesSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ServiceManagedResourcesSettings + 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 ServiceManagedResourcesSettings instances for property testing - lazily instantiated by +// ServiceManagedResourcesSettingsGenerator() +var serviceManagedResourcesSettingsGenerator gopter.Gen + +// ServiceManagedResourcesSettingsGenerator returns a generator of ServiceManagedResourcesSettings instances for property testing. +func ServiceManagedResourcesSettingsGenerator() gopter.Gen { + if serviceManagedResourcesSettingsGenerator != nil { + return serviceManagedResourcesSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings(generators) + serviceManagedResourcesSettingsGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings{}), generators) + + return serviceManagedResourcesSettingsGenerator +} + +// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings(gens map[string]gopter.Gen) { + gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsGenerator()) +} + +func Test_ServiceManagedResourcesSettings_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ServiceManagedResourcesSettings_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForServiceManagedResourcesSettingsStatus, ServiceManagedResourcesSettingsStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForServiceManagedResourcesSettingsStatus runs a test to see if a specific instance of ServiceManagedResourcesSettings_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForServiceManagedResourcesSettingsStatus(subject ServiceManagedResourcesSettings_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ServiceManagedResourcesSettings_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 ServiceManagedResourcesSettings_Status instances for property testing - lazily instantiated by +// ServiceManagedResourcesSettingsStatusGenerator() +var serviceManagedResourcesSettingsStatusGenerator gopter.Gen + +// ServiceManagedResourcesSettingsStatusGenerator returns a generator of ServiceManagedResourcesSettings_Status instances for property testing. +func ServiceManagedResourcesSettingsStatusGenerator() gopter.Gen { + if serviceManagedResourcesSettingsStatusGenerator != nil { + return serviceManagedResourcesSettingsStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatus(generators) + serviceManagedResourcesSettingsStatusGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings_Status{}), generators) + + return serviceManagedResourcesSettingsStatusGenerator +} + +// AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettingsStatus(gens map[string]gopter.Gen) { + gens["CosmosDb"] = gen.PtrOf(CosmosDbSettingsStatusGenerator()) +} + +func Test_SharedPrivateLinkResource_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SharedPrivateLinkResource_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSharedPrivateLinkResourceStatus, SharedPrivateLinkResourceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSharedPrivateLinkResourceStatus runs a test to see if a specific instance of SharedPrivateLinkResource_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForSharedPrivateLinkResourceStatus(subject SharedPrivateLinkResource_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SharedPrivateLinkResource_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 SharedPrivateLinkResource_Status instances for property testing - lazily instantiated by +// SharedPrivateLinkResourceStatusGenerator() +var sharedPrivateLinkResourceStatusGenerator gopter.Gen + +// SharedPrivateLinkResourceStatusGenerator returns a generator of SharedPrivateLinkResource_Status instances for property testing. +func SharedPrivateLinkResourceStatusGenerator() gopter.Gen { + if sharedPrivateLinkResourceStatusGenerator != nil { + return sharedPrivateLinkResourceStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatus(generators) + sharedPrivateLinkResourceStatusGenerator = gen.Struct(reflect.TypeOf(SharedPrivateLinkResource_Status{}), generators) + + return sharedPrivateLinkResourceStatusGenerator +} + +// AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSharedPrivateLinkResourceStatus(gens map[string]gopter.Gen) { + gens["GroupId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PrivateLinkResourceId"] = gen.PtrOf(gen.AlphaString()) + gens["RequestMessage"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSku, SkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSku runs a test to see if a specific instance of Sku round trips to JSON and back losslessly +func RunJSONSerializationTestForSku(subject Sku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Sku + 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 Sku instances for property testing - lazily instantiated by SkuGenerator() +var skuGenerator gopter.Gen + +// SkuGenerator returns a generator of Sku instances for property testing. +func SkuGenerator() gopter.Gen { + if skuGenerator != nil { + return skuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSku(generators) + skuGenerator = gen.Struct(reflect.TypeOf(Sku{}), generators) + + return skuGenerator +} + +// AddIndependentPropertyGeneratorsForSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSku(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tier"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Sku_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSkuStatus, SkuStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSkuStatus runs a test to see if a specific instance of Sku_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForSkuStatus(subject Sku_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Sku_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 Sku_Status instances for property testing - lazily instantiated by SkuStatusGenerator() +var skuStatusGenerator gopter.Gen + +// SkuStatusGenerator returns a generator of Sku_Status instances for property testing. +func SkuStatusGenerator() gopter.Gen { + if skuStatusGenerator != nil { + return skuStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSkuStatus(generators) + skuStatusGenerator = gen.Struct(reflect.TypeOf(Sku_Status{}), generators) + + return skuStatusGenerator +} + +// AddIndependentPropertyGeneratorsForSkuStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSkuStatus(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tier"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SystemData_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData, SystemDataGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData runs a test to see if a specific instance of SystemData round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData(subject SystemData) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData + 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 instances for property testing - lazily instantiated by SystemDataGenerator() +var systemDataGenerator gopter.Gen + +// SystemDataGenerator returns a generator of SystemData instances for property testing. +func SystemDataGenerator() gopter.Gen { + if systemDataGenerator != nil { + return systemDataGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData(generators) + systemDataGenerator = gen.Struct(reflect.TypeOf(SystemData{}), generators) + + return systemDataGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData(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_SystemData_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemDataStatus, SystemDataStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemDataStatus runs a test to see if a specific instance of SystemData_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemDataStatus(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 SystemDataStatusGenerator() +var systemDataStatusGenerator gopter.Gen + +// SystemDataStatusGenerator returns a generator of SystemData_Status instances for property testing. +func SystemDataStatusGenerator() gopter.Gen { + if systemDataStatusGenerator != nil { + return systemDataStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemDataStatus(generators) + systemDataStatusGenerator = gen.Struct(reflect.TypeOf(SystemData_Status{}), generators) + + return systemDataStatusGenerator +} + +// AddIndependentPropertyGeneratorsForSystemDataStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemDataStatus(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_WorkspaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + 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_Workspaces_Spec_Properties_SharedPrivateLinkResources_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Workspaces_Spec_Properties_SharedPrivateLinkResources via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResources, WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResources runs a test to see if a specific instance of Workspaces_Spec_Properties_SharedPrivateLinkResources round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesSpecPropertiesSharedPrivateLinkResources(subject Workspaces_Spec_Properties_SharedPrivateLinkResources) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Workspaces_Spec_Properties_SharedPrivateLinkResources + 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 Workspaces_Spec_Properties_SharedPrivateLinkResources instances for property testing - lazily +// instantiated by WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator() +var workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator gopter.Gen + +// WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator returns a generator of Workspaces_Spec_Properties_SharedPrivateLinkResources instances for property testing. +func WorkspacesSpecPropertiesSharedPrivateLinkResourcesGenerator() gopter.Gen { + if workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator != nil { + return workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResources(generators) + workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator = gen.Struct(reflect.TypeOf(Workspaces_Spec_Properties_SharedPrivateLinkResources{}), generators) + + return workspacesSpecPropertiesSharedPrivateLinkResourcesGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResources is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesSpecPropertiesSharedPrivateLinkResources(gens map[string]gopter.Gen) { + gens["GroupId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequestMessage"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CosmosDbSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CosmosDbSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCosmosDbSettings, CosmosDbSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCosmosDbSettings runs a test to see if a specific instance of CosmosDbSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForCosmosDbSettings(subject CosmosDbSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CosmosDbSettings + 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 CosmosDbSettings instances for property testing - lazily instantiated by CosmosDbSettingsGenerator() +var cosmosDbSettingsGenerator gopter.Gen + +// CosmosDbSettingsGenerator returns a generator of CosmosDbSettings instances for property testing. +func CosmosDbSettingsGenerator() gopter.Gen { + if cosmosDbSettingsGenerator != nil { + return cosmosDbSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCosmosDbSettings(generators) + cosmosDbSettingsGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings{}), generators) + + return cosmosDbSettingsGenerator +} + +// AddIndependentPropertyGeneratorsForCosmosDbSettings is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCosmosDbSettings(gens map[string]gopter.Gen) { + gens["CollectionsThroughput"] = gen.PtrOf(gen.Int()) +} + +func Test_CosmosDbSettings_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CosmosDbSettings_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCosmosDbSettingsStatus, CosmosDbSettingsStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCosmosDbSettingsStatus runs a test to see if a specific instance of CosmosDbSettings_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForCosmosDbSettingsStatus(subject CosmosDbSettings_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CosmosDbSettings_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 CosmosDbSettings_Status instances for property testing - lazily instantiated by +// CosmosDbSettingsStatusGenerator() +var cosmosDbSettingsStatusGenerator gopter.Gen + +// CosmosDbSettingsStatusGenerator returns a generator of CosmosDbSettings_Status instances for property testing. +func CosmosDbSettingsStatusGenerator() gopter.Gen { + if cosmosDbSettingsStatusGenerator != nil { + return cosmosDbSettingsStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCosmosDbSettingsStatus(generators) + cosmosDbSettingsStatusGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings_Status{}), generators) + + return cosmosDbSettingsStatusGenerator +} + +// AddIndependentPropertyGeneratorsForCosmosDbSettingsStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCosmosDbSettingsStatus(gens map[string]gopter.Gen) { + gens["CollectionsThroughput"] = gen.PtrOf(gen.Int()) +} + +func Test_IdentityForCmk_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of IdentityForCmk via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityForCmk, IdentityForCmkGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityForCmk runs a test to see if a specific instance of IdentityForCmk round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityForCmk(subject IdentityForCmk) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual IdentityForCmk + 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 IdentityForCmk instances for property testing - lazily instantiated by IdentityForCmkGenerator() +var identityForCmkGenerator gopter.Gen + +// IdentityForCmkGenerator returns a generator of IdentityForCmk instances for property testing. +func IdentityForCmkGenerator() gopter.Gen { + if identityForCmkGenerator != nil { + return identityForCmkGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityForCmk(generators) + identityForCmkGenerator = gen.Struct(reflect.TypeOf(IdentityForCmk{}), generators) + + return identityForCmkGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityForCmk is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityForCmk(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_IdentityForCmk_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of IdentityForCmk_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentityForCmkStatus, IdentityForCmkStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentityForCmkStatus runs a test to see if a specific instance of IdentityForCmk_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentityForCmkStatus(subject IdentityForCmk_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual IdentityForCmk_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 IdentityForCmk_Status instances for property testing - lazily instantiated by +// IdentityForCmkStatusGenerator() +var identityForCmkStatusGenerator gopter.Gen + +// IdentityForCmkStatusGenerator returns a generator of IdentityForCmk_Status instances for property testing. +func IdentityForCmkStatusGenerator() gopter.Gen { + if identityForCmkStatusGenerator != nil { + return identityForCmkStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentityForCmkStatus(generators) + identityForCmkStatusGenerator = gen.Struct(reflect.TypeOf(IdentityForCmk_Status{}), generators) + + return identityForCmkStatusGenerator +} + +// AddIndependentPropertyGeneratorsForIdentityForCmkStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentityForCmkStatus(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultProperties, KeyVaultPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultProperties runs a test to see if a specific instance of KeyVaultProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultProperties(subject KeyVaultProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties + 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 KeyVaultProperties instances for property testing - lazily instantiated by KeyVaultPropertiesGenerator() +var keyVaultPropertiesGenerator gopter.Gen + +// KeyVaultPropertiesGenerator returns a generator of KeyVaultProperties instances for property testing. +func KeyVaultPropertiesGenerator() gopter.Gen { + if keyVaultPropertiesGenerator != nil { + return keyVaultPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) + + return keyVaultPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { + gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString()) + gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultProperties_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultPropertiesStatus, KeyVaultPropertiesStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultPropertiesStatus runs a test to see if a specific instance of KeyVaultProperties_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultPropertiesStatus(subject KeyVaultProperties_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties_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 KeyVaultProperties_Status instances for property testing - lazily instantiated by +// KeyVaultPropertiesStatusGenerator() +var keyVaultPropertiesStatusGenerator gopter.Gen + +// KeyVaultPropertiesStatusGenerator returns a generator of KeyVaultProperties_Status instances for property testing. +func KeyVaultPropertiesStatusGenerator() gopter.Gen { + if keyVaultPropertiesStatusGenerator != nil { + return keyVaultPropertiesStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatus(generators) + keyVaultPropertiesStatusGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_Status{}), generators) + + return keyVaultPropertiesStatusGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultPropertiesStatus(gens map[string]gopter.Gen) { + gens["IdentityClientId"] = gen.PtrOf(gen.AlphaString()) + gens["KeyIdentifier"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultArmId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_NotebookPreparationError_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NotebookPreparationError_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNotebookPreparationErrorStatus, NotebookPreparationErrorStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNotebookPreparationErrorStatus runs a test to see if a specific instance of NotebookPreparationError_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForNotebookPreparationErrorStatus(subject NotebookPreparationError_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NotebookPreparationError_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 NotebookPreparationError_Status instances for property testing - lazily instantiated by +// NotebookPreparationErrorStatusGenerator() +var notebookPreparationErrorStatusGenerator gopter.Gen + +// NotebookPreparationErrorStatusGenerator returns a generator of NotebookPreparationError_Status instances for property testing. +func NotebookPreparationErrorStatusGenerator() gopter.Gen { + if notebookPreparationErrorStatusGenerator != nil { + return notebookPreparationErrorStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatus(generators) + notebookPreparationErrorStatusGenerator = gen.Struct(reflect.TypeOf(NotebookPreparationError_Status{}), generators) + + return notebookPreparationErrorStatusGenerator +} + +// AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNotebookPreparationErrorStatus(gens map[string]gopter.Gen) { + gens["ErrorMessage"] = gen.PtrOf(gen.AlphaString()) + gens["StatusCode"] = gen.PtrOf(gen.Int()) +} + +func Test_UserAssignedIdentity_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentity_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityStatus, UserAssignedIdentityStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityStatus runs a test to see if a specific instance of UserAssignedIdentity_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityStatus(subject UserAssignedIdentity_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentity_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 UserAssignedIdentity_Status instances for property testing - lazily instantiated by +// UserAssignedIdentityStatusGenerator() +var userAssignedIdentityStatusGenerator gopter.Gen + +// UserAssignedIdentityStatusGenerator returns a generator of UserAssignedIdentity_Status instances for property testing. +func UserAssignedIdentityStatusGenerator() gopter.Gen { + if userAssignedIdentityStatusGenerator != nil { + return userAssignedIdentityStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentityStatus(generators) + userAssignedIdentityStatusGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_Status{}), generators) + + return userAssignedIdentityStatusGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityStatus(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + 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 +} diff --git a/v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen.go b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen.go new file mode 100644 index 0000000000..c8a6471e36 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen.go @@ -0,0 +1,620 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources=workspacescomputes,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources={workspacescomputes/status,workspacescomputes/finalizers},verbs=get;update;patch + +// +kubebuilder:object:root=true +// +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 v1beta20210701.WorkspacesCompute +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_computes +type WorkspacesCompute struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec WorkspacesComputes_Spec `json:"spec,omitempty"` + Status ComputeResource_Status `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &WorkspacesCompute{} + +// GetConditions returns the conditions of the resource +func (compute *WorkspacesCompute) GetConditions() conditions.Conditions { + return compute.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (compute *WorkspacesCompute) SetConditions(conditions conditions.Conditions) { + compute.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &WorkspacesCompute{} + +// AzureName returns the Azure name of the resource +func (compute *WorkspacesCompute) AzureName() string { + return compute.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01" +func (compute WorkspacesCompute) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetResourceKind returns the kind of the resource +func (compute *WorkspacesCompute) GetResourceKind() genruntime.ResourceKind { + return genruntime.ResourceKindNormal +} + +// GetSpec returns the specification of this resource +func (compute *WorkspacesCompute) GetSpec() genruntime.ConvertibleSpec { + return &compute.Spec +} + +// GetStatus returns the status of this resource +func (compute *WorkspacesCompute) GetStatus() genruntime.ConvertibleStatus { + return &compute.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/computes" +func (compute *WorkspacesCompute) GetType() string { + return "Microsoft.MachineLearningServices/workspaces/computes" +} + +// NewEmptyStatus returns a new empty (blank) status +func (compute *WorkspacesCompute) NewEmptyStatus() genruntime.ConvertibleStatus { + return &ComputeResource_Status{} +} + +// Owner returns the ResourceReference of the owner, or nil if there is no owner +func (compute *WorkspacesCompute) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(compute.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: compute.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (compute *WorkspacesCompute) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*ComputeResource_Status); ok { + compute.Status = *st + return nil + } + + // Convert status to required version + var st ComputeResource_Status + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + compute.Status = st + return nil +} + +// Hub marks that this WorkspacesCompute is the hub type for conversion +func (compute *WorkspacesCompute) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (compute *WorkspacesCompute) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: compute.Spec.OriginalVersion, + Kind: "WorkspacesCompute", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1beta20210701.WorkspacesCompute +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_computes +type WorkspacesComputeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []WorkspacesCompute `json:"items"` +} + +// Storage version of v1beta20210701.ComputeResource_Status +type ComputeResource_Status struct { + Conditions []conditions.Condition `json:"conditions,omitempty"` + Id *string `json:"id,omitempty"` + Identity *Identity_Status `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *Compute_Status `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Sku *Sku_Status `json:"sku,omitempty"` + SystemData *SystemData_Status `json:"systemData,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &ComputeResource_Status{} + +// ConvertStatusFrom populates our ComputeResource_Status from the provided source +func (resource *ComputeResource_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == resource { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(resource) +} + +// ConvertStatusTo populates the provided destination from our ComputeResource_Status +func (resource *ComputeResource_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == resource { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(resource) +} + +// Storage version of v1beta20210701.WorkspacesComputes_Spec +type WorkspacesComputes_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"` + Identity *Identity `json:"identity,omitempty"` + Location *string `json:"location,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 machinelearningservices.azure.com/Workspace resource + Owner *genruntime.KnownResourceReference `group:"machinelearningservices.azure.com" json:"owner,omitempty" kind:"Workspace"` + Properties *Compute `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Sku *Sku `json:"sku,omitempty"` + SystemData *SystemData `json:"systemData,omitempty"` + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &WorkspacesComputes_Spec{} + +// ConvertSpecFrom populates our WorkspacesComputes_Spec from the provided source +func (computes *WorkspacesComputes_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == computes { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(computes) +} + +// ConvertSpecTo populates the provided destination from our WorkspacesComputes_Spec +func (computes *WorkspacesComputes_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == computes { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(computes) +} + +// Storage version of v1beta20210701.Compute +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/Compute +type Compute struct { + AKS *Compute_AKS `json:"aks,omitempty"` + AmlCompute *Compute_AmlCompute `json:"amlCompute,omitempty"` + ComputeInstance *Compute_ComputeInstance `json:"computeInstance,omitempty"` + DataFactory *Compute_DataFactory `json:"dataFactory,omitempty"` + DataLakeAnalytics *Compute_DataLakeAnalytics `json:"dataLakeAnalytics,omitempty"` + Databricks *Compute_Databricks `json:"databricks,omitempty"` + HDInsight *Compute_HDInsight `json:"hdInsight,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SynapseSpark *Compute_SynapseSpark `json:"synapseSpark,omitempty"` + VirtualMachine *Compute_VirtualMachine `json:"virtualMachine,omitempty"` +} + +// Storage version of v1beta20210701.Compute_Status +type Compute_Status struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ProvisioningErrors []ErrorResponse_Status `json:"provisioningErrors,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +// Storage version of v1beta20210701.Compute_AKS +type Compute_AKS struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *AKSProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_AmlCompute +type Compute_AmlCompute struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *AmlComputeProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_ComputeInstance +type Compute_ComputeInstance struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *ComputeInstanceProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_DataFactory +type Compute_DataFactory struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_DataLakeAnalytics +type Compute_DataLakeAnalytics struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_Databricks +type Compute_Databricks struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *DatabricksProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_HDInsight +type Compute_HDInsight struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *HDInsightProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_SynapseSpark +type Compute_SynapseSpark struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *SynapseSparkProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.Compute_VirtualMachine +type Compute_VirtualMachine struct { + ComputeLocation *string `json:"computeLocation,omitempty"` + ComputeType *string `json:"computeType,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Properties *VirtualMachineProperties `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // ResourceReference: ARM resource id of the underlying compute + ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"` +} + +// Storage version of v1beta20210701.ErrorResponse_Status +type ErrorResponse_Status struct { + Error *ErrorDetail_Status `json:"error,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.AKSProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AKSProperties +type AKSProperties struct { + AgentCount *int `json:"agentCount,omitempty"` + AgentVmSize *string `json:"agentVmSize,omitempty"` + AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` + ClusterFqdn *string `json:"clusterFqdn,omitempty"` + ClusterPurpose *string `json:"clusterPurpose,omitempty"` + LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"` + LoadBalancerType *string `json:"loadBalancerType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` +} + +// Storage version of v1beta20210701.AmlComputeProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AmlComputeProperties +type AmlComputeProperties struct { + EnableNodePublicIp *bool `json:"enableNodePublicIp,omitempty"` + IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"` + OsType *string `json:"osType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RemoteLoginPortPublicAccess *string `json:"remoteLoginPortPublicAccess,omitempty"` + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + Subnet *ResourceId `json:"subnet,omitempty"` + UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` + VirtualMachineImage *VirtualMachineImage `json:"virtualMachineImage,omitempty"` + VmPriority *string `json:"vmPriority,omitempty"` + VmSize *string `json:"vmSize,omitempty"` +} + +// Storage version of v1beta20210701.ComputeInstanceProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceProperties +type ComputeInstanceProperties struct { + ApplicationSharingPolicy *string `json:"applicationSharingPolicy,omitempty"` + ComputeInstanceAuthorizationType *string `json:"computeInstanceAuthorizationType,omitempty"` + PersonalComputeInstanceSettings *PersonalComputeInstanceSettings `json:"personalComputeInstanceSettings,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SetupScripts *SetupScripts `json:"setupScripts,omitempty"` + SshSettings *ComputeInstanceSshSettings `json:"sshSettings,omitempty"` + Subnet *ResourceId `json:"subnet,omitempty"` + VmSize *string `json:"vmSize,omitempty"` +} + +// Storage version of v1beta20210701.DataLakeAnalyticsProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DataLakeAnalyticsProperties +type DataLakeAnalyticsProperties struct { + DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.DatabricksProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/DatabricksProperties +type DatabricksProperties struct { + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + WorkspaceUrl *string `json:"workspaceUrl,omitempty"` +} + +// Storage version of v1beta20210701.ErrorDetail_Status +type ErrorDetail_Status struct { + AdditionalInfo []ErrorAdditionalInfo_Status `json:"additionalInfo,omitempty"` + Code *string `json:"code,omitempty"` + Details []ErrorDetail_Status_Unrolled `json:"details,omitempty"` + Message *string `json:"message,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Target *string `json:"target,omitempty"` +} + +// Storage version of v1beta20210701.HDInsightProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/HDInsightProperties +type HDInsightProperties struct { + Address *string `json:"address,omitempty"` + AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SshPort *int `json:"sshPort,omitempty"` +} + +// Storage version of v1beta20210701.SynapseSparkProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SynapseSparkProperties +type SynapseSparkProperties struct { + AutoPauseProperties *AutoPauseProperties `json:"autoPauseProperties,omitempty"` + AutoScaleProperties *AutoScaleProperties `json:"autoScaleProperties,omitempty"` + NodeCount *int `json:"nodeCount,omitempty"` + NodeSize *string `json:"nodeSize,omitempty"` + NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"` + PoolName *string `json:"poolName,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ResourceGroup *string `json:"resourceGroup,omitempty"` + SparkVersion *string `json:"sparkVersion,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` + WorkspaceName *string `json:"workspaceName,omitempty"` +} + +// Storage version of v1beta20210701.VirtualMachineProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineProperties +type VirtualMachineProperties struct { + Address *string `json:"address,omitempty"` + AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"` + IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SshPort *int `json:"sshPort,omitempty"` + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` +} + +// Storage version of v1beta20210701.AksNetworkingConfiguration +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AksNetworkingConfiguration +type AksNetworkingConfiguration struct { + DnsServiceIP *string `json:"dnsServiceIP,omitempty"` + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ServiceCidr *string `json:"serviceCidr,omitempty"` + + // SubnetReference: Virtual network subnet resource ID the compute nodes belong to + SubnetReference *genruntime.ResourceReference `armReference:"SubnetId" json:"subnetReference,omitempty"` +} + +// Storage version of v1beta20210701.AutoPauseProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoPauseProperties +type AutoPauseProperties struct { + DelayInMinutes *int `json:"delayInMinutes,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.AutoScaleProperties +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AutoScaleProperties +type AutoScaleProperties struct { + Enabled *bool `json:"enabled,omitempty"` + MaxNodeCount *int `json:"maxNodeCount,omitempty"` + MinNodeCount *int `json:"minNodeCount,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.ComputeInstanceSshSettings +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ComputeInstanceSshSettings +type ComputeInstanceSshSettings struct { + AdminPublicKey *string `json:"adminPublicKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SshPublicAccess *string `json:"sshPublicAccess,omitempty"` +} + +// Storage version of v1beta20210701.ErrorAdditionalInfo_Status +type ErrorAdditionalInfo_Status struct { + Info map[string]v1.JSON `json:"info,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` +} + +// Storage version of v1beta20210701.ErrorDetail_Status_Unrolled +type ErrorDetail_Status_Unrolled struct { + AdditionalInfo []ErrorAdditionalInfo_Status `json:"additionalInfo,omitempty"` + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Target *string `json:"target,omitempty"` +} + +// Storage version of v1beta20210701.PersonalComputeInstanceSettings +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/PersonalComputeInstanceSettings +type PersonalComputeInstanceSettings struct { + AssignedUser *AssignedUser `json:"assignedUser,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.ResourceId +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ResourceId +type ResourceId struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // +kubebuilder:validation:Required + // Reference: The ID of the resource + Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"` +} + +// Storage version of v1beta20210701.ScaleSettings +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScaleSettings +type ScaleSettings struct { + MaxNodeCount *int `json:"maxNodeCount,omitempty"` + MinNodeCount *int `json:"minNodeCount,omitempty"` + NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.SetupScripts +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SetupScripts +type SetupScripts struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Scripts *ScriptsToExecute `json:"scripts,omitempty"` +} + +// Storage version of v1beta20210701.SslConfiguration +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/SslConfiguration +type SslConfiguration struct { + Cert *string `json:"cert,omitempty"` + Cname *string `json:"cname,omitempty"` + Key *string `json:"key,omitempty"` + LeafDomainLabel *string `json:"leafDomainLabel,omitempty"` + OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Status *string `json:"status,omitempty"` +} + +// Storage version of v1beta20210701.UserAccountCredentials +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/UserAccountCredentials +type UserAccountCredentials struct { + AdminUserName *string `json:"adminUserName,omitempty"` + AdminUserPassword *genruntime.SecretReference `json:"adminUserPassword,omitempty"` + AdminUserSshPublicKey *genruntime.SecretReference `json:"adminUserSshPublicKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1beta20210701.VirtualMachineImage +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineImage +type VirtualMachineImage struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // +kubebuilder:validation:Required + // Reference: Virtual Machine image path + Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"` +} + +// Storage version of v1beta20210701.VirtualMachineSshCredentials +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/VirtualMachineSshCredentials +type VirtualMachineSshCredentials struct { + Password *genruntime.SecretReference `json:"password,omitempty"` + PrivateKeyData *string `json:"privateKeyData,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + PublicKeyData *string `json:"publicKeyData,omitempty"` + Username *string `json:"username,omitempty"` +} + +// Storage version of v1beta20210701.AssignedUser +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/AssignedUser +type AssignedUser struct { + ObjectId *string `json:"objectId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + TenantId *string `json:"tenantId,omitempty"` +} + +// Storage version of v1beta20210701.ScriptsToExecute +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptsToExecute +type ScriptsToExecute struct { + CreationScript *ScriptReference `json:"creationScript,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + StartupScript *ScriptReference `json:"startupScript,omitempty"` +} + +// Storage version of v1beta20210701.ScriptReference +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/definitions/ScriptReference +type ScriptReference struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ScriptArguments *string `json:"scriptArguments,omitempty"` + ScriptData *string `json:"scriptData,omitempty"` + ScriptSource *string `json:"scriptSource,omitempty"` + Timeout *string `json:"timeout,omitempty"` +} + +func init() { + SchemeBuilder.Register(&WorkspacesCompute{}, &WorkspacesComputeList{}) +} diff --git a/v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen_test.go new file mode 100644 index 0000000000..5214cfe0bc --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_compute_types_gen_test.go @@ -0,0 +1,2855 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701storage + +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_WorkspacesCompute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesCompute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesCompute, WorkspacesComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesCompute runs a test to see if a specific instance of WorkspacesCompute round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesCompute(subject WorkspacesCompute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesCompute + 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 WorkspacesCompute instances for property testing - lazily instantiated by WorkspacesComputeGenerator() +var workspacesComputeGenerator gopter.Gen + +// WorkspacesComputeGenerator returns a generator of WorkspacesCompute instances for property testing. +func WorkspacesComputeGenerator() gopter.Gen { + if workspacesComputeGenerator != nil { + return workspacesComputeGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspacesCompute(generators) + workspacesComputeGenerator = gen.Struct(reflect.TypeOf(WorkspacesCompute{}), generators) + + return workspacesComputeGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspacesCompute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesCompute(gens map[string]gopter.Gen) { + gens["Spec"] = WorkspacesComputesSpecGenerator() + gens["Status"] = ComputeResourceStatusGenerator() +} + +func Test_ComputeResource_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeResource_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeResourceStatus, ComputeResourceStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeResourceStatus runs a test to see if a specific instance of ComputeResource_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeResourceStatus(subject ComputeResource_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeResource_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 ComputeResource_Status instances for property testing - lazily instantiated by +// ComputeResourceStatusGenerator() +var computeResourceStatusGenerator gopter.Gen + +// ComputeResourceStatusGenerator returns a generator of ComputeResource_Status instances for property testing. +// We first initialize computeResourceStatusGenerator 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 ComputeResourceStatusGenerator() gopter.Gen { + if computeResourceStatusGenerator != nil { + return computeResourceStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeResourceStatus(generators) + computeResourceStatusGenerator = gen.Struct(reflect.TypeOf(ComputeResource_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeResourceStatus(generators) + AddRelatedPropertyGeneratorsForComputeResourceStatus(generators) + computeResourceStatusGenerator = gen.Struct(reflect.TypeOf(ComputeResource_Status{}), generators) + + return computeResourceStatusGenerator +} + +// AddIndependentPropertyGeneratorsForComputeResourceStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeResourceStatus(gens map[string]gopter.Gen) { + 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()) +} + +// AddRelatedPropertyGeneratorsForComputeResourceStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeResourceStatus(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityStatusGenerator()) + gens["Properties"] = gen.PtrOf(ComputeStatusGenerator()) + gens["Sku"] = gen.PtrOf(SkuStatusGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataStatusGenerator()) +} + +func Test_WorkspacesComputes_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesComputes_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesComputesSpec, WorkspacesComputesSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesComputesSpec runs a test to see if a specific instance of WorkspacesComputes_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesComputesSpec(subject WorkspacesComputes_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesComputes_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 WorkspacesComputes_Spec instances for property testing - lazily instantiated by +// WorkspacesComputesSpecGenerator() +var workspacesComputesSpecGenerator gopter.Gen + +// WorkspacesComputesSpecGenerator returns a generator of WorkspacesComputes_Spec instances for property testing. +// We first initialize workspacesComputesSpecGenerator 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 WorkspacesComputesSpecGenerator() gopter.Gen { + if workspacesComputesSpecGenerator != nil { + return workspacesComputesSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesComputesSpec(generators) + workspacesComputesSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesComputes_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesComputesSpec(generators) + AddRelatedPropertyGeneratorsForWorkspacesComputesSpec(generators) + workspacesComputesSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesComputes_Spec{}), generators) + + return workspacesComputesSpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesComputesSpec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesComputesSpec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForWorkspacesComputesSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesComputesSpec(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["Properties"] = gen.PtrOf(ComputeGenerator()) + gens["Sku"] = gen.PtrOf(SkuGenerator()) + gens["SystemData"] = gen.PtrOf(SystemDataGenerator()) +} + +func Test_Compute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCompute, ComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCompute runs a test to see if a specific instance of Compute round trips to JSON and back losslessly +func RunJSONSerializationTestForCompute(subject Compute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute + 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 Compute instances for property testing - lazily instantiated by ComputeGenerator() +var computeGenerator gopter.Gen + +// ComputeGenerator returns a generator of Compute instances for property testing. +func ComputeGenerator() gopter.Gen { + if computeGenerator != nil { + return computeGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForCompute(generators) + + // handle OneOf by choosing only one field to instantiate + var gens []gopter.Gen + for propName, propGen := range generators { + gens = append(gens, gen.Struct(reflect.TypeOf(Compute{}), map[string]gopter.Gen{ + propName: propGen, + })) + } + computeGenerator = gen.OneGenOf(gens...) + + return computeGenerator +} + +// AddRelatedPropertyGeneratorsForCompute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCompute(gens map[string]gopter.Gen) { + gens["AKS"] = ComputeAKSGenerator().Map(func(it Compute_AKS) *Compute_AKS { + return &it + }) // generate one case for OneOf type + gens["AmlCompute"] = ComputeAmlComputeGenerator().Map(func(it Compute_AmlCompute) *Compute_AmlCompute { + return &it + }) // generate one case for OneOf type + gens["ComputeInstance"] = ComputeComputeInstanceGenerator().Map(func(it Compute_ComputeInstance) *Compute_ComputeInstance { + return &it + }) // generate one case for OneOf type + gens["DataFactory"] = ComputeDataFactoryGenerator().Map(func(it Compute_DataFactory) *Compute_DataFactory { + return &it + }) // generate one case for OneOf type + gens["DataLakeAnalytics"] = ComputeDataLakeAnalyticsGenerator().Map(func(it Compute_DataLakeAnalytics) *Compute_DataLakeAnalytics { + return &it + }) // generate one case for OneOf type + gens["Databricks"] = ComputeDatabricksGenerator().Map(func(it Compute_Databricks) *Compute_Databricks { + return &it + }) // generate one case for OneOf type + gens["HDInsight"] = ComputeHDInsightGenerator().Map(func(it Compute_HDInsight) *Compute_HDInsight { + return &it + }) // generate one case for OneOf type + gens["SynapseSpark"] = ComputeSynapseSparkGenerator().Map(func(it Compute_SynapseSpark) *Compute_SynapseSpark { + return &it + }) // generate one case for OneOf type + gens["VirtualMachine"] = ComputeVirtualMachineGenerator().Map(func(it Compute_VirtualMachine) *Compute_VirtualMachine { + return &it + }) // generate one case for OneOf type +} + +func Test_Compute_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeStatus, ComputeStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeStatus runs a test to see if a specific instance of Compute_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeStatus(subject Compute_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_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 Compute_Status instances for property testing - lazily instantiated by ComputeStatusGenerator() +var computeStatusGenerator gopter.Gen + +// ComputeStatusGenerator returns a generator of Compute_Status instances for property testing. +// We first initialize computeStatusGenerator 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 ComputeStatusGenerator() gopter.Gen { + if computeStatusGenerator != nil { + return computeStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeStatus(generators) + computeStatusGenerator = gen.Struct(reflect.TypeOf(Compute_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeStatus(generators) + AddRelatedPropertyGeneratorsForComputeStatus(generators) + computeStatusGenerator = gen.Struct(reflect.TypeOf(Compute_Status{}), generators) + + return computeStatusGenerator +} + +// AddIndependentPropertyGeneratorsForComputeStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeStatus(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedOn"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["IsAttachedCompute"] = gen.PtrOf(gen.Bool()) + gens["ModifiedOn"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeStatus(gens map[string]gopter.Gen) { + gens["ProvisioningErrors"] = gen.SliceOf(ErrorResponseStatusGenerator()) +} + +func Test_Compute_AKS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_AKS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeAKS, ComputeAKSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeAKS runs a test to see if a specific instance of Compute_AKS round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeAKS(subject Compute_AKS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_AKS + 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 Compute_AKS instances for property testing - lazily instantiated by ComputeAKSGenerator() +var computeAKSGenerator gopter.Gen + +// ComputeAKSGenerator returns a generator of Compute_AKS instances for property testing. +// We first initialize computeAKSGenerator 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 ComputeAKSGenerator() gopter.Gen { + if computeAKSGenerator != nil { + return computeAKSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAKS(generators) + computeAKSGenerator = gen.Struct(reflect.TypeOf(Compute_AKS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAKS(generators) + AddRelatedPropertyGeneratorsForComputeAKS(generators) + computeAKSGenerator = gen.Struct(reflect.TypeOf(Compute_AKS{}), generators) + + return computeAKSGenerator +} + +// AddIndependentPropertyGeneratorsForComputeAKS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeAKS(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeAKS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeAKS(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(AKSPropertiesGenerator()) +} + +func Test_Compute_AmlCompute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_AmlCompute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeAmlCompute, ComputeAmlComputeGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeAmlCompute runs a test to see if a specific instance of Compute_AmlCompute round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeAmlCompute(subject Compute_AmlCompute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_AmlCompute + 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 Compute_AmlCompute instances for property testing - lazily instantiated by ComputeAmlComputeGenerator() +var computeAmlComputeGenerator gopter.Gen + +// ComputeAmlComputeGenerator returns a generator of Compute_AmlCompute instances for property testing. +// We first initialize computeAmlComputeGenerator 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 ComputeAmlComputeGenerator() gopter.Gen { + if computeAmlComputeGenerator != nil { + return computeAmlComputeGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAmlCompute(generators) + computeAmlComputeGenerator = gen.Struct(reflect.TypeOf(Compute_AmlCompute{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeAmlCompute(generators) + AddRelatedPropertyGeneratorsForComputeAmlCompute(generators) + computeAmlComputeGenerator = gen.Struct(reflect.TypeOf(Compute_AmlCompute{}), generators) + + return computeAmlComputeGenerator +} + +// AddIndependentPropertyGeneratorsForComputeAmlCompute is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeAmlCompute(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeAmlCompute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeAmlCompute(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(AmlComputePropertiesGenerator()) +} + +func Test_Compute_ComputeInstance_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_ComputeInstance via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeComputeInstance, ComputeComputeInstanceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeComputeInstance runs a test to see if a specific instance of Compute_ComputeInstance round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeComputeInstance(subject Compute_ComputeInstance) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_ComputeInstance + 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 Compute_ComputeInstance instances for property testing - lazily instantiated by +// ComputeComputeInstanceGenerator() +var computeComputeInstanceGenerator gopter.Gen + +// ComputeComputeInstanceGenerator returns a generator of Compute_ComputeInstance instances for property testing. +// We first initialize computeComputeInstanceGenerator 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 ComputeComputeInstanceGenerator() gopter.Gen { + if computeComputeInstanceGenerator != nil { + return computeComputeInstanceGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeComputeInstance(generators) + computeComputeInstanceGenerator = gen.Struct(reflect.TypeOf(Compute_ComputeInstance{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeComputeInstance(generators) + AddRelatedPropertyGeneratorsForComputeComputeInstance(generators) + computeComputeInstanceGenerator = gen.Struct(reflect.TypeOf(Compute_ComputeInstance{}), generators) + + return computeComputeInstanceGenerator +} + +// AddIndependentPropertyGeneratorsForComputeComputeInstance is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeComputeInstance(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeComputeInstance is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeComputeInstance(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(ComputeInstancePropertiesGenerator()) +} + +func Test_Compute_DataFactory_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_DataFactory via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDataFactory, ComputeDataFactoryGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDataFactory runs a test to see if a specific instance of Compute_DataFactory round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDataFactory(subject Compute_DataFactory) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_DataFactory + 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 Compute_DataFactory instances for property testing - lazily instantiated by ComputeDataFactoryGenerator() +var computeDataFactoryGenerator gopter.Gen + +// ComputeDataFactoryGenerator returns a generator of Compute_DataFactory instances for property testing. +func ComputeDataFactoryGenerator() gopter.Gen { + if computeDataFactoryGenerator != nil { + return computeDataFactoryGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataFactory(generators) + computeDataFactoryGenerator = gen.Struct(reflect.TypeOf(Compute_DataFactory{}), generators) + + return computeDataFactoryGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDataFactory is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDataFactory(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +func Test_Compute_DataLakeAnalytics_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_DataLakeAnalytics via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDataLakeAnalytics, ComputeDataLakeAnalyticsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDataLakeAnalytics runs a test to see if a specific instance of Compute_DataLakeAnalytics round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDataLakeAnalytics(subject Compute_DataLakeAnalytics) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_DataLakeAnalytics + 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 Compute_DataLakeAnalytics instances for property testing - lazily instantiated by +// ComputeDataLakeAnalyticsGenerator() +var computeDataLakeAnalyticsGenerator gopter.Gen + +// ComputeDataLakeAnalyticsGenerator returns a generator of Compute_DataLakeAnalytics instances for property testing. +// We first initialize computeDataLakeAnalyticsGenerator 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 ComputeDataLakeAnalyticsGenerator() gopter.Gen { + if computeDataLakeAnalyticsGenerator != nil { + return computeDataLakeAnalyticsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics(generators) + computeDataLakeAnalyticsGenerator = gen.Struct(reflect.TypeOf(Compute_DataLakeAnalytics{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics(generators) + AddRelatedPropertyGeneratorsForComputeDataLakeAnalytics(generators) + computeDataLakeAnalyticsGenerator = gen.Struct(reflect.TypeOf(Compute_DataLakeAnalytics{}), generators) + + return computeDataLakeAnalyticsGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDataLakeAnalytics(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeDataLakeAnalytics is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeDataLakeAnalytics(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(DataLakeAnalyticsPropertiesGenerator()) +} + +func Test_Compute_Databricks_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_Databricks via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeDatabricks, ComputeDatabricksGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeDatabricks runs a test to see if a specific instance of Compute_Databricks round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeDatabricks(subject Compute_Databricks) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_Databricks + 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 Compute_Databricks instances for property testing - lazily instantiated by ComputeDatabricksGenerator() +var computeDatabricksGenerator gopter.Gen + +// ComputeDatabricksGenerator returns a generator of Compute_Databricks instances for property testing. +// We first initialize computeDatabricksGenerator 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 ComputeDatabricksGenerator() gopter.Gen { + if computeDatabricksGenerator != nil { + return computeDatabricksGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDatabricks(generators) + computeDatabricksGenerator = gen.Struct(reflect.TypeOf(Compute_Databricks{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeDatabricks(generators) + AddRelatedPropertyGeneratorsForComputeDatabricks(generators) + computeDatabricksGenerator = gen.Struct(reflect.TypeOf(Compute_Databricks{}), generators) + + return computeDatabricksGenerator +} + +// AddIndependentPropertyGeneratorsForComputeDatabricks is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeDatabricks(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeDatabricks is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeDatabricks(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(DatabricksPropertiesGenerator()) +} + +func Test_Compute_HDInsight_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_HDInsight via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeHDInsight, ComputeHDInsightGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeHDInsight runs a test to see if a specific instance of Compute_HDInsight round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeHDInsight(subject Compute_HDInsight) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_HDInsight + 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 Compute_HDInsight instances for property testing - lazily instantiated by ComputeHDInsightGenerator() +var computeHDInsightGenerator gopter.Gen + +// ComputeHDInsightGenerator returns a generator of Compute_HDInsight instances for property testing. +// We first initialize computeHDInsightGenerator 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 ComputeHDInsightGenerator() gopter.Gen { + if computeHDInsightGenerator != nil { + return computeHDInsightGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeHDInsight(generators) + computeHDInsightGenerator = gen.Struct(reflect.TypeOf(Compute_HDInsight{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeHDInsight(generators) + AddRelatedPropertyGeneratorsForComputeHDInsight(generators) + computeHDInsightGenerator = gen.Struct(reflect.TypeOf(Compute_HDInsight{}), generators) + + return computeHDInsightGenerator +} + +// AddIndependentPropertyGeneratorsForComputeHDInsight is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeHDInsight(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeHDInsight is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeHDInsight(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(HDInsightPropertiesGenerator()) +} + +func Test_Compute_SynapseSpark_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_SynapseSpark via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeSynapseSpark, ComputeSynapseSparkGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeSynapseSpark runs a test to see if a specific instance of Compute_SynapseSpark round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeSynapseSpark(subject Compute_SynapseSpark) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_SynapseSpark + 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 Compute_SynapseSpark instances for property testing - lazily instantiated by +// ComputeSynapseSparkGenerator() +var computeSynapseSparkGenerator gopter.Gen + +// ComputeSynapseSparkGenerator returns a generator of Compute_SynapseSpark instances for property testing. +// We first initialize computeSynapseSparkGenerator 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 ComputeSynapseSparkGenerator() gopter.Gen { + if computeSynapseSparkGenerator != nil { + return computeSynapseSparkGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeSynapseSpark(generators) + computeSynapseSparkGenerator = gen.Struct(reflect.TypeOf(Compute_SynapseSpark{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeSynapseSpark(generators) + AddRelatedPropertyGeneratorsForComputeSynapseSpark(generators) + computeSynapseSparkGenerator = gen.Struct(reflect.TypeOf(Compute_SynapseSpark{}), generators) + + return computeSynapseSparkGenerator +} + +// AddIndependentPropertyGeneratorsForComputeSynapseSpark is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeSynapseSpark(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeSynapseSpark is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeSynapseSpark(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SynapseSparkPropertiesGenerator()) +} + +func Test_Compute_VirtualMachine_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Compute_VirtualMachine via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeVirtualMachine, ComputeVirtualMachineGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeVirtualMachine runs a test to see if a specific instance of Compute_VirtualMachine round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeVirtualMachine(subject Compute_VirtualMachine) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Compute_VirtualMachine + 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 Compute_VirtualMachine instances for property testing - lazily instantiated by +// ComputeVirtualMachineGenerator() +var computeVirtualMachineGenerator gopter.Gen + +// ComputeVirtualMachineGenerator returns a generator of Compute_VirtualMachine instances for property testing. +// We first initialize computeVirtualMachineGenerator 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 ComputeVirtualMachineGenerator() gopter.Gen { + if computeVirtualMachineGenerator != nil { + return computeVirtualMachineGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeVirtualMachine(generators) + computeVirtualMachineGenerator = gen.Struct(reflect.TypeOf(Compute_VirtualMachine{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeVirtualMachine(generators) + AddRelatedPropertyGeneratorsForComputeVirtualMachine(generators) + computeVirtualMachineGenerator = gen.Struct(reflect.TypeOf(Compute_VirtualMachine{}), generators) + + return computeVirtualMachineGenerator +} + +// AddIndependentPropertyGeneratorsForComputeVirtualMachine is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeVirtualMachine(gens map[string]gopter.Gen) { + gens["ComputeLocation"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeType"] = gen.PtrOf(gen.AlphaString()) + gens["Description"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForComputeVirtualMachine is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeVirtualMachine(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(VirtualMachinePropertiesGenerator()) +} + +func Test_ErrorResponse_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorResponse_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorResponseStatus, ErrorResponseStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorResponseStatus runs a test to see if a specific instance of ErrorResponse_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorResponseStatus(subject ErrorResponse_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorResponse_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 ErrorResponse_Status instances for property testing - lazily instantiated by +// ErrorResponseStatusGenerator() +var errorResponseStatusGenerator gopter.Gen + +// ErrorResponseStatusGenerator returns a generator of ErrorResponse_Status instances for property testing. +func ErrorResponseStatusGenerator() gopter.Gen { + if errorResponseStatusGenerator != nil { + return errorResponseStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForErrorResponseStatus(generators) + errorResponseStatusGenerator = gen.Struct(reflect.TypeOf(ErrorResponse_Status{}), generators) + + return errorResponseStatusGenerator +} + +// AddRelatedPropertyGeneratorsForErrorResponseStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorResponseStatus(gens map[string]gopter.Gen) { + gens["Error"] = gen.PtrOf(ErrorDetailStatusGenerator()) +} + +func Test_AKSProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AKSProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAKSProperties, AKSPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAKSProperties runs a test to see if a specific instance of AKSProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAKSProperties(subject AKSProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AKSProperties + 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 AKSProperties instances for property testing - lazily instantiated by AKSPropertiesGenerator() +var aksPropertiesGenerator gopter.Gen + +// AKSPropertiesGenerator returns a generator of AKSProperties instances for property testing. +// We first initialize aksPropertiesGenerator 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 AKSPropertiesGenerator() gopter.Gen { + if aksPropertiesGenerator != nil { + return aksPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAKSProperties(generators) + aksPropertiesGenerator = gen.Struct(reflect.TypeOf(AKSProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAKSProperties(generators) + AddRelatedPropertyGeneratorsForAKSProperties(generators) + aksPropertiesGenerator = gen.Struct(reflect.TypeOf(AKSProperties{}), generators) + + return aksPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAKSProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAKSProperties(gens map[string]gopter.Gen) { + gens["AgentCount"] = gen.PtrOf(gen.Int()) + gens["AgentVmSize"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterFqdn"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterPurpose"] = gen.PtrOf(gen.AlphaString()) + gens["LoadBalancerSubnet"] = gen.PtrOf(gen.AlphaString()) + gens["LoadBalancerType"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForAKSProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForAKSProperties(gens map[string]gopter.Gen) { + gens["AksNetworkingConfiguration"] = gen.PtrOf(AksNetworkingConfigurationGenerator()) + gens["SslConfiguration"] = gen.PtrOf(SslConfigurationGenerator()) +} + +func Test_AmlComputeProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AmlComputeProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAmlComputeProperties, AmlComputePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAmlComputeProperties runs a test to see if a specific instance of AmlComputeProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAmlComputeProperties(subject AmlComputeProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AmlComputeProperties + 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 AmlComputeProperties instances for property testing - lazily instantiated by +// AmlComputePropertiesGenerator() +var amlComputePropertiesGenerator gopter.Gen + +// AmlComputePropertiesGenerator returns a generator of AmlComputeProperties instances for property testing. +// We first initialize amlComputePropertiesGenerator 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 AmlComputePropertiesGenerator() gopter.Gen { + if amlComputePropertiesGenerator != nil { + return amlComputePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAmlComputeProperties(generators) + amlComputePropertiesGenerator = gen.Struct(reflect.TypeOf(AmlComputeProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAmlComputeProperties(generators) + AddRelatedPropertyGeneratorsForAmlComputeProperties(generators) + amlComputePropertiesGenerator = gen.Struct(reflect.TypeOf(AmlComputeProperties{}), generators) + + return amlComputePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAmlComputeProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAmlComputeProperties(gens map[string]gopter.Gen) { + gens["EnableNodePublicIp"] = gen.PtrOf(gen.Bool()) + gens["IsolatedNetwork"] = gen.PtrOf(gen.Bool()) + gens["OsType"] = gen.PtrOf(gen.AlphaString()) + gens["RemoteLoginPortPublicAccess"] = gen.PtrOf(gen.AlphaString()) + gens["VmPriority"] = gen.PtrOf(gen.AlphaString()) + gens["VmSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForAmlComputeProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForAmlComputeProperties(gens map[string]gopter.Gen) { + gens["ScaleSettings"] = gen.PtrOf(ScaleSettingsGenerator()) + gens["Subnet"] = gen.PtrOf(ResourceIdGenerator()) + gens["UserAccountCredentials"] = gen.PtrOf(UserAccountCredentialsGenerator()) + gens["VirtualMachineImage"] = gen.PtrOf(VirtualMachineImageGenerator()) +} + +func Test_ComputeInstanceProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeInstanceProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeInstanceProperties, ComputeInstancePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeInstanceProperties runs a test to see if a specific instance of ComputeInstanceProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeInstanceProperties(subject ComputeInstanceProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeInstanceProperties + 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 ComputeInstanceProperties instances for property testing - lazily instantiated by +// ComputeInstancePropertiesGenerator() +var computeInstancePropertiesGenerator gopter.Gen + +// ComputeInstancePropertiesGenerator returns a generator of ComputeInstanceProperties instances for property testing. +// We first initialize computeInstancePropertiesGenerator 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 ComputeInstancePropertiesGenerator() gopter.Gen { + if computeInstancePropertiesGenerator != nil { + return computeInstancePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstanceProperties(generators) + computeInstancePropertiesGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstanceProperties(generators) + AddRelatedPropertyGeneratorsForComputeInstanceProperties(generators) + computeInstancePropertiesGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceProperties{}), generators) + + return computeInstancePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForComputeInstanceProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeInstanceProperties(gens map[string]gopter.Gen) { + gens["ApplicationSharingPolicy"] = gen.PtrOf(gen.AlphaString()) + gens["ComputeInstanceAuthorizationType"] = gen.PtrOf(gen.AlphaString()) + gens["VmSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForComputeInstanceProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForComputeInstanceProperties(gens map[string]gopter.Gen) { + gens["PersonalComputeInstanceSettings"] = gen.PtrOf(PersonalComputeInstanceSettingsGenerator()) + gens["SetupScripts"] = gen.PtrOf(SetupScriptsGenerator()) + gens["SshSettings"] = gen.PtrOf(ComputeInstanceSshSettingsGenerator()) + gens["Subnet"] = gen.PtrOf(ResourceIdGenerator()) +} + +func Test_DataLakeAnalyticsProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of DataLakeAnalyticsProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDataLakeAnalyticsProperties, DataLakeAnalyticsPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDataLakeAnalyticsProperties runs a test to see if a specific instance of DataLakeAnalyticsProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForDataLakeAnalyticsProperties(subject DataLakeAnalyticsProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual DataLakeAnalyticsProperties + 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 DataLakeAnalyticsProperties instances for property testing - lazily instantiated by +// DataLakeAnalyticsPropertiesGenerator() +var dataLakeAnalyticsPropertiesGenerator gopter.Gen + +// DataLakeAnalyticsPropertiesGenerator returns a generator of DataLakeAnalyticsProperties instances for property testing. +func DataLakeAnalyticsPropertiesGenerator() gopter.Gen { + if dataLakeAnalyticsPropertiesGenerator != nil { + return dataLakeAnalyticsPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDataLakeAnalyticsProperties(generators) + dataLakeAnalyticsPropertiesGenerator = gen.Struct(reflect.TypeOf(DataLakeAnalyticsProperties{}), generators) + + return dataLakeAnalyticsPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForDataLakeAnalyticsProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDataLakeAnalyticsProperties(gens map[string]gopter.Gen) { + gens["DataLakeStoreAccountName"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_DatabricksProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of DatabricksProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDatabricksProperties, DatabricksPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDatabricksProperties runs a test to see if a specific instance of DatabricksProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForDatabricksProperties(subject DatabricksProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual DatabricksProperties + 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 DatabricksProperties instances for property testing - lazily instantiated by +// DatabricksPropertiesGenerator() +var databricksPropertiesGenerator gopter.Gen + +// DatabricksPropertiesGenerator returns a generator of DatabricksProperties instances for property testing. +func DatabricksPropertiesGenerator() gopter.Gen { + if databricksPropertiesGenerator != nil { + return databricksPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDatabricksProperties(generators) + databricksPropertiesGenerator = gen.Struct(reflect.TypeOf(DatabricksProperties{}), generators) + + return databricksPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForDatabricksProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDatabricksProperties(gens map[string]gopter.Gen) { + gens["DatabricksAccessToken"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceUrl"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ErrorDetail_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorDetail_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorDetailStatus, ErrorDetailStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorDetailStatus runs a test to see if a specific instance of ErrorDetail_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorDetailStatus(subject ErrorDetail_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorDetail_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 ErrorDetail_Status instances for property testing - lazily instantiated by ErrorDetailStatusGenerator() +var errorDetailStatusGenerator gopter.Gen + +// ErrorDetailStatusGenerator returns a generator of ErrorDetail_Status instances for property testing. +// We first initialize errorDetailStatusGenerator 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 ErrorDetailStatusGenerator() gopter.Gen { + if errorDetailStatusGenerator != nil { + return errorDetailStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatus(generators) + errorDetailStatusGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatus(generators) + AddRelatedPropertyGeneratorsForErrorDetailStatus(generators) + errorDetailStatusGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status{}), generators) + + return errorDetailStatusGenerator +} + +// AddIndependentPropertyGeneratorsForErrorDetailStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorDetailStatus(gens map[string]gopter.Gen) { + gens["Code"] = gen.PtrOf(gen.AlphaString()) + gens["Message"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForErrorDetailStatus is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorDetailStatus(gens map[string]gopter.Gen) { + gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusGenerator()) + gens["Details"] = gen.SliceOf(ErrorDetailStatusUnrolledGenerator()) +} + +func Test_HDInsightProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of HDInsightProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForHDInsightProperties, HDInsightPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForHDInsightProperties runs a test to see if a specific instance of HDInsightProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForHDInsightProperties(subject HDInsightProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual HDInsightProperties + 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 HDInsightProperties instances for property testing - lazily instantiated by +// HDInsightPropertiesGenerator() +var hdInsightPropertiesGenerator gopter.Gen + +// HDInsightPropertiesGenerator returns a generator of HDInsightProperties instances for property testing. +// We first initialize hdInsightPropertiesGenerator 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 HDInsightPropertiesGenerator() gopter.Gen { + if hdInsightPropertiesGenerator != nil { + return hdInsightPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForHDInsightProperties(generators) + hdInsightPropertiesGenerator = gen.Struct(reflect.TypeOf(HDInsightProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForHDInsightProperties(generators) + AddRelatedPropertyGeneratorsForHDInsightProperties(generators) + hdInsightPropertiesGenerator = gen.Struct(reflect.TypeOf(HDInsightProperties{}), generators) + + return hdInsightPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForHDInsightProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForHDInsightProperties(gens map[string]gopter.Gen) { + gens["Address"] = gen.PtrOf(gen.AlphaString()) + gens["SshPort"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForHDInsightProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForHDInsightProperties(gens map[string]gopter.Gen) { + gens["AdministratorAccount"] = gen.PtrOf(VirtualMachineSshCredentialsGenerator()) +} + +func Test_SynapseSparkProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SynapseSparkProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSynapseSparkProperties, SynapseSparkPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSynapseSparkProperties runs a test to see if a specific instance of SynapseSparkProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSynapseSparkProperties(subject SynapseSparkProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SynapseSparkProperties + 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 SynapseSparkProperties instances for property testing - lazily instantiated by +// SynapseSparkPropertiesGenerator() +var synapseSparkPropertiesGenerator gopter.Gen + +// SynapseSparkPropertiesGenerator returns a generator of SynapseSparkProperties instances for property testing. +// We first initialize synapseSparkPropertiesGenerator 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 SynapseSparkPropertiesGenerator() gopter.Gen { + if synapseSparkPropertiesGenerator != nil { + return synapseSparkPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSynapseSparkProperties(generators) + synapseSparkPropertiesGenerator = gen.Struct(reflect.TypeOf(SynapseSparkProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSynapseSparkProperties(generators) + AddRelatedPropertyGeneratorsForSynapseSparkProperties(generators) + synapseSparkPropertiesGenerator = gen.Struct(reflect.TypeOf(SynapseSparkProperties{}), generators) + + return synapseSparkPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSynapseSparkProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSynapseSparkProperties(gens map[string]gopter.Gen) { + gens["NodeCount"] = gen.PtrOf(gen.Int()) + gens["NodeSize"] = gen.PtrOf(gen.AlphaString()) + gens["NodeSizeFamily"] = gen.PtrOf(gen.AlphaString()) + gens["PoolName"] = gen.PtrOf(gen.AlphaString()) + gens["ResourceGroup"] = gen.PtrOf(gen.AlphaString()) + gens["SparkVersion"] = gen.PtrOf(gen.AlphaString()) + gens["SubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["WorkspaceName"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSynapseSparkProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSynapseSparkProperties(gens map[string]gopter.Gen) { + gens["AutoPauseProperties"] = gen.PtrOf(AutoPausePropertiesGenerator()) + gens["AutoScaleProperties"] = gen.PtrOf(AutoScalePropertiesGenerator()) +} + +func Test_VirtualMachineProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineProperties, VirtualMachinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineProperties runs a test to see if a specific instance of VirtualMachineProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineProperties(subject VirtualMachineProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineProperties + 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 VirtualMachineProperties instances for property testing - lazily instantiated by +// VirtualMachinePropertiesGenerator() +var virtualMachinePropertiesGenerator gopter.Gen + +// VirtualMachinePropertiesGenerator returns a generator of VirtualMachineProperties instances for property testing. +// We first initialize virtualMachinePropertiesGenerator 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 VirtualMachinePropertiesGenerator() gopter.Gen { + if virtualMachinePropertiesGenerator != nil { + return virtualMachinePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineProperties(generators) + virtualMachinePropertiesGenerator = gen.Struct(reflect.TypeOf(VirtualMachineProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineProperties(generators) + AddRelatedPropertyGeneratorsForVirtualMachineProperties(generators) + virtualMachinePropertiesGenerator = gen.Struct(reflect.TypeOf(VirtualMachineProperties{}), generators) + + return virtualMachinePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForVirtualMachineProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForVirtualMachineProperties(gens map[string]gopter.Gen) { + gens["Address"] = gen.PtrOf(gen.AlphaString()) + gens["IsNotebookInstanceCompute"] = gen.PtrOf(gen.Bool()) + gens["SshPort"] = gen.PtrOf(gen.Int()) + gens["VirtualMachineSize"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForVirtualMachineProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForVirtualMachineProperties(gens map[string]gopter.Gen) { + gens["AdministratorAccount"] = gen.PtrOf(VirtualMachineSshCredentialsGenerator()) +} + +func Test_AksNetworkingConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AksNetworkingConfiguration via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAksNetworkingConfiguration, AksNetworkingConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAksNetworkingConfiguration runs a test to see if a specific instance of AksNetworkingConfiguration round trips to JSON and back losslessly +func RunJSONSerializationTestForAksNetworkingConfiguration(subject AksNetworkingConfiguration) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AksNetworkingConfiguration + 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 AksNetworkingConfiguration instances for property testing - lazily instantiated by +// AksNetworkingConfigurationGenerator() +var aksNetworkingConfigurationGenerator gopter.Gen + +// AksNetworkingConfigurationGenerator returns a generator of AksNetworkingConfiguration instances for property testing. +func AksNetworkingConfigurationGenerator() gopter.Gen { + if aksNetworkingConfigurationGenerator != nil { + return aksNetworkingConfigurationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAksNetworkingConfiguration(generators) + aksNetworkingConfigurationGenerator = gen.Struct(reflect.TypeOf(AksNetworkingConfiguration{}), generators) + + return aksNetworkingConfigurationGenerator +} + +// AddIndependentPropertyGeneratorsForAksNetworkingConfiguration is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAksNetworkingConfiguration(gens map[string]gopter.Gen) { + gens["DnsServiceIP"] = gen.PtrOf(gen.AlphaString()) + gens["DockerBridgeCidr"] = gen.PtrOf(gen.AlphaString()) + gens["ServiceCidr"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_AutoPauseProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AutoPauseProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAutoPauseProperties, AutoPausePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAutoPauseProperties runs a test to see if a specific instance of AutoPauseProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAutoPauseProperties(subject AutoPauseProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AutoPauseProperties + 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 AutoPauseProperties instances for property testing - lazily instantiated by +// AutoPausePropertiesGenerator() +var autoPausePropertiesGenerator gopter.Gen + +// AutoPausePropertiesGenerator returns a generator of AutoPauseProperties instances for property testing. +func AutoPausePropertiesGenerator() gopter.Gen { + if autoPausePropertiesGenerator != nil { + return autoPausePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAutoPauseProperties(generators) + autoPausePropertiesGenerator = gen.Struct(reflect.TypeOf(AutoPauseProperties{}), generators) + + return autoPausePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAutoPauseProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAutoPauseProperties(gens map[string]gopter.Gen) { + gens["DelayInMinutes"] = gen.PtrOf(gen.Int()) + gens["Enabled"] = gen.PtrOf(gen.Bool()) +} + +func Test_AutoScaleProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AutoScaleProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAutoScaleProperties, AutoScalePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAutoScaleProperties runs a test to see if a specific instance of AutoScaleProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForAutoScaleProperties(subject AutoScaleProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AutoScaleProperties + 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 AutoScaleProperties instances for property testing - lazily instantiated by +// AutoScalePropertiesGenerator() +var autoScalePropertiesGenerator gopter.Gen + +// AutoScalePropertiesGenerator returns a generator of AutoScaleProperties instances for property testing. +func AutoScalePropertiesGenerator() gopter.Gen { + if autoScalePropertiesGenerator != nil { + return autoScalePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAutoScaleProperties(generators) + autoScalePropertiesGenerator = gen.Struct(reflect.TypeOf(AutoScaleProperties{}), generators) + + return autoScalePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForAutoScaleProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAutoScaleProperties(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["MaxNodeCount"] = gen.PtrOf(gen.Int()) + gens["MinNodeCount"] = gen.PtrOf(gen.Int()) +} + +func Test_ComputeInstanceSshSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ComputeInstanceSshSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForComputeInstanceSshSettings, ComputeInstanceSshSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForComputeInstanceSshSettings runs a test to see if a specific instance of ComputeInstanceSshSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForComputeInstanceSshSettings(subject ComputeInstanceSshSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ComputeInstanceSshSettings + 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 ComputeInstanceSshSettings instances for property testing - lazily instantiated by +// ComputeInstanceSshSettingsGenerator() +var computeInstanceSshSettingsGenerator gopter.Gen + +// ComputeInstanceSshSettingsGenerator returns a generator of ComputeInstanceSshSettings instances for property testing. +func ComputeInstanceSshSettingsGenerator() gopter.Gen { + if computeInstanceSshSettingsGenerator != nil { + return computeInstanceSshSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForComputeInstanceSshSettings(generators) + computeInstanceSshSettingsGenerator = gen.Struct(reflect.TypeOf(ComputeInstanceSshSettings{}), generators) + + return computeInstanceSshSettingsGenerator +} + +// AddIndependentPropertyGeneratorsForComputeInstanceSshSettings is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForComputeInstanceSshSettings(gens map[string]gopter.Gen) { + gens["AdminPublicKey"] = gen.PtrOf(gen.AlphaString()) + gens["SshPublicAccess"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ErrorAdditionalInfo_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorAdditionalInfo_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorAdditionalInfoStatus, ErrorAdditionalInfoStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorAdditionalInfoStatus runs a test to see if a specific instance of ErrorAdditionalInfo_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorAdditionalInfoStatus(subject ErrorAdditionalInfo_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorAdditionalInfo_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 ErrorAdditionalInfo_Status instances for property testing - lazily instantiated by +// ErrorAdditionalInfoStatusGenerator() +var errorAdditionalInfoStatusGenerator gopter.Gen + +// ErrorAdditionalInfoStatusGenerator returns a generator of ErrorAdditionalInfo_Status instances for property testing. +func ErrorAdditionalInfoStatusGenerator() gopter.Gen { + if errorAdditionalInfoStatusGenerator != nil { + return errorAdditionalInfoStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatus(generators) + errorAdditionalInfoStatusGenerator = gen.Struct(reflect.TypeOf(ErrorAdditionalInfo_Status{}), generators) + + return errorAdditionalInfoStatusGenerator +} + +// AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorAdditionalInfoStatus(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ErrorDetail_Status_Unrolled_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ErrorDetail_Status_Unrolled via JSON returns original", + prop.ForAll(RunJSONSerializationTestForErrorDetailStatusUnrolled, ErrorDetailStatusUnrolledGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForErrorDetailStatusUnrolled runs a test to see if a specific instance of ErrorDetail_Status_Unrolled round trips to JSON and back losslessly +func RunJSONSerializationTestForErrorDetailStatusUnrolled(subject ErrorDetail_Status_Unrolled) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ErrorDetail_Status_Unrolled + 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 ErrorDetail_Status_Unrolled instances for property testing - lazily instantiated by +// ErrorDetailStatusUnrolledGenerator() +var errorDetailStatusUnrolledGenerator gopter.Gen + +// ErrorDetailStatusUnrolledGenerator returns a generator of ErrorDetail_Status_Unrolled instances for property testing. +// We first initialize errorDetailStatusUnrolledGenerator 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 ErrorDetailStatusUnrolledGenerator() gopter.Gen { + if errorDetailStatusUnrolledGenerator != nil { + return errorDetailStatusUnrolledGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled(generators) + errorDetailStatusUnrolledGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_Unrolled{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled(generators) + AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolled(generators) + errorDetailStatusUnrolledGenerator = gen.Struct(reflect.TypeOf(ErrorDetail_Status_Unrolled{}), generators) + + return errorDetailStatusUnrolledGenerator +} + +// AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForErrorDetailStatusUnrolled(gens map[string]gopter.Gen) { + gens["Code"] = gen.PtrOf(gen.AlphaString()) + gens["Message"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolled is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForErrorDetailStatusUnrolled(gens map[string]gopter.Gen) { + gens["AdditionalInfo"] = gen.SliceOf(ErrorAdditionalInfoStatusGenerator()) +} + +func Test_PersonalComputeInstanceSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PersonalComputeInstanceSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPersonalComputeInstanceSettings, PersonalComputeInstanceSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPersonalComputeInstanceSettings runs a test to see if a specific instance of PersonalComputeInstanceSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForPersonalComputeInstanceSettings(subject PersonalComputeInstanceSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PersonalComputeInstanceSettings + 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 PersonalComputeInstanceSettings instances for property testing - lazily instantiated by +// PersonalComputeInstanceSettingsGenerator() +var personalComputeInstanceSettingsGenerator gopter.Gen + +// PersonalComputeInstanceSettingsGenerator returns a generator of PersonalComputeInstanceSettings instances for property testing. +func PersonalComputeInstanceSettingsGenerator() gopter.Gen { + if personalComputeInstanceSettingsGenerator != nil { + return personalComputeInstanceSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettings(generators) + personalComputeInstanceSettingsGenerator = gen.Struct(reflect.TypeOf(PersonalComputeInstanceSettings{}), generators) + + return personalComputeInstanceSettingsGenerator +} + +// AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettings is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForPersonalComputeInstanceSettings(gens map[string]gopter.Gen) { + gens["AssignedUser"] = gen.PtrOf(AssignedUserGenerator()) +} + +func Test_ResourceId_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ResourceId via JSON returns original", + prop.ForAll(RunJSONSerializationTestForResourceId, ResourceIdGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForResourceId runs a test to see if a specific instance of ResourceId round trips to JSON and back losslessly +func RunJSONSerializationTestForResourceId(subject ResourceId) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ResourceId + 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 ResourceId instances for property testing - lazily instantiated by ResourceIdGenerator() +var resourceIdGenerator gopter.Gen + +// ResourceIdGenerator returns a generator of ResourceId instances for property testing. +func ResourceIdGenerator() gopter.Gen { + if resourceIdGenerator != nil { + return resourceIdGenerator + } + + generators := make(map[string]gopter.Gen) + resourceIdGenerator = gen.Struct(reflect.TypeOf(ResourceId{}), generators) + + return resourceIdGenerator +} + +func Test_ScaleSettings_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScaleSettings via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScaleSettings, ScaleSettingsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScaleSettings runs a test to see if a specific instance of ScaleSettings round trips to JSON and back losslessly +func RunJSONSerializationTestForScaleSettings(subject ScaleSettings) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScaleSettings + 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 ScaleSettings instances for property testing - lazily instantiated by ScaleSettingsGenerator() +var scaleSettingsGenerator gopter.Gen + +// ScaleSettingsGenerator returns a generator of ScaleSettings instances for property testing. +func ScaleSettingsGenerator() gopter.Gen { + if scaleSettingsGenerator != nil { + return scaleSettingsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScaleSettings(generators) + scaleSettingsGenerator = gen.Struct(reflect.TypeOf(ScaleSettings{}), generators) + + return scaleSettingsGenerator +} + +// AddIndependentPropertyGeneratorsForScaleSettings is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScaleSettings(gens map[string]gopter.Gen) { + gens["MaxNodeCount"] = gen.PtrOf(gen.Int()) + gens["MinNodeCount"] = gen.PtrOf(gen.Int()) + gens["NodeIdleTimeBeforeScaleDown"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SetupScripts_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SetupScripts via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSetupScripts, SetupScriptsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSetupScripts runs a test to see if a specific instance of SetupScripts round trips to JSON and back losslessly +func RunJSONSerializationTestForSetupScripts(subject SetupScripts) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SetupScripts + 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 SetupScripts instances for property testing - lazily instantiated by SetupScriptsGenerator() +var setupScriptsGenerator gopter.Gen + +// SetupScriptsGenerator returns a generator of SetupScripts instances for property testing. +func SetupScriptsGenerator() gopter.Gen { + if setupScriptsGenerator != nil { + return setupScriptsGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForSetupScripts(generators) + setupScriptsGenerator = gen.Struct(reflect.TypeOf(SetupScripts{}), generators) + + return setupScriptsGenerator +} + +// AddRelatedPropertyGeneratorsForSetupScripts is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSetupScripts(gens map[string]gopter.Gen) { + gens["Scripts"] = gen.PtrOf(ScriptsToExecuteGenerator()) +} + +func Test_SslConfiguration_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SslConfiguration via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSslConfiguration, SslConfigurationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSslConfiguration runs a test to see if a specific instance of SslConfiguration round trips to JSON and back losslessly +func RunJSONSerializationTestForSslConfiguration(subject SslConfiguration) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SslConfiguration + 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 SslConfiguration instances for property testing - lazily instantiated by SslConfigurationGenerator() +var sslConfigurationGenerator gopter.Gen + +// SslConfigurationGenerator returns a generator of SslConfiguration instances for property testing. +func SslConfigurationGenerator() gopter.Gen { + if sslConfigurationGenerator != nil { + return sslConfigurationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSslConfiguration(generators) + sslConfigurationGenerator = gen.Struct(reflect.TypeOf(SslConfiguration{}), generators) + + return sslConfigurationGenerator +} + +// AddIndependentPropertyGeneratorsForSslConfiguration is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSslConfiguration(gens map[string]gopter.Gen) { + gens["Cert"] = gen.PtrOf(gen.AlphaString()) + gens["Cname"] = gen.PtrOf(gen.AlphaString()) + gens["Key"] = gen.PtrOf(gen.AlphaString()) + gens["LeafDomainLabel"] = gen.PtrOf(gen.AlphaString()) + gens["OverwriteExistingDomain"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_UserAccountCredentials_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAccountCredentials via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAccountCredentials, UserAccountCredentialsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAccountCredentials runs a test to see if a specific instance of UserAccountCredentials round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAccountCredentials(subject UserAccountCredentials) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAccountCredentials + 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 UserAccountCredentials instances for property testing - lazily instantiated by +// UserAccountCredentialsGenerator() +var userAccountCredentialsGenerator gopter.Gen + +// UserAccountCredentialsGenerator returns a generator of UserAccountCredentials instances for property testing. +func UserAccountCredentialsGenerator() gopter.Gen { + if userAccountCredentialsGenerator != nil { + return userAccountCredentialsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAccountCredentials(generators) + userAccountCredentialsGenerator = gen.Struct(reflect.TypeOf(UserAccountCredentials{}), generators) + + return userAccountCredentialsGenerator +} + +// AddIndependentPropertyGeneratorsForUserAccountCredentials is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAccountCredentials(gens map[string]gopter.Gen) { + gens["AdminUserName"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_VirtualMachineImage_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineImage via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineImage, VirtualMachineImageGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineImage runs a test to see if a specific instance of VirtualMachineImage round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineImage(subject VirtualMachineImage) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineImage + 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 VirtualMachineImage instances for property testing - lazily instantiated by +// VirtualMachineImageGenerator() +var virtualMachineImageGenerator gopter.Gen + +// VirtualMachineImageGenerator returns a generator of VirtualMachineImage instances for property testing. +func VirtualMachineImageGenerator() gopter.Gen { + if virtualMachineImageGenerator != nil { + return virtualMachineImageGenerator + } + + generators := make(map[string]gopter.Gen) + virtualMachineImageGenerator = gen.Struct(reflect.TypeOf(VirtualMachineImage{}), generators) + + return virtualMachineImageGenerator +} + +func Test_VirtualMachineSshCredentials_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of VirtualMachineSshCredentials via JSON returns original", + prop.ForAll(RunJSONSerializationTestForVirtualMachineSshCredentials, VirtualMachineSshCredentialsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForVirtualMachineSshCredentials runs a test to see if a specific instance of VirtualMachineSshCredentials round trips to JSON and back losslessly +func RunJSONSerializationTestForVirtualMachineSshCredentials(subject VirtualMachineSshCredentials) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual VirtualMachineSshCredentials + 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 VirtualMachineSshCredentials instances for property testing - lazily instantiated by +// VirtualMachineSshCredentialsGenerator() +var virtualMachineSshCredentialsGenerator gopter.Gen + +// VirtualMachineSshCredentialsGenerator returns a generator of VirtualMachineSshCredentials instances for property testing. +func VirtualMachineSshCredentialsGenerator() gopter.Gen { + if virtualMachineSshCredentialsGenerator != nil { + return virtualMachineSshCredentialsGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials(generators) + virtualMachineSshCredentialsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineSshCredentials{}), generators) + + return virtualMachineSshCredentialsGenerator +} + +// AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForVirtualMachineSshCredentials(gens map[string]gopter.Gen) { + gens["PrivateKeyData"] = gen.PtrOf(gen.AlphaString()) + gens["PublicKeyData"] = gen.PtrOf(gen.AlphaString()) + gens["Username"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_AssignedUser_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of AssignedUser via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAssignedUser, AssignedUserGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAssignedUser runs a test to see if a specific instance of AssignedUser round trips to JSON and back losslessly +func RunJSONSerializationTestForAssignedUser(subject AssignedUser) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual AssignedUser + 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 AssignedUser instances for property testing - lazily instantiated by AssignedUserGenerator() +var assignedUserGenerator gopter.Gen + +// AssignedUserGenerator returns a generator of AssignedUser instances for property testing. +func AssignedUserGenerator() gopter.Gen { + if assignedUserGenerator != nil { + return assignedUserGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAssignedUser(generators) + assignedUserGenerator = gen.Struct(reflect.TypeOf(AssignedUser{}), generators) + + return assignedUserGenerator +} + +// AddIndependentPropertyGeneratorsForAssignedUser is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAssignedUser(gens map[string]gopter.Gen) { + gens["ObjectId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_ScriptsToExecute_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScriptsToExecute via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScriptsToExecute, ScriptsToExecuteGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScriptsToExecute runs a test to see if a specific instance of ScriptsToExecute round trips to JSON and back losslessly +func RunJSONSerializationTestForScriptsToExecute(subject ScriptsToExecute) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScriptsToExecute + 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 ScriptsToExecute instances for property testing - lazily instantiated by ScriptsToExecuteGenerator() +var scriptsToExecuteGenerator gopter.Gen + +// ScriptsToExecuteGenerator returns a generator of ScriptsToExecute instances for property testing. +func ScriptsToExecuteGenerator() gopter.Gen { + if scriptsToExecuteGenerator != nil { + return scriptsToExecuteGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForScriptsToExecute(generators) + scriptsToExecuteGenerator = gen.Struct(reflect.TypeOf(ScriptsToExecute{}), generators) + + return scriptsToExecuteGenerator +} + +// AddRelatedPropertyGeneratorsForScriptsToExecute is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForScriptsToExecute(gens map[string]gopter.Gen) { + gens["CreationScript"] = gen.PtrOf(ScriptReferenceGenerator()) + gens["StartupScript"] = gen.PtrOf(ScriptReferenceGenerator()) +} + +func Test_ScriptReference_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of ScriptReference via JSON returns original", + prop.ForAll(RunJSONSerializationTestForScriptReference, ScriptReferenceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForScriptReference runs a test to see if a specific instance of ScriptReference round trips to JSON and back losslessly +func RunJSONSerializationTestForScriptReference(subject ScriptReference) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual ScriptReference + 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 ScriptReference instances for property testing - lazily instantiated by ScriptReferenceGenerator() +var scriptReferenceGenerator gopter.Gen + +// ScriptReferenceGenerator returns a generator of ScriptReference instances for property testing. +func ScriptReferenceGenerator() gopter.Gen { + if scriptReferenceGenerator != nil { + return scriptReferenceGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForScriptReference(generators) + scriptReferenceGenerator = gen.Struct(reflect.TypeOf(ScriptReference{}), generators) + + return scriptReferenceGenerator +} + +// AddIndependentPropertyGeneratorsForScriptReference is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForScriptReference(gens map[string]gopter.Gen) { + gens["ScriptArguments"] = gen.PtrOf(gen.AlphaString()) + gens["ScriptData"] = gen.PtrOf(gen.AlphaString()) + gens["ScriptSource"] = gen.PtrOf(gen.AlphaString()) + gens["Timeout"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen.go b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen.go new file mode 100644 index 0000000000..3aac90beea --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen.go @@ -0,0 +1,211 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources=workspacesconnections,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machinelearningservices.azure.com,resources={workspacesconnections/status,workspacesconnections/finalizers},verbs=get;update;patch + +// +kubebuilder:object:root=true +// +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 v1beta20210701.WorkspacesConnection +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections +type WorkspacesConnection struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec WorkspacesConnections_Spec `json:"spec,omitempty"` + Status WorkspaceConnection_Status `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &WorkspacesConnection{} + +// GetConditions returns the conditions of the resource +func (connection *WorkspacesConnection) GetConditions() conditions.Conditions { + return connection.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (connection *WorkspacesConnection) SetConditions(conditions conditions.Conditions) { + connection.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &WorkspacesConnection{} + +// AzureName returns the Azure name of the resource +func (connection *WorkspacesConnection) AzureName() string { + return connection.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-07-01" +func (connection WorkspacesConnection) GetAPIVersion() string { + return string(APIVersionValue) +} + +// GetResourceKind returns the kind of the resource +func (connection *WorkspacesConnection) GetResourceKind() genruntime.ResourceKind { + return genruntime.ResourceKindNormal +} + +// GetSpec returns the specification of this resource +func (connection *WorkspacesConnection) GetSpec() genruntime.ConvertibleSpec { + return &connection.Spec +} + +// GetStatus returns the status of this resource +func (connection *WorkspacesConnection) GetStatus() genruntime.ConvertibleStatus { + return &connection.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.MachineLearningServices/workspaces/connections" +func (connection *WorkspacesConnection) GetType() string { + return "Microsoft.MachineLearningServices/workspaces/connections" +} + +// NewEmptyStatus returns a new empty (blank) status +func (connection *WorkspacesConnection) NewEmptyStatus() genruntime.ConvertibleStatus { + return &WorkspaceConnection_Status{} +} + +// Owner returns the ResourceReference of the owner, or nil if there is no owner +func (connection *WorkspacesConnection) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(connection.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: connection.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (connection *WorkspacesConnection) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*WorkspaceConnection_Status); ok { + connection.Status = *st + return nil + } + + // Convert status to required version + var st WorkspaceConnection_Status + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + connection.Status = st + return nil +} + +// Hub marks that this WorkspacesConnection is the hub type for conversion +func (connection *WorkspacesConnection) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (connection *WorkspacesConnection) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: connection.Spec.OriginalVersion, + Kind: "WorkspacesConnection", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1beta20210701.WorkspacesConnection +// Generated from: https://schema.management.azure.com/schemas/2021-07-01/Microsoft.MachineLearningServices.json#/resourceDefinitions/workspaces_connections +type WorkspacesConnectionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []WorkspacesConnection `json:"items"` +} + +// Storage version of v1beta20210701.WorkspaceConnection_Status +type WorkspaceConnection_Status struct { + AuthType *string `json:"authType,omitempty"` + Category *string `json:"category,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Target *string `json:"target,omitempty"` + Type *string `json:"type,omitempty"` + Value *string `json:"value,omitempty"` + ValueFormat *string `json:"valueFormat,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &WorkspaceConnection_Status{} + +// ConvertStatusFrom populates our WorkspaceConnection_Status from the provided source +func (connection *WorkspaceConnection_Status) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == connection { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(connection) +} + +// ConvertStatusTo populates the provided destination from our WorkspaceConnection_Status +func (connection *WorkspaceConnection_Status) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == connection { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(connection) +} + +// Storage version of v1beta20210701.WorkspacesConnections_Spec +type WorkspacesConnections_Spec struct { + AuthType *string `json:"authType,omitempty"` + + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + Category *string `json:"category,omitempty"` + Location *string `json:"location,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 machinelearningservices.azure.com/Workspace resource + Owner *genruntime.KnownResourceReference `group:"machinelearningservices.azure.com" json:"owner,omitempty" kind:"Workspace"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Target *string `json:"target,omitempty"` + Value *string `json:"value,omitempty"` + ValueFormat *string `json:"valueFormat,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &WorkspacesConnections_Spec{} + +// ConvertSpecFrom populates our WorkspacesConnections_Spec from the provided source +func (connections *WorkspacesConnections_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == connections { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(connections) +} + +// ConvertSpecTo populates the provided destination from our WorkspacesConnections_Spec +func (connections *WorkspacesConnections_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == connections { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(connections) +} + +func init() { + SchemeBuilder.Register(&WorkspacesConnection{}, &WorkspacesConnectionList{}) +} diff --git a/v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen_test.go b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen_test.go new file mode 100644 index 0000000000..ffe02d1197 --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/workspaces_connection_types_gen_test.go @@ -0,0 +1,214 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1beta20210701storage + +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_WorkspacesConnection_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesConnection via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesConnection, WorkspacesConnectionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesConnection runs a test to see if a specific instance of WorkspacesConnection round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesConnection(subject WorkspacesConnection) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesConnection + 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 WorkspacesConnection instances for property testing - lazily instantiated by +// WorkspacesConnectionGenerator() +var workspacesConnectionGenerator gopter.Gen + +// WorkspacesConnectionGenerator returns a generator of WorkspacesConnection instances for property testing. +func WorkspacesConnectionGenerator() gopter.Gen { + if workspacesConnectionGenerator != nil { + return workspacesConnectionGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForWorkspacesConnection(generators) + workspacesConnectionGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnection{}), generators) + + return workspacesConnectionGenerator +} + +// AddRelatedPropertyGeneratorsForWorkspacesConnection is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForWorkspacesConnection(gens map[string]gopter.Gen) { + gens["Spec"] = WorkspacesConnectionsSpecGenerator() + gens["Status"] = WorkspaceConnectionStatusGenerator() +} + +func Test_WorkspaceConnection_Status_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspaceConnection_Status via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspaceConnectionStatus, WorkspaceConnectionStatusGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspaceConnectionStatus runs a test to see if a specific instance of WorkspaceConnection_Status round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspaceConnectionStatus(subject WorkspaceConnection_Status) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspaceConnection_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 WorkspaceConnection_Status instances for property testing - lazily instantiated by +// WorkspaceConnectionStatusGenerator() +var workspaceConnectionStatusGenerator gopter.Gen + +// WorkspaceConnectionStatusGenerator returns a generator of WorkspaceConnection_Status instances for property testing. +func WorkspaceConnectionStatusGenerator() gopter.Gen { + if workspaceConnectionStatusGenerator != nil { + return workspaceConnectionStatusGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(generators) + workspaceConnectionStatusGenerator = gen.Struct(reflect.TypeOf(WorkspaceConnection_Status{}), generators) + + return workspaceConnectionStatusGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspaceConnectionStatus(gens map[string]gopter.Gen) { + gens["AuthType"] = gen.PtrOf(gen.AlphaString()) + gens["Category"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["Value"] = gen.PtrOf(gen.AlphaString()) + gens["ValueFormat"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_WorkspacesConnections_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of WorkspacesConnections_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForWorkspacesConnectionsSpec, WorkspacesConnectionsSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForWorkspacesConnectionsSpec runs a test to see if a specific instance of WorkspacesConnections_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForWorkspacesConnectionsSpec(subject WorkspacesConnections_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual WorkspacesConnections_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 WorkspacesConnections_Spec instances for property testing - lazily instantiated by +// WorkspacesConnectionsSpecGenerator() +var workspacesConnectionsSpecGenerator gopter.Gen + +// WorkspacesConnectionsSpecGenerator returns a generator of WorkspacesConnections_Spec instances for property testing. +func WorkspacesConnectionsSpecGenerator() gopter.Gen { + if workspacesConnectionsSpecGenerator != nil { + return workspacesConnectionsSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(generators) + workspacesConnectionsSpecGenerator = gen.Struct(reflect.TypeOf(WorkspacesConnections_Spec{}), generators) + + return workspacesConnectionsSpecGenerator +} + +// AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForWorkspacesConnectionsSpec(gens map[string]gopter.Gen) { + gens["AuthType"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["Category"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["Target"] = gen.PtrOf(gen.AlphaString()) + gens["Value"] = gen.PtrOf(gen.AlphaString()) + gens["ValueFormat"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/machinelearningservices/v1beta20210701storage/zz_generated.deepcopy.go b/v2/api/machinelearningservices/v1beta20210701storage/zz_generated.deepcopy.go new file mode 100644 index 0000000000..f75e248a3c --- /dev/null +++ b/v2/api/machinelearningservices/v1beta20210701storage/zz_generated.deepcopy.go @@ -0,0 +1,3367 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta20210701storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + 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 *AKSProperties) DeepCopyInto(out *AKSProperties) { + *out = *in + if in.AgentCount != nil { + in, out := &in.AgentCount, &out.AgentCount + *out = new(int) + **out = **in + } + if in.AgentVmSize != nil { + in, out := &in.AgentVmSize, &out.AgentVmSize + *out = new(string) + **out = **in + } + if in.AksNetworkingConfiguration != nil { + in, out := &in.AksNetworkingConfiguration, &out.AksNetworkingConfiguration + *out = new(AksNetworkingConfiguration) + (*in).DeepCopyInto(*out) + } + if in.ClusterFqdn != nil { + in, out := &in.ClusterFqdn, &out.ClusterFqdn + *out = new(string) + **out = **in + } + if in.ClusterPurpose != nil { + in, out := &in.ClusterPurpose, &out.ClusterPurpose + *out = new(string) + **out = **in + } + if in.LoadBalancerSubnet != nil { + in, out := &in.LoadBalancerSubnet, &out.LoadBalancerSubnet + *out = new(string) + **out = **in + } + if in.LoadBalancerType != nil { + in, out := &in.LoadBalancerType, &out.LoadBalancerType + *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.SslConfiguration != nil { + in, out := &in.SslConfiguration, &out.SslConfiguration + *out = new(SslConfiguration) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AKSProperties. +func (in *AKSProperties) DeepCopy() *AKSProperties { + if in == nil { + return nil + } + out := new(AKSProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AksNetworkingConfiguration) DeepCopyInto(out *AksNetworkingConfiguration) { + *out = *in + if in.DnsServiceIP != nil { + in, out := &in.DnsServiceIP, &out.DnsServiceIP + *out = new(string) + **out = **in + } + if in.DockerBridgeCidr != nil { + in, out := &in.DockerBridgeCidr, &out.DockerBridgeCidr + *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.ServiceCidr != nil { + in, out := &in.ServiceCidr, &out.ServiceCidr + *out = new(string) + **out = **in + } + if in.SubnetReference != nil { + in, out := &in.SubnetReference, &out.SubnetReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AksNetworkingConfiguration. +func (in *AksNetworkingConfiguration) DeepCopy() *AksNetworkingConfiguration { + if in == nil { + return nil + } + out := new(AksNetworkingConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AmlComputeProperties) DeepCopyInto(out *AmlComputeProperties) { + *out = *in + if in.EnableNodePublicIp != nil { + in, out := &in.EnableNodePublicIp, &out.EnableNodePublicIp + *out = new(bool) + **out = **in + } + if in.IsolatedNetwork != nil { + in, out := &in.IsolatedNetwork, &out.IsolatedNetwork + *out = new(bool) + **out = **in + } + if in.OsType != nil { + in, out := &in.OsType, &out.OsType + *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.RemoteLoginPortPublicAccess != nil { + in, out := &in.RemoteLoginPortPublicAccess, &out.RemoteLoginPortPublicAccess + *out = new(string) + **out = **in + } + if in.ScaleSettings != nil { + in, out := &in.ScaleSettings, &out.ScaleSettings + *out = new(ScaleSettings) + (*in).DeepCopyInto(*out) + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(ResourceId) + (*in).DeepCopyInto(*out) + } + if in.UserAccountCredentials != nil { + in, out := &in.UserAccountCredentials, &out.UserAccountCredentials + *out = new(UserAccountCredentials) + (*in).DeepCopyInto(*out) + } + if in.VirtualMachineImage != nil { + in, out := &in.VirtualMachineImage, &out.VirtualMachineImage + *out = new(VirtualMachineImage) + (*in).DeepCopyInto(*out) + } + if in.VmPriority != nil { + in, out := &in.VmPriority, &out.VmPriority + *out = new(string) + **out = **in + } + if in.VmSize != nil { + in, out := &in.VmSize, &out.VmSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AmlComputeProperties. +func (in *AmlComputeProperties) DeepCopy() *AmlComputeProperties { + if in == nil { + return nil + } + out := new(AmlComputeProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AssignedUser) DeepCopyInto(out *AssignedUser) { + *out = *in + if in.ObjectId != nil { + in, out := &in.ObjectId, &out.ObjectId + *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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssignedUser. +func (in *AssignedUser) DeepCopy() *AssignedUser { + if in == nil { + return nil + } + out := new(AssignedUser) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoPauseProperties) DeepCopyInto(out *AutoPauseProperties) { + *out = *in + if in.DelayInMinutes != nil { + in, out := &in.DelayInMinutes, &out.DelayInMinutes + *out = new(int) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *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 AutoPauseProperties. +func (in *AutoPauseProperties) DeepCopy() *AutoPauseProperties { + if in == nil { + return nil + } + out := new(AutoPauseProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScaleProperties) DeepCopyInto(out *AutoScaleProperties) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.MaxNodeCount != nil { + in, out := &in.MaxNodeCount, &out.MaxNodeCount + *out = new(int) + **out = **in + } + if in.MinNodeCount != nil { + in, out := &in.MinNodeCount, &out.MinNodeCount + *out = new(int) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScaleProperties. +func (in *AutoScaleProperties) DeepCopy() *AutoScaleProperties { + if in == nil { + return nil + } + out := new(AutoScaleProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute) DeepCopyInto(out *Compute) { + *out = *in + if in.AKS != nil { + in, out := &in.AKS, &out.AKS + *out = new(Compute_AKS) + (*in).DeepCopyInto(*out) + } + if in.AmlCompute != nil { + in, out := &in.AmlCompute, &out.AmlCompute + *out = new(Compute_AmlCompute) + (*in).DeepCopyInto(*out) + } + if in.ComputeInstance != nil { + in, out := &in.ComputeInstance, &out.ComputeInstance + *out = new(Compute_ComputeInstance) + (*in).DeepCopyInto(*out) + } + if in.DataFactory != nil { + in, out := &in.DataFactory, &out.DataFactory + *out = new(Compute_DataFactory) + (*in).DeepCopyInto(*out) + } + if in.DataLakeAnalytics != nil { + in, out := &in.DataLakeAnalytics, &out.DataLakeAnalytics + *out = new(Compute_DataLakeAnalytics) + (*in).DeepCopyInto(*out) + } + if in.Databricks != nil { + in, out := &in.Databricks, &out.Databricks + *out = new(Compute_Databricks) + (*in).DeepCopyInto(*out) + } + if in.HDInsight != nil { + in, out := &in.HDInsight, &out.HDInsight + *out = new(Compute_HDInsight) + (*in).DeepCopyInto(*out) + } + 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.SynapseSpark != nil { + in, out := &in.SynapseSpark, &out.SynapseSpark + *out = new(Compute_SynapseSpark) + (*in).DeepCopyInto(*out) + } + if in.VirtualMachine != nil { + in, out := &in.VirtualMachine, &out.VirtualMachine + *out = new(Compute_VirtualMachine) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute. +func (in *Compute) DeepCopy() *Compute { + if in == nil { + return nil + } + out := new(Compute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeInstanceProperties) DeepCopyInto(out *ComputeInstanceProperties) { + *out = *in + if in.ApplicationSharingPolicy != nil { + in, out := &in.ApplicationSharingPolicy, &out.ApplicationSharingPolicy + *out = new(string) + **out = **in + } + if in.ComputeInstanceAuthorizationType != nil { + in, out := &in.ComputeInstanceAuthorizationType, &out.ComputeInstanceAuthorizationType + *out = new(string) + **out = **in + } + if in.PersonalComputeInstanceSettings != nil { + in, out := &in.PersonalComputeInstanceSettings, &out.PersonalComputeInstanceSettings + *out = new(PersonalComputeInstanceSettings) + (*in).DeepCopyInto(*out) + } + 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.SetupScripts != nil { + in, out := &in.SetupScripts, &out.SetupScripts + *out = new(SetupScripts) + (*in).DeepCopyInto(*out) + } + if in.SshSettings != nil { + in, out := &in.SshSettings, &out.SshSettings + *out = new(ComputeInstanceSshSettings) + (*in).DeepCopyInto(*out) + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(ResourceId) + (*in).DeepCopyInto(*out) + } + if in.VmSize != nil { + in, out := &in.VmSize, &out.VmSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeInstanceProperties. +func (in *ComputeInstanceProperties) DeepCopy() *ComputeInstanceProperties { + if in == nil { + return nil + } + out := new(ComputeInstanceProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeInstanceSshSettings) DeepCopyInto(out *ComputeInstanceSshSettings) { + *out = *in + if in.AdminPublicKey != nil { + in, out := &in.AdminPublicKey, &out.AdminPublicKey + *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.SshPublicAccess != nil { + in, out := &in.SshPublicAccess, &out.SshPublicAccess + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeInstanceSshSettings. +func (in *ComputeInstanceSshSettings) DeepCopy() *ComputeInstanceSshSettings { + if in == nil { + return nil + } + out := new(ComputeInstanceSshSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComputeResource_Status) DeepCopyInto(out *ComputeResource_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.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.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Compute_Status) + (*in).DeepCopyInto(*out) + } + 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.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeResource_Status. +func (in *ComputeResource_Status) DeepCopy() *ComputeResource_Status { + if in == nil { + return nil + } + out := new(ComputeResource_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 *Compute_AKS) DeepCopyInto(out *Compute_AKS) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(AKSProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_AKS. +func (in *Compute_AKS) DeepCopy() *Compute_AKS { + if in == nil { + return nil + } + out := new(Compute_AKS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_AmlCompute) DeepCopyInto(out *Compute_AmlCompute) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(AmlComputeProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_AmlCompute. +func (in *Compute_AmlCompute) DeepCopy() *Compute_AmlCompute { + if in == nil { + return nil + } + out := new(Compute_AmlCompute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_ComputeInstance) DeepCopyInto(out *Compute_ComputeInstance) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(ComputeInstanceProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_ComputeInstance. +func (in *Compute_ComputeInstance) DeepCopy() *Compute_ComputeInstance { + if in == nil { + return nil + } + out := new(Compute_ComputeInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_DataFactory) DeepCopyInto(out *Compute_DataFactory) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_DataFactory. +func (in *Compute_DataFactory) DeepCopy() *Compute_DataFactory { + if in == nil { + return nil + } + out := new(Compute_DataFactory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_DataLakeAnalytics) DeepCopyInto(out *Compute_DataLakeAnalytics) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(DataLakeAnalyticsProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_DataLakeAnalytics. +func (in *Compute_DataLakeAnalytics) DeepCopy() *Compute_DataLakeAnalytics { + if in == nil { + return nil + } + out := new(Compute_DataLakeAnalytics) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_Databricks) DeepCopyInto(out *Compute_Databricks) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(DatabricksProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_Databricks. +func (in *Compute_Databricks) DeepCopy() *Compute_Databricks { + if in == nil { + return nil + } + out := new(Compute_Databricks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_HDInsight) DeepCopyInto(out *Compute_HDInsight) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(HDInsightProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_HDInsight. +func (in *Compute_HDInsight) DeepCopy() *Compute_HDInsight { + if in == nil { + return nil + } + out := new(Compute_HDInsight) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_Status) DeepCopyInto(out *Compute_Status) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.CreatedOn != nil { + in, out := &in.CreatedOn, &out.CreatedOn + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.IsAttachedCompute != nil { + in, out := &in.IsAttachedCompute, &out.IsAttachedCompute + *out = new(bool) + **out = **in + } + if in.ModifiedOn != nil { + in, out := &in.ModifiedOn, &out.ModifiedOn + *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.ProvisioningErrors != nil { + in, out := &in.ProvisioningErrors, &out.ProvisioningErrors + *out = make([]ErrorResponse_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(string) + **out = **in + } + if in.ResourceId != nil { + in, out := &in.ResourceId, &out.ResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_Status. +func (in *Compute_Status) DeepCopy() *Compute_Status { + if in == nil { + return nil + } + out := new(Compute_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 *Compute_SynapseSpark) DeepCopyInto(out *Compute_SynapseSpark) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SynapseSparkProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_SynapseSpark. +func (in *Compute_SynapseSpark) DeepCopy() *Compute_SynapseSpark { + if in == nil { + return nil + } + out := new(Compute_SynapseSpark) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Compute_VirtualMachine) DeepCopyInto(out *Compute_VirtualMachine) { + *out = *in + if in.ComputeLocation != nil { + in, out := &in.ComputeLocation, &out.ComputeLocation + *out = new(string) + **out = **in + } + if in.ComputeType != nil { + in, out := &in.ComputeType, &out.ComputeType + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(VirtualMachineProperties) + (*in).DeepCopyInto(*out) + } + 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.ResourceReference != nil { + in, out := &in.ResourceReference, &out.ResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Compute_VirtualMachine. +func (in *Compute_VirtualMachine) DeepCopy() *Compute_VirtualMachine { + if in == nil { + return nil + } + out := new(Compute_VirtualMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CosmosDbSettings) DeepCopyInto(out *CosmosDbSettings) { + *out = *in + if in.CollectionsThroughput != nil { + in, out := &in.CollectionsThroughput, &out.CollectionsThroughput + *out = new(int) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosmosDbSettings. +func (in *CosmosDbSettings) DeepCopy() *CosmosDbSettings { + if in == nil { + return nil + } + out := new(CosmosDbSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CosmosDbSettings_Status) DeepCopyInto(out *CosmosDbSettings_Status) { + *out = *in + if in.CollectionsThroughput != nil { + in, out := &in.CollectionsThroughput, &out.CollectionsThroughput + *out = new(int) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosmosDbSettings_Status. +func (in *CosmosDbSettings_Status) DeepCopy() *CosmosDbSettings_Status { + if in == nil { + return nil + } + out := new(CosmosDbSettings_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 *DataLakeAnalyticsProperties) DeepCopyInto(out *DataLakeAnalyticsProperties) { + *out = *in + if in.DataLakeStoreAccountName != nil { + in, out := &in.DataLakeStoreAccountName, &out.DataLakeStoreAccountName + *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 DataLakeAnalyticsProperties. +func (in *DataLakeAnalyticsProperties) DeepCopy() *DataLakeAnalyticsProperties { + if in == nil { + return nil + } + out := new(DataLakeAnalyticsProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabricksProperties) DeepCopyInto(out *DatabricksProperties) { + *out = *in + if in.DatabricksAccessToken != nil { + in, out := &in.DatabricksAccessToken, &out.DatabricksAccessToken + *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.WorkspaceUrl != nil { + in, out := &in.WorkspaceUrl, &out.WorkspaceUrl + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabricksProperties. +func (in *DatabricksProperties) DeepCopy() *DatabricksProperties { + if in == nil { + return nil + } + out := new(DatabricksProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionProperty) DeepCopyInto(out *EncryptionProperty) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityForCmk) + (*in).DeepCopyInto(*out) + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = new(KeyVaultProperties) + (*in).DeepCopyInto(*out) + } + 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.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionProperty. +func (in *EncryptionProperty) DeepCopy() *EncryptionProperty { + if in == nil { + return nil + } + out := new(EncryptionProperty) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionProperty_Status) DeepCopyInto(out *EncryptionProperty_Status) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(IdentityForCmk_Status) + (*in).DeepCopyInto(*out) + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = new(KeyVaultProperties_Status) + (*in).DeepCopyInto(*out) + } + 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.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionProperty_Status. +func (in *EncryptionProperty_Status) DeepCopy() *EncryptionProperty_Status { + if in == nil { + return nil + } + out := new(EncryptionProperty_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 *ErrorAdditionalInfo_Status) DeepCopyInto(out *ErrorAdditionalInfo_Status) { + *out = *in + if in.Info != nil { + in, out := &in.Info, &out.Info + *out = make(map[string]v1.JSON, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + 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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorAdditionalInfo_Status. +func (in *ErrorAdditionalInfo_Status) DeepCopy() *ErrorAdditionalInfo_Status { + if in == nil { + return nil + } + out := new(ErrorAdditionalInfo_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 *ErrorDetail_Status) DeepCopyInto(out *ErrorDetail_Status) { + *out = *in + if in.AdditionalInfo != nil { + in, out := &in.AdditionalInfo, &out.AdditionalInfo + *out = make([]ErrorAdditionalInfo_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Details != nil { + in, out := &in.Details, &out.Details + *out = make([]ErrorDetail_Status_Unrolled, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *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.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorDetail_Status. +func (in *ErrorDetail_Status) DeepCopy() *ErrorDetail_Status { + if in == nil { + return nil + } + out := new(ErrorDetail_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 *ErrorDetail_Status_Unrolled) DeepCopyInto(out *ErrorDetail_Status_Unrolled) { + *out = *in + if in.AdditionalInfo != nil { + in, out := &in.AdditionalInfo, &out.AdditionalInfo + *out = make([]ErrorAdditionalInfo_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *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.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorDetail_Status_Unrolled. +func (in *ErrorDetail_Status_Unrolled) DeepCopy() *ErrorDetail_Status_Unrolled { + if in == nil { + return nil + } + out := new(ErrorDetail_Status_Unrolled) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorResponse_Status) DeepCopyInto(out *ErrorResponse_Status) { + *out = *in + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(ErrorDetail_Status) + (*in).DeepCopyInto(*out) + } + 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 ErrorResponse_Status. +func (in *ErrorResponse_Status) DeepCopy() *ErrorResponse_Status { + if in == nil { + return nil + } + out := new(ErrorResponse_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 *HDInsightProperties) DeepCopyInto(out *HDInsightProperties) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.AdministratorAccount != nil { + in, out := &in.AdministratorAccount, &out.AdministratorAccount + *out = new(VirtualMachineSshCredentials) + (*in).DeepCopyInto(*out) + } + 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.SshPort != nil { + in, out := &in.SshPort, &out.SshPort + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HDInsightProperties. +func (in *HDInsightProperties) DeepCopy() *HDInsightProperties { + if in == nil { + return nil + } + out := new(HDInsightProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity) DeepCopyInto(out *Identity) { + *out = *in + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]v1.JSON, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// 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 *IdentityForCmk) DeepCopyInto(out *IdentityForCmk) { + *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.UserAssignedIdentity != nil { + in, out := &in.UserAssignedIdentity, &out.UserAssignedIdentity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityForCmk. +func (in *IdentityForCmk) DeepCopy() *IdentityForCmk { + if in == nil { + return nil + } + out := new(IdentityForCmk) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityForCmk_Status) DeepCopyInto(out *IdentityForCmk_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.UserAssignedIdentity != nil { + in, out := &in.UserAssignedIdentity, &out.UserAssignedIdentity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityForCmk_Status. +func (in *IdentityForCmk_Status) DeepCopy() *IdentityForCmk_Status { + if in == nil { + return nil + } + out := new(IdentityForCmk_Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity_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]UserAssignedIdentity_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 *KeyVaultProperties) DeepCopyInto(out *KeyVaultProperties) { + *out = *in + if in.IdentityClientId != nil { + in, out := &in.IdentityClientId, &out.IdentityClientId + *out = new(string) + **out = **in + } + if in.KeyIdentifier != nil { + in, out := &in.KeyIdentifier, &out.KeyIdentifier + *out = new(string) + **out = **in + } + if in.KeyVaultArmId != nil { + in, out := &in.KeyVaultArmId, &out.KeyVaultArmId + *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 KeyVaultProperties. +func (in *KeyVaultProperties) DeepCopy() *KeyVaultProperties { + if in == nil { + return nil + } + out := new(KeyVaultProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyVaultProperties_Status) DeepCopyInto(out *KeyVaultProperties_Status) { + *out = *in + if in.IdentityClientId != nil { + in, out := &in.IdentityClientId, &out.IdentityClientId + *out = new(string) + **out = **in + } + if in.KeyIdentifier != nil { + in, out := &in.KeyIdentifier, &out.KeyIdentifier + *out = new(string) + **out = **in + } + if in.KeyVaultArmId != nil { + in, out := &in.KeyVaultArmId, &out.KeyVaultArmId + *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 KeyVaultProperties_Status. +func (in *KeyVaultProperties_Status) DeepCopy() *KeyVaultProperties_Status { + if in == nil { + return nil + } + out := new(KeyVaultProperties_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 *NotebookPreparationError_Status) DeepCopyInto(out *NotebookPreparationError_Status) { + *out = *in + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *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.StatusCode != nil { + in, out := &in.StatusCode, &out.StatusCode + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotebookPreparationError_Status. +func (in *NotebookPreparationError_Status) DeepCopy() *NotebookPreparationError_Status { + if in == nil { + return nil + } + out := new(NotebookPreparationError_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 *NotebookResourceInfo_Status) DeepCopyInto(out *NotebookResourceInfo_Status) { + *out = *in + if in.Fqdn != nil { + in, out := &in.Fqdn, &out.Fqdn + *out = new(string) + **out = **in + } + if in.NotebookPreparationError != nil { + in, out := &in.NotebookPreparationError, &out.NotebookPreparationError + *out = new(NotebookPreparationError_Status) + (*in).DeepCopyInto(*out) + } + 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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotebookResourceInfo_Status. +func (in *NotebookResourceInfo_Status) DeepCopy() *NotebookResourceInfo_Status { + if in == nil { + return nil + } + out := new(NotebookResourceInfo_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 *PersonalComputeInstanceSettings) DeepCopyInto(out *PersonalComputeInstanceSettings) { + *out = *in + if in.AssignedUser != nil { + in, out := &in.AssignedUser, &out.AssignedUser + *out = new(AssignedUser) + (*in).DeepCopyInto(*out) + } + 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 PersonalComputeInstanceSettings. +func (in *PersonalComputeInstanceSettings) DeepCopy() *PersonalComputeInstanceSettings { + if in == nil { + return nil + } + out := new(PersonalComputeInstanceSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateEndpointConnection_Status_SubResourceEmbedded) DeepCopyInto(out *PrivateEndpointConnection_Status_SubResourceEmbedded) { + *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.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_Status) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateEndpointConnection_Status_SubResourceEmbedded. +func (in *PrivateEndpointConnection_Status_SubResourceEmbedded) DeepCopy() *PrivateEndpointConnection_Status_SubResourceEmbedded { + if in == nil { + return nil + } + out := new(PrivateEndpointConnection_Status_SubResourceEmbedded) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceId) DeepCopyInto(out *ResourceId) { + *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.Reference != nil { + in, out := &in.Reference, &out.Reference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceId. +func (in *ResourceId) DeepCopy() *ResourceId { + if in == nil { + return nil + } + out := new(ResourceId) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleSettings) DeepCopyInto(out *ScaleSettings) { + *out = *in + if in.MaxNodeCount != nil { + in, out := &in.MaxNodeCount, &out.MaxNodeCount + *out = new(int) + **out = **in + } + if in.MinNodeCount != nil { + in, out := &in.MinNodeCount, &out.MinNodeCount + *out = new(int) + **out = **in + } + if in.NodeIdleTimeBeforeScaleDown != nil { + in, out := &in.NodeIdleTimeBeforeScaleDown, &out.NodeIdleTimeBeforeScaleDown + *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 ScaleSettings. +func (in *ScaleSettings) DeepCopy() *ScaleSettings { + if in == nil { + return nil + } + out := new(ScaleSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScriptReference) DeepCopyInto(out *ScriptReference) { + *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.ScriptArguments != nil { + in, out := &in.ScriptArguments, &out.ScriptArguments + *out = new(string) + **out = **in + } + if in.ScriptData != nil { + in, out := &in.ScriptData, &out.ScriptData + *out = new(string) + **out = **in + } + if in.ScriptSource != nil { + in, out := &in.ScriptSource, &out.ScriptSource + *out = new(string) + **out = **in + } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptReference. +func (in *ScriptReference) DeepCopy() *ScriptReference { + if in == nil { + return nil + } + out := new(ScriptReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScriptsToExecute) DeepCopyInto(out *ScriptsToExecute) { + *out = *in + if in.CreationScript != nil { + in, out := &in.CreationScript, &out.CreationScript + *out = new(ScriptReference) + (*in).DeepCopyInto(*out) + } + 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.StartupScript != nil { + in, out := &in.StartupScript, &out.StartupScript + *out = new(ScriptReference) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptsToExecute. +func (in *ScriptsToExecute) DeepCopy() *ScriptsToExecute { + if in == nil { + return nil + } + out := new(ScriptsToExecute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceManagedResourcesSettings) DeepCopyInto(out *ServiceManagedResourcesSettings) { + *out = *in + if in.CosmosDb != nil { + in, out := &in.CosmosDb, &out.CosmosDb + *out = new(CosmosDbSettings) + (*in).DeepCopyInto(*out) + } + 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 ServiceManagedResourcesSettings. +func (in *ServiceManagedResourcesSettings) DeepCopy() *ServiceManagedResourcesSettings { + if in == nil { + return nil + } + out := new(ServiceManagedResourcesSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceManagedResourcesSettings_Status) DeepCopyInto(out *ServiceManagedResourcesSettings_Status) { + *out = *in + if in.CosmosDb != nil { + in, out := &in.CosmosDb, &out.CosmosDb + *out = new(CosmosDbSettings_Status) + (*in).DeepCopyInto(*out) + } + 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 ServiceManagedResourcesSettings_Status. +func (in *ServiceManagedResourcesSettings_Status) DeepCopy() *ServiceManagedResourcesSettings_Status { + if in == nil { + return nil + } + out := new(ServiceManagedResourcesSettings_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 *SetupScripts) DeepCopyInto(out *SetupScripts) { + *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.Scripts != nil { + in, out := &in.Scripts, &out.Scripts + *out = new(ScriptsToExecute) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SetupScripts. +func (in *SetupScripts) DeepCopy() *SetupScripts { + if in == nil { + return nil + } + out := new(SetupScripts) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedPrivateLinkResource_Status) DeepCopyInto(out *SharedPrivateLinkResource_Status) { + *out = *in + if in.GroupId != nil { + in, out := &in.GroupId, &out.GroupId + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateLinkResourceId != nil { + in, out := &in.PrivateLinkResourceId, &out.PrivateLinkResourceId + *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.RequestMessage != nil { + in, out := &in.RequestMessage, &out.RequestMessage + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedPrivateLinkResource_Status. +func (in *SharedPrivateLinkResource_Status) DeepCopy() *SharedPrivateLinkResource_Status { + if in == nil { + return nil + } + out := new(SharedPrivateLinkResource_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 *Sku) DeepCopyInto(out *Sku) { + *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 + } + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku. +func (in *Sku) DeepCopy() *Sku { + if in == nil { + return nil + } + out := new(Sku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sku_Status) DeepCopyInto(out *Sku_Status) { + *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 + } + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku_Status. +func (in *Sku_Status) DeepCopy() *Sku_Status { + if in == nil { + return nil + } + out := new(Sku_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 *SslConfiguration) DeepCopyInto(out *SslConfiguration) { + *out = *in + if in.Cert != nil { + in, out := &in.Cert, &out.Cert + *out = new(string) + **out = **in + } + if in.Cname != nil { + in, out := &in.Cname, &out.Cname + *out = new(string) + **out = **in + } + if in.Key != nil { + in, out := &in.Key, &out.Key + *out = new(string) + **out = **in + } + if in.LeafDomainLabel != nil { + in, out := &in.LeafDomainLabel, &out.LeafDomainLabel + *out = new(string) + **out = **in + } + if in.OverwriteExistingDomain != nil { + in, out := &in.OverwriteExistingDomain, &out.OverwriteExistingDomain + *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.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SslConfiguration. +func (in *SslConfiguration) DeepCopy() *SslConfiguration { + if in == nil { + return nil + } + out := new(SslConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SynapseSparkProperties) DeepCopyInto(out *SynapseSparkProperties) { + *out = *in + if in.AutoPauseProperties != nil { + in, out := &in.AutoPauseProperties, &out.AutoPauseProperties + *out = new(AutoPauseProperties) + (*in).DeepCopyInto(*out) + } + if in.AutoScaleProperties != nil { + in, out := &in.AutoScaleProperties, &out.AutoScaleProperties + *out = new(AutoScaleProperties) + (*in).DeepCopyInto(*out) + } + if in.NodeCount != nil { + in, out := &in.NodeCount, &out.NodeCount + *out = new(int) + **out = **in + } + if in.NodeSize != nil { + in, out := &in.NodeSize, &out.NodeSize + *out = new(string) + **out = **in + } + if in.NodeSizeFamily != nil { + in, out := &in.NodeSizeFamily, &out.NodeSizeFamily + *out = new(string) + **out = **in + } + if in.PoolName != nil { + in, out := &in.PoolName, &out.PoolName + *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.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(string) + **out = **in + } + if in.SparkVersion != nil { + in, out := &in.SparkVersion, &out.SparkVersion + *out = new(string) + **out = **in + } + if in.SubscriptionId != nil { + in, out := &in.SubscriptionId, &out.SubscriptionId + *out = new(string) + **out = **in + } + if in.WorkspaceName != nil { + in, out := &in.WorkspaceName, &out.WorkspaceName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SynapseSparkProperties. +func (in *SynapseSparkProperties) DeepCopy() *SynapseSparkProperties { + if in == nil { + return nil + } + out := new(SynapseSparkProperties) + 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) DeepCopyInto(out *SystemData) { + *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. +func (in *SystemData) DeepCopy() *SystemData { + if in == nil { + return nil + } + out := new(SystemData) + 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 *UserAccountCredentials) DeepCopyInto(out *UserAccountCredentials) { + *out = *in + if in.AdminUserName != nil { + in, out := &in.AdminUserName, &out.AdminUserName + *out = new(string) + **out = **in + } + if in.AdminUserPassword != nil { + in, out := &in.AdminUserPassword, &out.AdminUserPassword + *out = new(genruntime.SecretReference) + **out = **in + } + if in.AdminUserSshPublicKey != nil { + in, out := &in.AdminUserSshPublicKey, &out.AdminUserSshPublicKey + *out = new(genruntime.SecretReference) + **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 UserAccountCredentials. +func (in *UserAccountCredentials) DeepCopy() *UserAccountCredentials { + if in == nil { + return nil + } + out := new(UserAccountCredentials) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentity_Status) DeepCopyInto(out *UserAssignedIdentity_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 + } + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentity_Status. +func (in *UserAssignedIdentity_Status) DeepCopy() *UserAssignedIdentity_Status { + if in == nil { + return nil + } + out := new(UserAssignedIdentity_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 *VirtualMachineImage) DeepCopyInto(out *VirtualMachineImage) { + *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.Reference != nil { + in, out := &in.Reference, &out.Reference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineImage. +func (in *VirtualMachineImage) DeepCopy() *VirtualMachineImage { + if in == nil { + return nil + } + out := new(VirtualMachineImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineProperties) DeepCopyInto(out *VirtualMachineProperties) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.AdministratorAccount != nil { + in, out := &in.AdministratorAccount, &out.AdministratorAccount + *out = new(VirtualMachineSshCredentials) + (*in).DeepCopyInto(*out) + } + if in.IsNotebookInstanceCompute != nil { + in, out := &in.IsNotebookInstanceCompute, &out.IsNotebookInstanceCompute + *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.SshPort != nil { + in, out := &in.SshPort, &out.SshPort + *out = new(int) + **out = **in + } + if in.VirtualMachineSize != nil { + in, out := &in.VirtualMachineSize, &out.VirtualMachineSize + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineProperties. +func (in *VirtualMachineProperties) DeepCopy() *VirtualMachineProperties { + if in == nil { + return nil + } + out := new(VirtualMachineProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineSshCredentials) DeepCopyInto(out *VirtualMachineSshCredentials) { + *out = *in + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(genruntime.SecretReference) + **out = **in + } + if in.PrivateKeyData != nil { + in, out := &in.PrivateKeyData, &out.PrivateKeyData + *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.PublicKeyData != nil { + in, out := &in.PublicKeyData, &out.PublicKeyData + *out = new(string) + **out = **in + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSshCredentials. +func (in *VirtualMachineSshCredentials) DeepCopy() *VirtualMachineSshCredentials { + if in == nil { + return nil + } + out := new(VirtualMachineSshCredentials) + 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 *WorkspaceConnection_Status) DeepCopyInto(out *WorkspaceConnection_Status) { + *out = *in + if in.AuthType != nil { + in, out := &in.AuthType, &out.AuthType + *out = new(string) + **out = **in + } + if in.Category != nil { + in, out := &in.Category, &out.Category + *out = new(string) + **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.Id != nil { + in, out := &in.Id, &out.Id + *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 + } + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.ValueFormat != nil { + in, out := &in.ValueFormat, &out.ValueFormat + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceConnection_Status. +func (in *WorkspaceConnection_Status) DeepCopy() *WorkspaceConnection_Status { + if in == nil { + return nil + } + out := new(WorkspaceConnection_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.AppInsightsInstrumentationKey != nil { + in, out := &in.AppInsightsInstrumentationKey, &out.AppInsightsInstrumentationKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.ContainerRegistryPassword != nil { + in, out := &in.ContainerRegistryPassword, &out.ContainerRegistryPassword + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.ContainerRegistryPassword2 != nil { + in, out := &in.ContainerRegistryPassword2, &out.ContainerRegistryPassword2 + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.ContainerRegistryUserName != nil { + in, out := &in.ContainerRegistryUserName, &out.ContainerRegistryUserName + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryNotebookAccessKey != nil { + in, out := &in.PrimaryNotebookAccessKey, &out.PrimaryNotebookAccessKey + *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.SecondaryNotebookAccessKey != nil { + in, out := &in.SecondaryNotebookAccessKey, &out.SecondaryNotebookAccessKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.UserStorageKey != nil { + in, out := &in.UserStorageKey, &out.UserStorageKey + *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.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + 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 *Workspace_Status) DeepCopyInto(out *Workspace_Status) { + *out = *in + if in.AllowPublicAccessWhenBehindVnet != nil { + in, out := &in.AllowPublicAccessWhenBehindVnet, &out.AllowPublicAccessWhenBehindVnet + *out = new(bool) + **out = **in + } + if in.ApplicationInsights != nil { + in, out := &in.ApplicationInsights, &out.ApplicationInsights + *out = new(string) + **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.ContainerRegistry != nil { + in, out := &in.ContainerRegistry, &out.ContainerRegistry + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DiscoveryUrl != nil { + in, out := &in.DiscoveryUrl, &out.DiscoveryUrl + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(EncryptionProperty_Status) + (*in).DeepCopyInto(*out) + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.HbiWorkspace != nil { + in, out := &in.HbiWorkspace, &out.HbiWorkspace + *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.ImageBuildCompute != nil { + in, out := &in.ImageBuildCompute, &out.ImageBuildCompute + *out = new(string) + **out = **in + } + if in.KeyVault != nil { + in, out := &in.KeyVault, &out.KeyVault + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MlFlowTrackingUri != nil { + in, out := &in.MlFlowTrackingUri, &out.MlFlowTrackingUri + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.NotebookInfo != nil { + in, out := &in.NotebookInfo, &out.NotebookInfo + *out = new(NotebookResourceInfo_Status) + (*in).DeepCopyInto(*out) + } + if in.PrimaryUserAssignedIdentity != nil { + in, out := &in.PrimaryUserAssignedIdentity, &out.PrimaryUserAssignedIdentity + *out = new(string) + **out = **in + } + if in.PrivateEndpointConnections != nil { + in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections + *out = make([]PrivateEndpointConnection_Status_SubResourceEmbedded, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PrivateLinkCount != nil { + in, out := &in.PrivateLinkCount, &out.PrivateLinkCount + *out = new(int) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(string) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(string) + **out = **in + } + if in.ServiceManagedResourcesSettings != nil { + in, out := &in.ServiceManagedResourcesSettings, &out.ServiceManagedResourcesSettings + *out = new(ServiceManagedResourcesSettings_Status) + (*in).DeepCopyInto(*out) + } + if in.ServiceProvisionedResourceGroup != nil { + in, out := &in.ServiceProvisionedResourceGroup, &out.ServiceProvisionedResourceGroup + *out = new(string) + **out = **in + } + if in.SharedPrivateLinkResources != nil { + in, out := &in.SharedPrivateLinkResources, &out.SharedPrivateLinkResources + *out = make([]SharedPrivateLinkResource_Status, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_Status) + (*in).DeepCopyInto(*out) + } + if in.StorageAccount != nil { + in, out := &in.StorageAccount, &out.StorageAccount + *out = new(string) + **out = **in + } + if in.StorageHnsEnabled != nil { + in, out := &in.StorageHnsEnabled, &out.StorageHnsEnabled + *out = new(bool) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_Status) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.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.WorkspaceId != nil { + in, out := &in.WorkspaceId, &out.WorkspaceId + *out = new(string) + **out = **in + } +} + +// 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 *WorkspacesCompute) DeepCopyInto(out *WorkspacesCompute) { + *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 WorkspacesCompute. +func (in *WorkspacesCompute) DeepCopy() *WorkspacesCompute { + if in == nil { + return nil + } + out := new(WorkspacesCompute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesCompute) 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 *WorkspacesComputeList) DeepCopyInto(out *WorkspacesComputeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]WorkspacesCompute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesComputeList. +func (in *WorkspacesComputeList) DeepCopy() *WorkspacesComputeList { + if in == nil { + return nil + } + out := new(WorkspacesComputeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesComputeList) 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 *WorkspacesComputes_Spec) DeepCopyInto(out *WorkspacesComputes_Spec) { + *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.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Compute) + (*in).DeepCopyInto(*out) + } + 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.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData) + (*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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesComputes_Spec. +func (in *WorkspacesComputes_Spec) DeepCopy() *WorkspacesComputes_Spec { + if in == nil { + return nil + } + out := new(WorkspacesComputes_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspacesConnection) DeepCopyInto(out *WorkspacesConnection) { + *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 WorkspacesConnection. +func (in *WorkspacesConnection) DeepCopy() *WorkspacesConnection { + if in == nil { + return nil + } + out := new(WorkspacesConnection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesConnection) 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 *WorkspacesConnectionList) DeepCopyInto(out *WorkspacesConnectionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]WorkspacesConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesConnectionList. +func (in *WorkspacesConnectionList) DeepCopy() *WorkspacesConnectionList { + if in == nil { + return nil + } + out := new(WorkspacesConnectionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkspacesConnectionList) 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 *WorkspacesConnections_Spec) DeepCopyInto(out *WorkspacesConnections_Spec) { + *out = *in + if in.AuthType != nil { + in, out := &in.AuthType, &out.AuthType + *out = new(string) + **out = **in + } + if in.Category != nil { + in, out := &in.Category, &out.Category + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.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.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } + if in.ValueFormat != nil { + in, out := &in.ValueFormat, &out.ValueFormat + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacesConnections_Spec. +func (in *WorkspacesConnections_Spec) DeepCopy() *WorkspacesConnections_Spec { + if in == nil { + return nil + } + out := new(WorkspacesConnections_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspaces_Spec) DeepCopyInto(out *Workspaces_Spec) { + *out = *in + if in.AllowPublicAccessWhenBehindVnet != nil { + in, out := &in.AllowPublicAccessWhenBehindVnet, &out.AllowPublicAccessWhenBehindVnet + *out = new(bool) + **out = **in + } + if in.ApplicationInsightsReference != nil { + in, out := &in.ApplicationInsightsReference, &out.ApplicationInsightsReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.ContainerRegistryReference != nil { + in, out := &in.ContainerRegistryReference, &out.ContainerRegistryReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DiscoveryUrl != nil { + in, out := &in.DiscoveryUrl, &out.DiscoveryUrl + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(EncryptionProperty) + (*in).DeepCopyInto(*out) + } + if in.FriendlyName != nil { + in, out := &in.FriendlyName, &out.FriendlyName + *out = new(string) + **out = **in + } + if in.HbiWorkspace != nil { + in, out := &in.HbiWorkspace, &out.HbiWorkspace + *out = new(bool) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.ImageBuildCompute != nil { + in, out := &in.ImageBuildCompute, &out.ImageBuildCompute + *out = new(string) + **out = **in + } + if in.KeyVaultReference != nil { + in, out := &in.KeyVaultReference, &out.KeyVaultReference + *out = new(genruntime.ResourceReference) + **out = **in + } + 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.PrimaryUserAssignedIdentityReference != nil { + in, out := &in.PrimaryUserAssignedIdentityReference, &out.PrimaryUserAssignedIdentityReference + *out = new(genruntime.ResourceReference) + **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.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(string) + **out = **in + } + if in.ServiceManagedResourcesSettings != nil { + in, out := &in.ServiceManagedResourcesSettings, &out.ServiceManagedResourcesSettings + *out = new(ServiceManagedResourcesSettings) + (*in).DeepCopyInto(*out) + } + if in.SharedPrivateLinkResources != nil { + in, out := &in.SharedPrivateLinkResources, &out.SharedPrivateLinkResources + *out = make([]Workspaces_Spec_Properties_SharedPrivateLinkResources, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku) + (*in).DeepCopyInto(*out) + } + if in.StorageAccountReference != nil { + in, out := &in.StorageAccountReference, &out.StorageAccountReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData) + (*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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspaces_Spec. +func (in *Workspaces_Spec) DeepCopy() *Workspaces_Spec { + if in == nil { + return nil + } + out := new(Workspaces_Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workspaces_Spec_Properties_SharedPrivateLinkResources) DeepCopyInto(out *Workspaces_Spec_Properties_SharedPrivateLinkResources) { + *out = *in + if in.GroupId != nil { + in, out := &in.GroupId, &out.GroupId + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateLinkResourceReference != nil { + in, out := &in.PrivateLinkResourceReference, &out.PrivateLinkResourceReference + *out = new(genruntime.ResourceReference) + **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.RequestMessage != nil { + in, out := &in.RequestMessage, &out.RequestMessage + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workspaces_Spec_Properties_SharedPrivateLinkResources. +func (in *Workspaces_Spec_Properties_SharedPrivateLinkResources) DeepCopy() *Workspaces_Spec_Properties_SharedPrivateLinkResources { + if in == nil { + return nil + } + out := new(Workspaces_Spec_Properties_SharedPrivateLinkResources) + in.DeepCopyInto(out) + return out +} diff --git a/v2/api/machinelearningservices/versions_matrix.md b/v2/api/machinelearningservices/versions_matrix.md new file mode 100644 index 0000000000..6f5532a60b --- /dev/null +++ b/v2/api/machinelearningservices/versions_matrix.md @@ -0,0 +1,113 @@ +| Type Definitions in package "machinelearningservices" | v1beta20210701 | +|-----------------------------------------------------------|----------------| +| AKSProperties | v1beta20210701 | +| AKSPropertiesClusterPurpose | v1beta20210701 | +| AKSPropertiesLoadBalancerType | v1beta20210701 | +| APIVersion | v1beta20210701 | +| AksNetworkingConfiguration | v1beta20210701 | +| AmlComputeProperties | v1beta20210701 | +| AmlComputePropertiesOsType | v1beta20210701 | +| AmlComputePropertiesRemoteLoginPortPublicAccess | v1beta20210701 | +| AmlComputePropertiesVmPriority | v1beta20210701 | +| AssignedUser | v1beta20210701 | +| AutoPauseProperties | v1beta20210701 | +| AutoScaleProperties | v1beta20210701 | +| Compute | v1beta20210701 | +| ComputeAKSComputeType | v1beta20210701 | +| ComputeAmlComputeComputeType | v1beta20210701 | +| ComputeComputeInstanceComputeType | v1beta20210701 | +| ComputeDataFactoryComputeType | v1beta20210701 | +| ComputeDataLakeAnalyticsComputeType | v1beta20210701 | +| ComputeDatabricksComputeType | v1beta20210701 | +| ComputeHDInsightComputeType | v1beta20210701 | +| ComputeInstanceProperties | v1beta20210701 | +| ComputeInstancePropertiesApplicationSharingPolicy | v1beta20210701 | +| ComputeInstancePropertiesComputeInstanceAuthorizationType | v1beta20210701 | +| ComputeInstanceSshSettings | v1beta20210701 | +| ComputeInstanceSshSettingsSshPublicAccess | v1beta20210701 | +| ComputeResource_Status | v1beta20210701 | +| ComputeStatusProvisioningState | v1beta20210701 | +| ComputeSynapseSparkComputeType | v1beta20210701 | +| ComputeType_Status | v1beta20210701 | +| ComputeVirtualMachineComputeType | v1beta20210701 | +| Compute_AKS | v1beta20210701 | +| Compute_AmlCompute | v1beta20210701 | +| Compute_ComputeInstance | v1beta20210701 | +| Compute_DataFactory | v1beta20210701 | +| Compute_DataLakeAnalytics | v1beta20210701 | +| Compute_Databricks | v1beta20210701 | +| Compute_HDInsight | v1beta20210701 | +| Compute_Status | v1beta20210701 | +| Compute_SynapseSpark | v1beta20210701 | +| Compute_VirtualMachine | v1beta20210701 | +| CosmosDbSettings | v1beta20210701 | +| CosmosDbSettings_Status | v1beta20210701 | +| DataLakeAnalyticsProperties | v1beta20210701 | +| DatabricksProperties | v1beta20210701 | +| EncryptionProperty | v1beta20210701 | +| EncryptionPropertyStatus | v1beta20210701 | +| EncryptionPropertyStatusStatus | v1beta20210701 | +| EncryptionProperty_Status | v1beta20210701 | +| ErrorAdditionalInfo_Status | v1beta20210701 | +| ErrorDetail_Status | v1beta20210701 | +| ErrorDetail_Status_Unrolled | v1beta20210701 | +| ErrorResponse_Status | v1beta20210701 | +| HDInsightProperties | v1beta20210701 | +| Identity | v1beta20210701 | +| IdentityForCmk | v1beta20210701 | +| IdentityForCmk_Status | v1beta20210701 | +| IdentityStatusType | v1beta20210701 | +| IdentityType | v1beta20210701 | +| Identity_Status | v1beta20210701 | +| KeyVaultProperties | v1beta20210701 | +| KeyVaultProperties_Status | v1beta20210701 | +| NotebookPreparationError_Status | v1beta20210701 | +| NotebookResourceInfo_Status | v1beta20210701 | +| PersonalComputeInstanceSettings | v1beta20210701 | +| PrivateEndpointConnection_Status_SubResourceEmbedded | v1beta20210701 | +| PrivateEndpointServiceConnectionStatus_Status | v1beta20210701 | +| ResourceId | v1beta20210701 | +| ScaleSettings | v1beta20210701 | +| ScriptReference | v1beta20210701 | +| ScriptsToExecute | v1beta20210701 | +| ServiceManagedResourcesSettings | v1beta20210701 | +| ServiceManagedResourcesSettings_Status | v1beta20210701 | +| SetupScripts | v1beta20210701 | +| SharedPrivateLinkResourceProperty | v1beta20210701 | +| SharedPrivateLinkResourcePropertyStatus | v1beta20210701 | +| SharedPrivateLinkResourceProperty_Status | v1beta20210701 | +| SharedPrivateLinkResource_Status | v1beta20210701 | +| Sku | v1beta20210701 | +| Sku_Status | v1beta20210701 | +| SslConfiguration | v1beta20210701 | +| SslConfigurationStatus | v1beta20210701 | +| SynapseSparkProperties | v1beta20210701 | +| SystemData | v1beta20210701 | +| SystemDataCreatedByType | v1beta20210701 | +| SystemDataLastModifiedByType | v1beta20210701 | +| SystemDataStatusCreatedByType | v1beta20210701 | +| SystemDataStatusLastModifiedByType | v1beta20210701 | +| SystemData_Status | v1beta20210701 | +| UserAccountCredentials | v1beta20210701 | +| UserAssignedIdentity_Status | v1beta20210701 | +| VirtualMachineImage | v1beta20210701 | +| VirtualMachineProperties | v1beta20210701 | +| VirtualMachineSshCredentials | v1beta20210701 | +| Workspace | v1beta20210701 | +| WorkspaceConnectionProps | v1beta20210701 | +| WorkspaceConnectionPropsStatusValueFormat | v1beta20210701 | +| WorkspaceConnectionPropsValueFormat | v1beta20210701 | +| WorkspaceConnectionProps_Status | v1beta20210701 | +| WorkspaceConnection_Status | v1beta20210701 | +| WorkspacePropertiesStatusProvisioningState | v1beta20210701 | +| WorkspacePropertiesStatusPublicNetworkAccess | v1beta20210701 | +| WorkspaceProperties_Status | v1beta20210701 | +| Workspace_Status | v1beta20210701 | +| WorkspacesCompute | v1beta20210701 | +| WorkspacesComputes_Spec | v1beta20210701 | +| WorkspacesConnection | v1beta20210701 | +| WorkspacesConnections_Spec | v1beta20210701 | +| WorkspacesSpecPropertiesPublicNetworkAccess | v1beta20210701 | +| Workspaces_Spec | v1beta20210701 | +| Workspaces_Spec_Properties | v1beta20210701 | +| Workspaces_Spec_Properties_SharedPrivateLinkResources | v1beta20210701 | diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index ffd995cfbd..ececb4458a 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -1039,6 +1039,83 @@ objectModelConfiguration: UserAssignedIdentity: $export: true $supportedFrom: v2.0.0-alpha.1 + machinelearningservices: + 2021-07-01: + Workspace: + $export: true + $supportedFrom: v2.0.0-beta.2 + $azureGeneratedSecrets: + - AppInsightsInstrumentationKey + - ContainerRegistryUserName + - ContainerRegistryPassword + - ContainerRegistryPassword2 + - PrimaryNotebookAccessKey + - SecondaryNotebookAccessKey + - UserStorageKey + Workspaces_Spec_Properties: + ApplicationInsights: + $armReference: true + PrimaryUserAssignedIdentity: + $armReference: true + StorageAccount: + $armReference: true + KeyVault: + $armReference: true + ContainerRegistry: + $armReference: true + SharedPrivateLinkResourceProperty: + PrivateLinkResourceId: + $armReference: true + WorkspacesCompute: + $export: true + $supportedFrom: v2.0.0-beta.2 + VirtualMachineImage: + Id: + $armReference: true + Compute_HDInsight: + ResourceId: + $armReference: true + ResourceId: + Id: + $armReference: true + Compute_DataLakeAnalytics: + ResourceId: + $armReference: true + AksNetworkingConfiguration: + SubnetId: + $armReference: true + Compute_Databricks: + ResourceId: + $armReference: true + Compute_DataFactory: + ResourceId: + $armReference: true + Compute_AKS: + ResourceId: + $armReference: true + Compute_ComputeInstance: + ResourceId: + $armReference: true + Compute_SynapseSpark: + ResourceId: + $armReference: true + Compute_AmlCompute: + ResourceId: + $armReference: true + Compute_VirtualMachine: + ResourceId: + $armReference: true + UserAccountCredentials: + AdminUserPassword: + $isSecret: true + AdminUserSshPublicKey: + $isSecret: true + VirtualMachineSshCredentials: + Password: + $isSecret: true + WorkspacesConnection: + $export: true + $supportedFrom: v2.0.0-beta.2 network: 2020-11-01: LoadBalancer: diff --git a/v2/config/samples/machinelearningservices/v1beta20210701_workspace.yaml b/v2/config/samples/machinelearningservices/v1beta20210701_workspace.yaml new file mode 100644 index 0000000000..487e622249 --- /dev/null +++ b/v2/config/samples/machinelearningservices/v1beta20210701_workspace.yaml @@ -0,0 +1,47 @@ +apiVersion: machinelearningservices.azure.com/v1beta20210701 +kind: Workspace +metadata: + name: sampleworkspaces + namespace: default +spec: + location: westcentralus + owner: + name: aso-sample-rg + sku: + name: Standard_S1 + tier: Basic + allowPublicAccessWhenBehindVnet: false + identity: + type: SystemAssigned + storageAccountReference: + group: "storage.azure.com" + kind: "StorageAccount" + name: "samplekubestorage" + keyVaultReference: + group: "keyvault.azure.com" + kind: "Vault" + name: "samplevault" + # Optional: Save the keys for the storage account into a Kubernetes secret + operatorSpec: + secrets: + appInsightsInstrumentationKey: + name: workspace-secret + key: appInsightsInstrumentationKey + containerRegistryPassword: + name: workspace-secret + key: containerRegistryPassword + containerRegistryPassword2: + name: workspace-secret + key: containerRegistryPassword2 + containerRegistryUserName: + name: workspace-secret + key: containerRegistryUserName + primaryNotebookAccessKey: + name: workspace-secret + key: primaryNotebookAccessKey + secondaryNotebookAccessKey: + name: workspace-secret + key: secondaryNotebookAccessKey + userStorageKey: + name: workspace-secret + key: userStorageKey diff --git a/v2/config/samples/machinelearningservices/v1beta20210701_workspacescompute.yaml b/v2/config/samples/machinelearningservices/v1beta20210701_workspacescompute.yaml new file mode 100644 index 0000000000..5e9a61ff75 --- /dev/null +++ b/v2/config/samples/machinelearningservices/v1beta20210701_workspacescompute.yaml @@ -0,0 +1,25 @@ +apiVersion: machinelearningservices.azure.com/v1beta20210701 +kind: WorkspacesCompute +metadata: + name: sampleworkspacescompute + namespace: default +spec: + location: westcentralus + owner: + name: aso-sample-rg + sku: + name: Standard_S1 + tier: Basic + properties: + virtualMachine: + computeLocation: westcentralus + computeType: VirtualMachine + disableLocalAuth: true + ResourceId: "" + properties: + sshPort: 22 + administratorAccount: + username: admin + password: # This is the name/key of a Kubernetes secret in the same namespace + name: vm-admin-pw + key: password diff --git a/v2/config/samples/machinelearningservices/v1beta20210701_workspacesconnection.yaml b/v2/config/samples/machinelearningservices/v1beta20210701_workspacesconnection.yaml new file mode 100644 index 0000000000..3397a39b64 --- /dev/null +++ b/v2/config/samples/machinelearningservices/v1beta20210701_workspacesconnection.yaml @@ -0,0 +1,14 @@ +apiVersion: machinelearningservices.azure.com/v1beta20210701 +kind: WorkspacesConnection +metadata: + name: sampleworkspacesconnection + namespace: default +spec: + location: westcentralus + owner: + name: aso-sample-rg + authType: PAT + category: ACR + target: www.sample.com + value: "{}" + valueFormat: JSON diff --git a/v2/go.mod b/v2/go.mod index 5d5c8c8df7..3b5ea7a2ca 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -7,6 +7,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.0.0 github.com/Azure/go-autorest/autorest/to v0.4.0 diff --git a/v2/go.sum b/v2/go.sum index 4cd75e071e..85f69d3a15 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -49,6 +49,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontai github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0 h1:Fv8iibGn1eSw0lt2V3cTsuokBEnOP+M//n8OiMcCgTM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0/go.mod h1:Qpe/qN9d5IQ7WPtTXMRCd6+BWTnhi3sxXVys6oJ5Vho= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0 h1:KWvCVjnOTKCZAlqED5KPNoN9AfcK2BhUeveLdiwy33Q= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0/go.mod h1:qNN4I5AKYbXMLriS9XKebBw8EVIQkX6tJzrdtjOoJ4I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis v1.0.0 h1:nmpTBgRg1HynngFYICRhceC7s5dmbKN9fJ/XQz/UQ2I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redis/armredis v1.0.0/go.mod h1:3yjiOtnkVociBTlF7UZrwAGfJrGaOCsvtVS4HzNajxQ= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= diff --git a/v2/internal/config/vars.go b/v2/internal/config/vars.go index 87e125cb3b..c7922c98dc 100644 --- a/v2/internal/config/vars.go +++ b/v2/internal/config/vars.go @@ -14,6 +14,7 @@ import ( const ( SubscriptionIDVar = "AZURE_SUBSCRIPTION_ID" + TenantIDVar = "AZURE_TENANT_ID" targetNamespacesVar = "AZURE_TARGET_NAMESPACES" operatorModeVar = "AZURE_OPERATOR_MODE" syncPeriodVar = "AZURE_SYNC_PERIOD" diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index 797306a289..0b619221f2 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -92,6 +92,9 @@ import ( keyvault_customizations "github.com/Azure/azure-service-operator/v2/api/keyvault/customizations" keyvault_v20210401p "github.com/Azure/azure-service-operator/v2/api/keyvault/v1beta20210401preview" keyvault_v20210401ps "github.com/Azure/azure-service-operator/v2/api/keyvault/v1beta20210401previewstorage" + machinelearningservices_customizations "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/customizations" + machinelearningservices_v20210701 "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701" + machinelearningservices_v20210701s "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701storage" managedidentity_customizations "github.com/Azure/azure-service-operator/v2/api/managedidentity/customizations" managedidentity_alpha20181130 "github.com/Azure/azure-service-operator/v2/api/managedidentity/v1alpha1api20181130" managedidentity_alpha20181130s "github.com/Azure/azure-service-operator/v2/api/managedidentity/v1alpha1api20181130storage" @@ -459,6 +462,43 @@ func getKnownStorageTypes() []*registration.StorageType { Indexes: []registration.Index{}, Watches: []registration.Watch{}, }) + result = append(result, ®istration.StorageType{ + Obj: new(machinelearningservices_v20210701s.Workspace), + Indexes: []registration.Index{}, + Watches: []registration.Watch{}, + }) + result = append(result, ®istration.StorageType{ + Obj: new(machinelearningservices_v20210701s.WorkspacesCompute), + Indexes: []registration.Index{ + { + Key: ".spec.properties.amlCompute.properties.userAccountCredentials.adminUserPassword", + Func: indexMachinelearningservicesWorkspacesComputeAdminUserPassword, + }, + { + Key: ".spec.properties.amlCompute.properties.userAccountCredentials.adminUserSshPublicKey", + Func: indexMachinelearningservicesWorkspacesComputeAdminUserSshPublicKey, + }, + { + Key: ".spec.properties.hdInsight.properties.administratorAccount.password", + Func: indexMachinelearningservicesWorkspacesComputeHDInsightPassword, + }, + { + Key: ".spec.properties.virtualMachine.properties.administratorAccount.password", + Func: indexMachinelearningservicesWorkspacesComputeVirtualMachinePassword, + }, + }, + Watches: []registration.Watch{ + { + Src: &source.Kind{Type: &v1.Secret{}}, + MakeEventHandler: watchSecretsFactory([]string{".spec.properties.amlCompute.properties.userAccountCredentials.adminUserPassword", ".spec.properties.amlCompute.properties.userAccountCredentials.adminUserSshPublicKey", ".spec.properties.hdInsight.properties.administratorAccount.password", ".spec.properties.virtualMachine.properties.administratorAccount.password"}, &machinelearningservices_v20210701s.WorkspacesComputeList{}), + }, + }, + }) + result = append(result, ®istration.StorageType{ + Obj: new(machinelearningservices_v20210701s.WorkspacesConnection), + Indexes: []registration.Index{}, + Watches: []registration.Watch{}, + }) result = append(result, ®istration.StorageType{ Obj: new(managedidentity_v20181130s.UserAssignedIdentity), Indexes: []registration.Index{}, @@ -778,6 +818,12 @@ func getKnownTypes() []client.Object { result = append(result, new(insights_v20200202s.Component)) result = append(result, new(keyvault_v20210401p.Vault)) result = append(result, new(keyvault_v20210401ps.Vault)) + result = append(result, new(machinelearningservices_v20210701.Workspace)) + result = append(result, new(machinelearningservices_v20210701.WorkspacesCompute)) + result = append(result, new(machinelearningservices_v20210701.WorkspacesConnection)) + result = append(result, new(machinelearningservices_v20210701s.Workspace)) + result = append(result, new(machinelearningservices_v20210701s.WorkspacesCompute)) + result = append(result, new(machinelearningservices_v20210701s.WorkspacesConnection)) result = append(result, new(managedidentity_alpha20181130.UserAssignedIdentity)) result = append(result, new(managedidentity_alpha20181130s.UserAssignedIdentity)) result = append(result, new(managedidentity_v20181130.UserAssignedIdentity)) @@ -945,6 +991,8 @@ func createScheme() *runtime.Scheme { _ = insights_v20200202s.AddToScheme(scheme) _ = keyvault_v20210401p.AddToScheme(scheme) _ = keyvault_v20210401ps.AddToScheme(scheme) + _ = machinelearningservices_v20210701.AddToScheme(scheme) + _ = machinelearningservices_v20210701s.AddToScheme(scheme) _ = managedidentity_alpha20181130.AddToScheme(scheme) _ = managedidentity_alpha20181130s.AddToScheme(scheme) _ = managedidentity_v20181130.AddToScheme(scheme) @@ -1028,6 +1076,9 @@ func getResourceExtensions() []genruntime.ResourceExtension { result = append(result, &insights_customizations.ComponentExtension{}) result = append(result, &insights_customizations.WebtestExtension{}) result = append(result, &keyvault_customizations.VaultExtension{}) + result = append(result, &machinelearningservices_customizations.WorkspaceExtension{}) + result = append(result, &machinelearningservices_customizations.WorkspacesComputeExtension{}) + result = append(result, &machinelearningservices_customizations.WorkspacesConnectionExtension{}) result = append(result, &managedidentity_customizations.UserAssignedIdentityExtension{}) result = append(result, &network_customizations.LoadBalancerExtension{}) result = append(result, &network_customizations.NetworkInterfaceExtension{}) @@ -1144,3 +1195,99 @@ func indexDbforpostgresqlFlexibleServerAdministratorLoginPassword(rawObj client. } return []string{obj.Spec.AdministratorLoginPassword.Name} } + +// indexMachinelearningservicesWorkspacesComputeAdminUserPassword an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.amlCompute.properties.userAccountCredentials.adminUserPassword +func indexMachinelearningservicesWorkspacesComputeAdminUserPassword(rawObj client.Object) []string { + obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute) + if !ok { + return nil + } + if obj.Spec.Properties == nil { + return nil + } + if obj.Spec.Properties.AmlCompute == nil { + return nil + } + if obj.Spec.Properties.AmlCompute.Properties == nil { + return nil + } + if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials == nil { + return nil + } + if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserPassword == nil { + return nil + } + return []string{obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserPassword.Name} +} + +// indexMachinelearningservicesWorkspacesComputeAdminUserSshPublicKey an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.amlCompute.properties.userAccountCredentials.adminUserSshPublicKey +func indexMachinelearningservicesWorkspacesComputeAdminUserSshPublicKey(rawObj client.Object) []string { + obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute) + if !ok { + return nil + } + if obj.Spec.Properties == nil { + return nil + } + if obj.Spec.Properties.AmlCompute == nil { + return nil + } + if obj.Spec.Properties.AmlCompute.Properties == nil { + return nil + } + if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials == nil { + return nil + } + if obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserSshPublicKey == nil { + return nil + } + return []string{obj.Spec.Properties.AmlCompute.Properties.UserAccountCredentials.AdminUserSshPublicKey.Name} +} + +// indexMachinelearningservicesWorkspacesComputeHDInsightPassword an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.hdInsight.properties.administratorAccount.password +func indexMachinelearningservicesWorkspacesComputeHDInsightPassword(rawObj client.Object) []string { + obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute) + if !ok { + return nil + } + if obj.Spec.Properties == nil { + return nil + } + if obj.Spec.Properties.HDInsight == nil { + return nil + } + if obj.Spec.Properties.HDInsight.Properties == nil { + return nil + } + if obj.Spec.Properties.HDInsight.Properties.AdministratorAccount == nil { + return nil + } + if obj.Spec.Properties.HDInsight.Properties.AdministratorAccount.Password == nil { + return nil + } + return []string{obj.Spec.Properties.HDInsight.Properties.AdministratorAccount.Password.Name} +} + +// indexMachinelearningservicesWorkspacesComputeVirtualMachinePassword an index function for machinelearningservices_v20210701s.WorkspacesCompute .spec.properties.virtualMachine.properties.administratorAccount.password +func indexMachinelearningservicesWorkspacesComputeVirtualMachinePassword(rawObj client.Object) []string { + obj, ok := rawObj.(*machinelearningservices_v20210701s.WorkspacesCompute) + if !ok { + return nil + } + if obj.Spec.Properties == nil { + return nil + } + if obj.Spec.Properties.VirtualMachine == nil { + return nil + } + if obj.Spec.Properties.VirtualMachine.Properties == nil { + return nil + } + if obj.Spec.Properties.VirtualMachine.Properties.AdministratorAccount == nil { + return nil + } + if obj.Spec.Properties.VirtualMachine.Properties.AdministratorAccount.Password == nil { + return nil + } + return []string{obj.Spec.Properties.VirtualMachine.Properties.AdministratorAccount.Password.Name} +} diff --git a/v2/internal/controllers/crd_compute_vmss_test.go b/v2/internal/controllers/crd_compute_vmss_test.go index 36bb7f47db..fbdada064f 100644 --- a/v2/internal/controllers/crd_compute_vmss_test.go +++ b/v2/internal/controllers/crd_compute_vmss_test.go @@ -235,9 +235,16 @@ func Test_Compute_VMSS_CRUD(t *testing.T) { tc.PatchResourceAndWait(old, vmss) tc.Expect(vmss.Status.VirtualMachineProfile).ToNot(BeNil()) tc.Expect(vmss.Status.VirtualMachineProfile.ExtensionProfile).ToNot(BeNil()) - tc.Expect(vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions).To(HaveLen(1)) - tc.Expect(vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions[0].Name).ToNot(BeNil()) - tc.Expect(*vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions[0].Name).To(Equal(extensionName)) + tc.Expect(len(vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions)).To(BeNumerically(">", 0)) + + found := false + for _, extension := range vmss.Status.VirtualMachineProfile.ExtensionProfile.Extensions { + tc.Expect(extension.Name).ToNot(BeNil()) + if *extension.Name == extensionName { + found = true + } + } + tc.Expect(found).To(BeTrue()) // Delete VMSS tc.DeleteResourceAndWait(vmss) diff --git a/v2/internal/controllers/crd_keyvault_test.go b/v2/internal/controllers/crd_keyvault_test.go index 949e37e1f1..fe363cef8f 100644 --- a/v2/internal/controllers/crd_keyvault_test.go +++ b/v2/internal/controllers/crd_keyvault_test.go @@ -35,33 +35,28 @@ func newVault(tc *testcommon.KubePerTestContext, rg *resources.ResourceGroup) *k skuFamily := keyvault.SkuFamilyA skuName := keyvault.SkuNameStandard - //TODO: This value here is a random generated string to comply with `^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$` regex. - // Tried random generator here which gets stored in the recordings and going to differ on each run resulting in test failure. - // We kinda need some static value here - str := "1C793267-c310-d4ae-7BD5-5Af5BEF875D3" - return &keyvault.Vault{ - ObjectMeta: tc.MakeObjectMeta("keyvau"), + ObjectMeta: tc.MakeObjectMeta("keyvault"), Spec: keyvault.Vaults_Spec{ Location: tc.AzureRegion, Owner: testcommon.AsOwner(rg), Properties: &keyvault.VaultProperties{ AccessPolicies: []keyvault.AccessPolicyEntry{{ - ApplicationId: to.StringPtr(str), - ObjectId: to.StringPtr(str), + ApplicationId: to.StringPtr(tc.AzureTenant), + ObjectId: to.StringPtr(tc.AzureTenant), Permissions: &keyvault.Permissions{ Certificates: []keyvault.PermissionsCertificates{keyvault.PermissionsCertificatesGet}, Keys: []keyvault.PermissionsKeys{keyvault.PermissionsKeysGet}, Secrets: []keyvault.PermissionsSecrets{keyvault.PermissionsSecretsGet}, Storage: []keyvault.PermissionsStorage{keyvault.PermissionsStorageGet}, }, - TenantId: to.StringPtr(str), + TenantId: to.StringPtr(tc.AzureTenant), }}, Sku: &keyvault.Sku{ Family: &skuFamily, Name: &skuName, }, - TenantId: to.StringPtr(str), + TenantId: to.StringPtr(tc.AzureTenant), }, }, } diff --git a/v2/internal/controllers/crd_machinelearningservices_test.go b/v2/internal/controllers/crd_machinelearningservices_test.go new file mode 100644 index 0000000000..d6b11da6db --- /dev/null +++ b/v2/internal/controllers/crd_machinelearningservices_test.go @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +package controllers_test + +import ( + "testing" + + "github.com/Azure/azure-service-operator/v2/api/compute/v1beta20201201" + "github.com/Azure/azure-service-operator/v2/api/keyvault/v1beta20210401preview" + machinelearningservices "github.com/Azure/azure-service-operator/v2/api/machinelearningservices/v1beta20210701" + network "github.com/Azure/azure-service-operator/v2/api/network/v1beta20201101" + resources "github.com/Azure/azure-service-operator/v2/api/resources/v1beta20200601" + storage "github.com/Azure/azure-service-operator/v2/api/storage/v1beta20210401" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/go-autorest/autorest/to" +) + +func Test_MachineLearning_Workspaces_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + sa := newStorageAccount(tc, rg) + + tc.CreateResourceAndWait(sa) + + kv := newVault(tc, rg) + tc.CreateResourceAndWait(kv) + + // Have to use 'eastus' location here as 'ListKeys' API is unavailable/still broken for 'westus2' + workspace := newWorkspace(tc, testcommon.AsOwner(rg), sa, kv, to.StringPtr("eastus")) + + tc.CreateResourcesAndWait(workspace) + + tc.RunSubtests( + testcommon.Subtest{ + Name: "WriteWorkspacesSecrets", + Test: func(tc *testcommon.KubePerTestContext) { + Workspaces_WriteSecrets(tc, workspace) + }, + }) + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "Test_WorkspaceCompute_CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + WorkspaceCompute_CRUD(tc, testcommon.AsOwner(workspace), rg) + }, + }, + testcommon.Subtest{ + Name: "Test_WorkspaceConnection_CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + WorkspaceConnection_CRUD(tc, workspace) + }, + }, + ) + + tc.DeleteResourcesAndWait(workspace, kv, sa, rg) +} + +func Workspaces_WriteSecrets(tc *testcommon.KubePerTestContext, workspace *machinelearningservices.Workspace) { + old := workspace.DeepCopy() + workspaceKeysSecret := "workspacekeyssecret" + workspace.Spec.OperatorSpec = &machinelearningservices.WorkspaceOperatorSpec{ + Secrets: &machinelearningservices.WorkspaceOperatorSecrets{ + PrimaryNotebookAccessKey: &genruntime.SecretDestination{Name: workspaceKeysSecret, Key: "primaryNotebookAccessKey"}, + SecondaryNotebookAccessKey: &genruntime.SecretDestination{Name: workspaceKeysSecret, Key: "secondaryNotebookAccessKey"}, + UserStorageKey: &genruntime.SecretDestination{Name: workspaceKeysSecret, Key: "userStorageKey"}, + }, + } + tc.PatchResourceAndWait(old, workspace) + + tc.ExpectSecretHasKeys( + workspaceKeysSecret, + "primaryNotebookAccessKey", + "secondaryNotebookAccessKey", + "userStorageKey") +} + +func newWorkspace(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, sa *storage.StorageAccount, kv *v1beta20210401preview.Vault, location *string) *machinelearningservices.Workspace { + identityType := machinelearningservices.IdentityTypeSystemAssigned + + workspaces := &machinelearningservices.Workspace{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.NoSpaceNamer.GenerateName("work")), + Spec: machinelearningservices.Workspaces_Spec{ + Location: location, + Owner: owner, + Sku: &machinelearningservices.Sku{ + Name: to.StringPtr("Standard_S1"), + Tier: to.StringPtr("Basic"), + }, + AllowPublicAccessWhenBehindVnet: to.BoolPtr(false), + Identity: &machinelearningservices.Identity{ + Type: &identityType, + }, + StorageAccountReference: tc.MakeReferenceFromResource(sa), + KeyVaultReference: tc.MakeReferenceFromResource(kv), + }, + } + return workspaces +} + +func WorkspaceConnection_CRUD(tc *testcommon.KubePerTestContext, workspaces *machinelearningservices.Workspace) { + + jsonValue := "{\"foo\":\"bar\", \"baz\":\"bee\"}" + valueFormat := machinelearningservices.WorkspaceConnectionPropsValueFormatJSON + + connection := &machinelearningservices.WorkspacesConnection{ + ObjectMeta: tc.MakeObjectMeta("conn"), + Spec: machinelearningservices.WorkspacesConnections_Spec{ + Owner: testcommon.AsOwner(workspaces), + AuthType: to.StringPtr("PAT"), + Category: to.StringPtr("ACR"), + Location: to.StringPtr("eastus"), + Target: to.StringPtr("www.microsoft.com"), + Value: to.StringPtr(jsonValue), + ValueFormat: &valueFormat, + }, + } + tc.CreateResourceAndWait(connection) + tc.DeleteResourceAndWait(connection) +} + +func WorkspaceCompute_CRUD(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, rg *resources.ResourceGroup) { + + vnet := newVMVirtualNetwork(tc, testcommon.AsOwner(rg)) + tc.CreateResourceAndWait(vnet) + + subnet := newVMSubnet(tc, testcommon.AsOwner(vnet)) + publicIP := newPublicIPAddressForVMSS(tc, testcommon.AsOwner(rg)) + + nsg := newNetworkSecurityGroup(tc, testcommon.AsOwner(rg)) + rule := newNetworkSecurityGroupRule(tc, testcommon.AsOwner(nsg)) + + tc.CreateResourceAndWait(nsg) + tc.CreateResourceAndWait(rule) + + networkInterface := newVMNetworkInterfaceWithPublicIP(tc, testcommon.AsOwner(rg), subnet, publicIP, nsg) + tc.CreateResourcesAndWait(subnet, publicIP, networkInterface) + + secret := createVMPasswordSecretAndRef(tc) + + vm := newVM(tc, rg, networkInterface, secret) + tc.CreateResourceAndWait(vm) + + wsCompute := newWorkspacesCompute(tc, owner, vm, secret) + tc.CreateResourceAndWait(wsCompute) + + tc.DeleteResourceAndWait(wsCompute) + tc.DeleteResourceAndWait(vm) + tc.DeleteResourceAndWait(networkInterface) + tc.DeleteResourceAndWait(vnet) + +} + +func newWorkspacesCompute(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, vm *v1beta20201201.VirtualMachine, secret genruntime.SecretReference) *machinelearningservices.WorkspacesCompute { + identityType := machinelearningservices.IdentityTypeSystemAssigned + computeType := machinelearningservices.ComputeVirtualMachineComputeTypeVirtualMachine + + wsCompute := &machinelearningservices.WorkspacesCompute{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.NoSpaceNamer.GenerateName("")), + Spec: machinelearningservices.WorkspacesComputes_Spec{ + Identity: &machinelearningservices.Identity{ + Type: &identityType, + }, + Location: tc.AzureRegion, + Owner: owner, + Sku: &machinelearningservices.Sku{ + Name: to.StringPtr("Standard_S1"), + Tier: to.StringPtr("Basic"), + }, + Properties: &machinelearningservices.Compute{ + + VirtualMachine: &machinelearningservices.Compute_VirtualMachine{ + ComputeLocation: tc.AzureRegion, + ComputeType: &computeType, + DisableLocalAuth: to.BoolPtr(true), + ResourceReference: tc.MakeReferenceFromResource(vm), + Properties: &machinelearningservices.VirtualMachineProperties{ + AdministratorAccount: &machinelearningservices.VirtualMachineSshCredentials{ + Password: &secret, + Username: to.StringPtr("bloom"), + }, + SshPort: to.IntPtr(22), + }, + }, + }, + }, + } + return wsCompute +} + +func newVMNetworkInterfaceWithPublicIP(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference, subnet *network.VirtualNetworksSubnet, publicIP *network.PublicIPAddress, nsg *network.NetworkSecurityGroup) *network.NetworkInterface { + + dynamic := network.NetworkInterfaceIPConfigurationPropertiesFormatPrivateIPAllocationMethodDynamic + return &network.NetworkInterface{ + ObjectMeta: tc.MakeObjectMeta("nic"), + Spec: network.NetworkInterfaces_Spec{ + Owner: owner, + Location: tc.AzureRegion, + IpConfigurations: []network.NetworkInterfaces_Spec_Properties_IpConfigurations{{ + Name: to.StringPtr("ipconfig1"), + PrivateIPAllocationMethod: &dynamic, + Subnet: &network.SubResource{ + Reference: tc.MakeReferenceFromResource(subnet), + }, + PublicIPAddress: &network.SubResource{ + Reference: tc.MakeReferenceFromResource(publicIP), + }, + }}, + NetworkSecurityGroup: &network.SubResource{ + Reference: tc.MakeReferenceFromResource(nsg), + }, + }, + } +} + +func newNetworkSecurityGroup(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference) *network.NetworkSecurityGroup { + // Network Security Group + return &network.NetworkSecurityGroup{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("nsg")), + Spec: network.NetworkSecurityGroups_Spec{ + Location: tc.AzureRegion, + Owner: owner, + }, + } + +} + +func newNetworkSecurityGroupRule(tc *testcommon.KubePerTestContext, owner *genruntime.KnownResourceReference) *network.NetworkSecurityGroupsSecurityRule { + protocol := network.SecurityRulePropertiesFormatProtocolTcp + allow := network.SecurityRulePropertiesFormatAccessAllow + direction := network.SecurityRulePropertiesFormatDirectionInbound + + // Network Security Group rule + return &network.NetworkSecurityGroupsSecurityRule{ + ObjectMeta: tc.MakeObjectMeta("rule1"), + Spec: network.NetworkSecurityGroupsSecurityRules_Spec{ + Owner: owner, + Protocol: &protocol, + SourcePortRange: to.StringPtr("*"), + DestinationPortRange: to.StringPtr("22"), + SourceAddressPrefix: to.StringPtr("*"), + DestinationAddressPrefix: to.StringPtr("*"), + Access: &allow, + Priority: to.IntPtr(101), + Direction: &direction, + Description: to.StringPtr("The first rule of networking is don't talk about networking"), + }, + } +} diff --git a/v2/internal/controllers/recordings/Test_KeyVault_Vault_CRUD.yaml b/v2/internal/controllers/recordings/Test_KeyVault_Vault_CRUD.yaml index 1ba4d26c2f..4b7e6ff3e5 100644 --- a/v2/internal/controllers/recordings/Test_KeyVault_Vault_CRUD.yaml +++ b/v2/internal/controllers/recordings/Test_KeyVault_Vault_CRUD.yaml @@ -20,6 +20,8 @@ interactions: headers: Cache-Control: - no-cache + Content-Length: + - "276" Content-Type: - application/json; charset=utf-8 Expires: @@ -28,12 +30,10 @@ interactions: - no-cache Strict-Transport-Security: - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding X-Content-Type-Options: - nosniff - status: 200 OK - code: 200 + status: 201 Created + code: 201 duration: "" - request: body: "" @@ -66,125 +66,21 @@ interactions: code: 200 duration: "" - request: - body: '{"location":"westus2","name":"asotest-keyvau-ngmgjs","properties":{"accessPolicies":[{"applicationId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]},"tenantId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3"}],"sku":{"family":"A","name":"standard"},"tenantId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3"}}' + body: '{"location":"westus2","name":"asotest-keyvault-ngmgjs","properties":{"accessPolicies":[{"applicationId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]},"tenantId":"00000000-0000-0000-0000-000000000000"}],"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000"}}' form: {} headers: Accept: - application/json Content-Length: - - "423" + - "425" Content-Type: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net","provisioningState":"RegisteringDns"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Microsoft-IIS/10.0 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Aspnet-Version: - - 4.0.30319 - X-Content-Type-Options: - - nosniff - X-Ms-Keyvault-Service-Version: - - 1.5.372.0 - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net/","provisioningState":"RegisteringDns"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Microsoft-IIS/10.0 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Aspnet-Version: - - 4.0.30319 - X-Content-Type-Options: - - nosniff - X-Ms-Keyvault-Service-Version: - - 1.5.372.0 - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Test-Request-Attempt: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Microsoft-IIS/10.0 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Aspnet-Version: - - 4.0.30319 - X-Content-Type-Options: - - nosniff - X-Ms-Keyvault-Service-Version: - - 1.5.372.0 - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Test-Request-Attempt: - - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs","name":"asotest-keyvau-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","accessPolicies":[{"tenantId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","objectId":"1C793267-c310-d4ae-7BD5-5Af5BEF875D3","applicationId":"1c793267-c310-d4ae-7bd5-5af5bef875d3","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvau-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs","name":"asotest-keyvault-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -217,7 +113,43 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs","name":"asotest-keyvault-ngmgjs","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","createdByType":"Application","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"e99b5771-87b0-473b-b919-9b70e36ece7a","lastModifiedByType":"Application","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-ngmgjs.vault.azure.net/","provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-IIS/10.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aspnet-Version: + - 4.0.30319 + X-Content-Type-Options: + - nosniff + X-Ms-Keyvault-Service-Version: + - 1.5.372.0 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview method: DELETE response: body: "" @@ -250,18 +182,18 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs?api-version=2021-04-01-preview + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw/providers/Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs?api-version=2021-04-01-preview method: GET response: - body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/asotest-keyvau-ngmgjs'' + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/asotest-keyvault-ngmgjs'' under resource group ''asotest-rg-mftgkw'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: Cache-Control: - no-cache Content-Length: - - "236" + - "238" Content-Type: - application/json; charset=utf-8 Expires: @@ -319,126 +251,6 @@ interactions: - "1" url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01 method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Test-Request-Attempt: - - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Test-Request-Attempt: - - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Test-Request-Attempt: - - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw","name":"asotest-rg-mftgkw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - Test-Request-Attempt: - - "5" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-mftgkw?api-version=2020-06-01 - method: GET response: body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-mftgkw'' could not be found."}}' diff --git a/v2/internal/controllers/recordings/Test_MachineLearning_Workspaces_CRUD.yaml b/v2/internal/controllers/recordings/Test_MachineLearning_Workspaces_CRUD.yaml new file mode 100644 index 0000000000..ed4fd56283 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_MachineLearning_Workspaces_CRUD.yaml @@ -0,0 +1,3293 @@ +--- +version: 1 +interactions: +- request: + body: '{"name":"asotest-rg-vicazh","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "93" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh","name":"asotest-rg-vicazh","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh","name":"asotest-rg-vicazh","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"kind":"StorageV2","location":"westus2","name":"asoteststorotpbaw","properties":{"accessTier":"Hot"},"sku":{"name":"Standard_LRS"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "132" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw?api-version=2021-04-01 + method: PUT + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Content-Type: + - text/plain; charset=utf-8 + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus2/asyncoperations/eb97610f-169b-4b23-916b-5714a4cfd9fe?monitor=true&api-version=2021-04-01 + Pragma: + - no-cache + Retry-After: + - "17" + Server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus2/asyncoperations/eb97610f-169b-4b23-916b-5714a4cfd9fe?monitor=true&api-version=2021-04-01 + method: GET + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Content-Type: + - text/plain; charset=utf-8 + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus2/asyncoperations/eb97610f-169b-4b23-916b-5714a4cfd9fe?monitor=true&api-version=2021-04-01 + Pragma: + - no-cache + Retry-After: + - "17" + Server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/westus2/asyncoperations/eb97610f-169b-4b23-916b-5714a4cfd9fe?monitor=true&api-version=2021-04-01 + method: GET + response: + body: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw","name":"asoteststorotpbaw","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"keyCreationTime":{"key1":"2001-02-03T04:05:06Z","key2":"2001-02-03T04:05:06Z"},"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2001-02-03T04:05:06Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2001-02-03T04:05:06Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2001-02-03T04:05:06Z","primaryEndpoints":{"dfs":"https://asoteststorotpbaw.dfs.core.windows.net/","web":"https://asoteststorotpbaw.z5.web.core.windows.net/","blob":"https://asoteststorotpbaw.blob.core.windows.net/","queue":"https://asoteststorotpbaw.queue.core.windows.net/","table":"https://asoteststorotpbaw.table.core.windows.net/","file":"https://asoteststorotpbaw.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw?api-version=2021-04-01 + method: GET + response: + body: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw","name":"asoteststorotpbaw","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"keyCreationTime":{"key1":"2001-02-03T04:05:06Z","key2":"2001-02-03T04:05:06Z"},"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2001-02-03T04:05:06Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2001-02-03T04:05:06Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2001-02-03T04:05:06Z","primaryEndpoints":{"dfs":"https://asoteststorotpbaw.dfs.core.windows.net/","web":"https://asoteststorotpbaw.z5.web.core.windows.net/","blob":"https://asoteststorotpbaw.blob.core.windows.net/","queue":"https://asoteststorotpbaw.queue.core.windows.net/","table":"https://asoteststorotpbaw.table.core.windows.net/","file":"https://asoteststorotpbaw.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"location":"westus2","name":"asotest-keyvault-qpxtvz","properties":{"accessPolicies":[{"applicationId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]},"tenantId":"00000000-0000-0000-0000-000000000000"}],"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "425" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz?api-version=2021-04-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz","name":"asotest-keyvault-qpxtvz","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"harshdsingh@microsoft.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"harshdsingh@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-qpxtvz.vault.azure.net","provisioningState":"RegisteringDns"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-IIS/10.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aspnet-Version: + - 4.0.30319 + X-Content-Type-Options: + - nosniff + X-Ms-Keyvault-Service-Version: + - 1.5.413.0 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz?api-version=2021-04-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz","name":"asotest-keyvault-qpxtvz","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"harshdsingh@microsoft.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"harshdsingh@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-qpxtvz.vault.azure.net/","provisioningState":"RegisteringDns"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-IIS/10.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aspnet-Version: + - 4.0.30319 + X-Content-Type-Options: + - nosniff + X-Ms-Keyvault-Service-Version: + - 1.5.413.0 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz?api-version=2021-04-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz","name":"asotest-keyvault-qpxtvz","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"harshdsingh@microsoft.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"harshdsingh@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-qpxtvz.vault.azure.net/","provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-IIS/10.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aspnet-Version: + - 4.0.30319 + X-Content-Type-Options: + - nosniff + X-Ms-Keyvault-Service-Version: + - 1.5.413.0 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz?api-version=2021-04-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz","name":"asotest-keyvault-qpxtvz","type":"Microsoft.KeyVault/vaults","location":"westus2","tags":{},"systemData":{"createdBy":"harshdsingh@microsoft.com","createdByType":"User","createdAt":"2001-02-03T04:05:06Z","lastModifiedBy":"harshdsingh@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2001-02-03T04:05:06Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"00000000-0000-0000-0000-000000000000","accessPolicies":[{"tenantId":"00000000-0000-0000-0000-000000000000","objectId":"00000000-0000-0000-0000-000000000000","applicationId":"00000000-0000-0000-0000-000000000000","permissions":{"certificates":["get"],"keys":["get"],"secrets":["get"],"storage":["get"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://asotest-keyvault-qpxtvz.vault.azure.net/","provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-IIS/10.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aspnet-Version: + - 4.0.30319 + X-Content-Type-Options: + - nosniff + X-Ms-Keyvault-Service-Version: + - 1.5.413.0 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"identity":{"type":"SystemAssigned"},"location":"eastus","name":"asotestworktmjmhm","properties":{"allowPublicAccessWhenBehindVnet":false,"keyVault":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw"},"sku":{"name":"Standard_S1","tier":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "508" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: PUT + response: + body: "" + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/nBXSzMdSzIzNdFyTeAkDIdvaqb62nNx0fZZb0Duw5Zc?api-version=2021-07-01&type=async + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/nBXSzMdSzIzNdFyTeAkDIdvaqb62nNx0fZZb0Duw5Zc?api-version=2021-07-01&type=location + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.141" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/nBXSzMdSzIzNdFyTeAkDIdvaqb62nNx0fZZb0Duw5Zc?api-version=2021-07-01&type=async + method: GET + response: + body: |- + { + "status": "InProgress" + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-b62f07d44869a44792829e9c5e64d9fc-16aecf3cfd563b2a-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.016" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/nBXSzMdSzIzNdFyTeAkDIdvaqb62nNx0fZZb0Duw5Zc?api-version=2021-07-01&type=async + method: GET + response: + body: |- + { + "status": "Succeeded", + "percentComplete": 100.0 + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-289b5fdde00d044682abfc8484aae0a9-f5e315bde5374502-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.016" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: GET + response: + body: |- + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "name": "asotestworktmjmhm", + "type": "Microsoft.MachineLearningServices/workspaces", + "location": "eastus", + "tags": {}, + "etag": null, + "properties": { + "friendlyName": "", + "description": "", + "storageAccount": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw", + "keyVault": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Keyvault/vaults/asotest-keyvault-qpxtvz", + "applicationInsights": null, + "hbiWorkspace": false, + "tenantId": "00000000-0000-0000-0000-000000000000", + "imageBuildCompute": null, + "provisioningState": "Succeeded", + "containerRegistry": null, + "notebookInfo": { + "resourceId": "3ee9f3bf02514babb674a4ce385236a1", + "fqdn": "ml-asotestworktmjmh-eastus-88174ee2-3d0e-4b26-baab-19b88e05a0d1.eastus.notebooks.azure.net", + "isPrivateLinkEnabled": false, + "notebookPreparationError": null + }, + "storageHnsEnabled": false, + "workspaceId": "88174ee2-3d0e-4b26-baab-19b88e05a0d1", + "linkedModelInventoryArmId": null, + "privateLinkCount": 0, + "allowPublicAccessWhenBehindVnet": true, + "discoveryUrl": "https://eastus.api.azureml.ms/discovery", + "mlFlowTrackingUri": "azureml://eastus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "sdkTelemetryAppInsightsKey": "71fa86c2-fe23-49db-bb2e-8537edfb6ead", + "sasGetterUri": "" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "eee353e8-3aa0-414e-99e3-cf25fa73a8e6", + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "sku": { + "name": "Basic", + "tier": "Basic" + }, + "systemData": { + "createdAt": "2001-02-03T04:05:06Z", + "createdBy": "harshdsingh@microsoft.com", + "createdByType": "User", + "lastModifiedAt": "2001-02-03T04:05:06Z", + "lastModifiedBy": "harshdsingh@microsoft.com", + "lastModifiedByType": "User" + } + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-24b19d1c60985845842df8fdf6e37c66-e440a5d6a2324ba1-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.023" + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"identity":{"type":"SystemAssigned"},"location":"eastus","name":"asotestworktmjmhm","properties":{"allowPublicAccessWhenBehindVnet":false,"keyVault":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz","storageAccount":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw"},"sku":{"name":"Standard_S1","tier":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "508" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: PUT + response: + body: "" + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/-wJdN-lpxVDs7XQchu6NtiQKYZ91Uj9SIAmb4QVBz24?api-version=2021-07-01&type=async + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/-wJdN-lpxVDs7XQchu6NtiQKYZ91Uj9SIAmb4QVBz24?api-version=2021-07-01&type=location + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.119" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/-wJdN-lpxVDs7XQchu6NtiQKYZ91Uj9SIAmb4QVBz24?api-version=2021-07-01&type=async + method: GET + response: + body: |- + { + "status": "InProgress" + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-abf19cb419280c428a0300deb3a84d56-010a25b3b2d95038-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.102" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/-wJdN-lpxVDs7XQchu6NtiQKYZ91Uj9SIAmb4QVBz24?api-version=2021-07-01&type=async + method: GET + response: + body: |- + { + "status": "Succeeded", + "percentComplete": 100.0 + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-6248a0fce04be94a8522f5a265c66652-ffc19e2a44f2cd72-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.019" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: GET + response: + body: |- + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "name": "asotestworktmjmhm", + "type": "Microsoft.MachineLearningServices/workspaces", + "location": "eastus", + "tags": {}, + "etag": null, + "properties": { + "friendlyName": "", + "description": "", + "storageAccount": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw", + "keyVault": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Keyvault/vaults/asotest-keyvault-qpxtvz", + "applicationInsights": null, + "hbiWorkspace": false, + "tenantId": "00000000-0000-0000-0000-000000000000", + "imageBuildCompute": null, + "provisioningState": "Succeeded", + "containerRegistry": null, + "notebookInfo": { + "resourceId": "3ee9f3bf02514babb674a4ce385236a1", + "fqdn": "ml-asotestworktmjmh-eastus-88174ee2-3d0e-4b26-baab-19b88e05a0d1.eastus.notebooks.azure.net", + "isPrivateLinkEnabled": false, + "notebookPreparationError": null + }, + "storageHnsEnabled": false, + "workspaceId": "88174ee2-3d0e-4b26-baab-19b88e05a0d1", + "linkedModelInventoryArmId": null, + "privateLinkCount": 0, + "allowPublicAccessWhenBehindVnet": false, + "discoveryUrl": "https://eastus.api.azureml.ms/discovery", + "mlFlowTrackingUri": "azureml://eastus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "sdkTelemetryAppInsightsKey": "71fa86c2-fe23-49db-bb2e-8537edfb6ead", + "sasGetterUri": "" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "eee353e8-3aa0-414e-99e3-cf25fa73a8e6", + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "sku": { + "name": "Basic", + "tier": "Basic" + }, + "systemData": { + "createdAt": "2001-02-03T04:05:06Z", + "createdBy": "harshdsingh@microsoft.com", + "createdByType": "User", + "lastModifiedAt": "2001-02-03T04:05:06Z", + "lastModifiedBy": "harshdsingh@microsoft.com", + "lastModifiedByType": "User" + } + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-0d5506f8cde7414aab321f5332477230-c8d906caf956e2c1-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.022" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/listKeys?api-version=2021-07-01 + method: POST + response: + body: |- + { + "userStorageKey": "{KEY}", + "userStorageArmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw", + "appInsightsInstrumentationKey": null, + "containerRegistryCredentials": null, + "notebookAccessKeys": { + "primaryAccessKey": "f8ad4c873d8e4fbd8aa8b1881f9282bab5b8ad12b0da44ad9f2cd35d5e2a25e9", + "secondaryAccessKey": "0a02a5f7fd554f05a2ce60cb4d7a6d0ceb28a164f4ab48239d711ad1a7ace0d1" + } + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-b90378a4fc6a1b42ac5b872cefcc6e10-c4947083de910771-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.412" + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"location":"eastus","name":"asotest-conn-knashe","properties":{"authType":"PAT","category":"ACR","target":"www.microsoft.com","value":"{\"foo\":\"bar\", + \"baz\":\"bee\"}","valueFormat":"JSON"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "194" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/connections/asotest-conn-knashe?api-version=2021-07-01 + method: PUT + response: + body: |- + { + "tags": null, + "location": null, + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/connections/asotest-conn-knashe", + "name": "asotest-conn-knashe", + "type": "Microsoft.MachineLearningServices/workspaces/connections", + "properties": { + "category": "ACR", + "target": "www.microsoft.com", + "authType": "PAT", + "value": null, + "valueFormat": null + }, + "systemData": null + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-c298c525fd34ea46b65861c5ef106586-826d3d5005d515e8-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "1.953" + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"location":"westus2","name":"asotest-vn-nsreun","properties":{"addressSpace":{"addressPrefixes":["10.0.0.0/16"]}}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "115" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun?api-version=2020-11-01 + method: PUT + response: + body: "{\r\n \"name\": \"asotest-vn-nsreun\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun\",\r\n + \ \"etag\": \"W/\\\"f7269b04-e90e-4ac4-b445-dae400cf010d\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus2\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": \"b34913a3-5939-4242-9ef4-324aef937c9c\",\r\n + \ \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n + \ ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\": + [],\r\n \"enableDdosProtection\": false\r\n }\r\n}" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/d6febd96-e3a6-4caf-828d-8afcc94da799?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "630" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "3" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/connections/asotest-conn-knashe?api-version=2021-07-01 + method: GET + response: + body: |- + { + "tags": null, + "location": null, + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/connections/asotest-conn-knashe", + "name": "asotest-conn-knashe", + "type": "Microsoft.MachineLearningServices/workspaces/connections", + "properties": { + "category": "ACR", + "target": "www.microsoft.com", + "authType": "PAT", + "value": null, + "valueFormat": null + }, + "systemData": null + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-e1ba1bb59212c24e87a517cb219c6cca-656656217b879951-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.317" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/connections/asotest-conn-knashe?api-version=2021-07-01 + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-7f980a0ae56d8640a0e2c43fa00db24c-3a7eccaf4eeb4512-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.725" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/d6febd96-e3a6-4caf-828d-8afcc94da799?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-vn-nsreun\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun\",\r\n + \ \"etag\": \"W/\\\"16e62bef-96c1-4d60-b3f2-48fd97f08039\\\"\",\r\n \"type\": + \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus2\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"b34913a3-5939-4242-9ef4-324aef937c9c\",\r\n + \ \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n + \ ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\": + [],\r\n \"enableDdosProtection\": false\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Etag: + - W/"16e62bef-96c1-4d60-b3f2-48fd97f08039" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/connections/asotest-conn-knashe?api-version=2021-07-01 + method: GET + response: + body: |- + { + "error": { + "code": "UserError", + "severity": null, + "message": "Connection asotest-conn-knashe can't be found in this workspace", + "messageFormat": null, + "messageParameters": null, + "referenceCode": null, + "detailsUri": null, + "target": null, + "details": [], + "innerError": { + "code": "NotFoundError", + "innerError": null + }, + "debugInfo": null, + "additionalInfo": null + }, + "correlation": { + "operation": "2814cd398e77144bb9d199d260138b1e", + "request": "cdccbe3869d09d65" + }, + "environment": "eastus", + "location": "eastus", + "time": "2022-07-05T21:48:08.0334633+00:00", + "componentName": "account-rp" + } + headers: + Cache-Control: + - no-cache + Content-Length: + - "672" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - error + X-Request-Time: + - "0.027" + status: 404 Not Found + code: 404 + duration: "" +- request: + body: '{"location":"westus2","name":"asotest-nsg-pjizxk"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "50" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk?api-version=2020-11-01 + method: PUT + response: + body: "{\r\n \"name\": \"asotest-nsg-pjizxk\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk\",\r\n + \ \"etag\": \"W/\\\"02359c02-5c04-4484-a658-0c1ec7bb32ed\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"location\": \"westus2\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": + \"a65363cd-e938-41e1-8251-2c98575b3724\",\r\n \"securityRules\": [],\r\n + \ \"defaultSecurityRules\": [\r\n {\r\n \"name\": \"AllowVnetInBound\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowVnetInBound\",\r\n + \ \"etag\": \"W/\\\"02359c02-5c04-4484-a658-0c1ec7bb32ed\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"description\": + \"Allow inbound traffic from all VMs in VNET\",\r\n \"protocol\": \"*\",\r\n + \ \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"VirtualNetwork\",\r\n \"destinationAddressPrefix\": + \"VirtualNetwork\",\r\n \"access\": \"Allow\",\r\n \"priority\": + 65000,\r\n \"direction\": \"Inbound\",\r\n \"sourcePortRanges\": + [],\r\n \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"AllowAzureLoadBalancerInBound\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowAzureLoadBalancerInBound\",\r\n + \ \"etag\": \"W/\\\"02359c02-5c04-4484-a658-0c1ec7bb32ed\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"description\": + \"Allow inbound traffic from azure load balancer\",\r\n \"protocol\": + \"*\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"AzureLoadBalancer\",\r\n \"destinationAddressPrefix\": + \"*\",\r\n \"access\": \"Allow\",\r\n \"priority\": 65001,\r\n + \ \"direction\": \"Inbound\",\r\n \"sourcePortRanges\": [],\r\n + \ \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"DenyAllInBound\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/DenyAllInBound\",\r\n + \ \"etag\": \"W/\\\"02359c02-5c04-4484-a658-0c1ec7bb32ed\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"description\": + \"Deny all inbound traffic\",\r\n \"protocol\": \"*\",\r\n \"sourcePortRange\": + \"*\",\r\n \"destinationPortRange\": \"*\",\r\n \"sourceAddressPrefix\": + \"*\",\r\n \"destinationAddressPrefix\": \"*\",\r\n \"access\": + \"Deny\",\r\n \"priority\": 65500,\r\n \"direction\": \"Inbound\",\r\n + \ \"sourcePortRanges\": [],\r\n \"destinationPortRanges\": + [],\r\n \"sourceAddressPrefixes\": [],\r\n \"destinationAddressPrefixes\": + []\r\n }\r\n },\r\n {\r\n \"name\": \"AllowVnetOutBound\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowVnetOutBound\",\r\n + \ \"etag\": \"W/\\\"02359c02-5c04-4484-a658-0c1ec7bb32ed\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"description\": + \"Allow outbound traffic from all VMs to all VMs in VNET\",\r\n \"protocol\": + \"*\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"VirtualNetwork\",\r\n \"destinationAddressPrefix\": + \"VirtualNetwork\",\r\n \"access\": \"Allow\",\r\n \"priority\": + 65000,\r\n \"direction\": \"Outbound\",\r\n \"sourcePortRanges\": + [],\r\n \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"AllowInternetOutBound\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowInternetOutBound\",\r\n + \ \"etag\": \"W/\\\"02359c02-5c04-4484-a658-0c1ec7bb32ed\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"description\": + \"Allow outbound traffic from all VMs to Internet\",\r\n \"protocol\": + \"*\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"*\",\r\n \"destinationAddressPrefix\": + \"Internet\",\r\n \"access\": \"Allow\",\r\n \"priority\": + 65001,\r\n \"direction\": \"Outbound\",\r\n \"sourcePortRanges\": + [],\r\n \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"DenyAllOutBound\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/DenyAllOutBound\",\r\n + \ \"etag\": \"W/\\\"02359c02-5c04-4484-a658-0c1ec7bb32ed\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"description\": + \"Deny all outbound traffic\",\r\n \"protocol\": \"*\",\r\n \"sourcePortRange\": + \"*\",\r\n \"destinationPortRange\": \"*\",\r\n \"sourceAddressPrefix\": + \"*\",\r\n \"destinationAddressPrefix\": \"*\",\r\n \"access\": + \"Deny\",\r\n \"priority\": 65500,\r\n \"direction\": \"Outbound\",\r\n + \ \"sourcePortRanges\": [],\r\n \"destinationPortRanges\": + [],\r\n \"sourceAddressPrefixes\": [],\r\n \"destinationAddressPrefixes\": + []\r\n }\r\n }\r\n ]\r\n }\r\n}" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/f934234a-446d-4aaa-9277-38b6b5c9107c?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "6632" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "3" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/f934234a-446d-4aaa-9277-38b6b5c9107c?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-nsg-pjizxk\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk\",\r\n + \ \"etag\": \"W/\\\"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups\",\r\n \"location\": \"westus2\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": + \"a65363cd-e938-41e1-8251-2c98575b3724\",\r\n \"securityRules\": [],\r\n + \ \"defaultSecurityRules\": [\r\n {\r\n \"name\": \"AllowVnetInBound\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowVnetInBound\",\r\n + \ \"etag\": \"W/\\\"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"description\": + \"Allow inbound traffic from all VMs in VNET\",\r\n \"protocol\": \"*\",\r\n + \ \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"VirtualNetwork\",\r\n \"destinationAddressPrefix\": + \"VirtualNetwork\",\r\n \"access\": \"Allow\",\r\n \"priority\": + 65000,\r\n \"direction\": \"Inbound\",\r\n \"sourcePortRanges\": + [],\r\n \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"AllowAzureLoadBalancerInBound\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowAzureLoadBalancerInBound\",\r\n + \ \"etag\": \"W/\\\"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"description\": + \"Allow inbound traffic from azure load balancer\",\r\n \"protocol\": + \"*\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"AzureLoadBalancer\",\r\n \"destinationAddressPrefix\": + \"*\",\r\n \"access\": \"Allow\",\r\n \"priority\": 65001,\r\n + \ \"direction\": \"Inbound\",\r\n \"sourcePortRanges\": [],\r\n + \ \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"DenyAllInBound\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/DenyAllInBound\",\r\n + \ \"etag\": \"W/\\\"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"description\": + \"Deny all inbound traffic\",\r\n \"protocol\": \"*\",\r\n \"sourcePortRange\": + \"*\",\r\n \"destinationPortRange\": \"*\",\r\n \"sourceAddressPrefix\": + \"*\",\r\n \"destinationAddressPrefix\": \"*\",\r\n \"access\": + \"Deny\",\r\n \"priority\": 65500,\r\n \"direction\": \"Inbound\",\r\n + \ \"sourcePortRanges\": [],\r\n \"destinationPortRanges\": + [],\r\n \"sourceAddressPrefixes\": [],\r\n \"destinationAddressPrefixes\": + []\r\n }\r\n },\r\n {\r\n \"name\": \"AllowVnetOutBound\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowVnetOutBound\",\r\n + \ \"etag\": \"W/\\\"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"description\": + \"Allow outbound traffic from all VMs to all VMs in VNET\",\r\n \"protocol\": + \"*\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"VirtualNetwork\",\r\n \"destinationAddressPrefix\": + \"VirtualNetwork\",\r\n \"access\": \"Allow\",\r\n \"priority\": + 65000,\r\n \"direction\": \"Outbound\",\r\n \"sourcePortRanges\": + [],\r\n \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"AllowInternetOutBound\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/AllowInternetOutBound\",\r\n + \ \"etag\": \"W/\\\"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"description\": + \"Allow outbound traffic from all VMs to Internet\",\r\n \"protocol\": + \"*\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"*\",\r\n \"sourceAddressPrefix\": \"*\",\r\n \"destinationAddressPrefix\": + \"Internet\",\r\n \"access\": \"Allow\",\r\n \"priority\": + 65001,\r\n \"direction\": \"Outbound\",\r\n \"sourcePortRanges\": + [],\r\n \"destinationPortRanges\": [],\r\n \"sourceAddressPrefixes\": + [],\r\n \"destinationAddressPrefixes\": []\r\n }\r\n },\r\n + \ {\r\n \"name\": \"DenyAllOutBound\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/defaultSecurityRules/DenyAllOutBound\",\r\n + \ \"etag\": \"W/\\\"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/defaultSecurityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"description\": + \"Deny all outbound traffic\",\r\n \"protocol\": \"*\",\r\n \"sourcePortRange\": + \"*\",\r\n \"destinationPortRange\": \"*\",\r\n \"sourceAddressPrefix\": + \"*\",\r\n \"destinationAddressPrefix\": \"*\",\r\n \"access\": + \"Deny\",\r\n \"priority\": 65500,\r\n \"direction\": \"Outbound\",\r\n + \ \"sourcePortRanges\": [],\r\n \"destinationPortRanges\": + [],\r\n \"sourceAddressPrefixes\": [],\r\n \"destinationAddressPrefixes\": + []\r\n }\r\n }\r\n ]\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Etag: + - W/"57db7d6f-dce5-43cd-8f4f-9a674e1ffdfb" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"name":"asotest-rule1-vatefk","properties":{"access":"Allow","description":"The + first rule of networking is don''t talk about networking","destinationAddressPrefix":"*","destinationPortRange":"22","direction":"Inbound","priority":101,"protocol":"Tcp","sourceAddressPrefix":"*","sourcePortRange":"*"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "300" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/securityRules/asotest-rule1-vatefk?api-version=2020-11-01 + method: PUT + response: + body: "{\r\n \"name\": \"asotest-rule1-vatefk\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/securityRules/asotest-rule1-vatefk\",\r\n + \ \"etag\": \"W/\\\"df6d8881-a7fa-409b-a487-070a662eedf0\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/securityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"description\": \"The + first rule of networking is don't talk about networking\",\r\n \"protocol\": + \"Tcp\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"22\",\r\n \"sourceAddressPrefix\": \"*\",\r\n \"destinationAddressPrefix\": + \"*\",\r\n \"access\": \"Allow\",\r\n \"priority\": 101,\r\n \"direction\": + \"Inbound\",\r\n \"sourcePortRanges\": [],\r\n \"destinationPortRanges\": + [],\r\n \"sourceAddressPrefixes\": [],\r\n \"destinationAddressPrefixes\": + []\r\n }\r\n}" + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/26e7f653-061a-48c1-9334-0dd09d4bd0c7?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "879" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "10" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/26e7f653-061a-48c1-9334-0dd09d4bd0c7?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/securityRules/asotest-rule1-vatefk?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-rule1-vatefk\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk/securityRules/asotest-rule1-vatefk\",\r\n + \ \"etag\": \"W/\\\"7dddc308-0b65-477d-b345-6824d332aa5a\\\"\",\r\n \"type\": + \"Microsoft.Network/networkSecurityGroups/securityRules\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"description\": \"The + first rule of networking is don't talk about networking\",\r\n \"protocol\": + \"Tcp\",\r\n \"sourcePortRange\": \"*\",\r\n \"destinationPortRange\": + \"22\",\r\n \"sourceAddressPrefix\": \"*\",\r\n \"destinationAddressPrefix\": + \"*\",\r\n \"access\": \"Allow\",\r\n \"priority\": 101,\r\n \"direction\": + \"Inbound\",\r\n \"sourcePortRanges\": [],\r\n \"destinationPortRanges\": + [],\r\n \"sourceAddressPrefixes\": [],\r\n \"destinationAddressPrefixes\": + []\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Etag: + - W/"7dddc308-0b65-477d-b345-6824d332aa5a" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"name":"asotest-subnet-usdgwr","properties":{"addressPrefix":"10.0.0.0/24"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "77" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun/subnets/asotest-subnet-usdgwr?api-version=2020-11-01 + method: PUT + response: + body: "{\r\n \"name\": \"asotest-subnet-usdgwr\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun/subnets/asotest-subnet-usdgwr\",\r\n + \ \"etag\": \"W/\\\"b480df76-03f8-4732-8f2d-234850066c1d\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n + \ \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"type\": + \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/3e679ded-8732-4e2c-a5ab-a96195b0fc47?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "567" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "3" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"location":"westus2","name":"asotest-publicip-ruonxb","properties":{"publicIPAllocationMethod":"Static"},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "132" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/publicIPAddresses/asotest-publicip-ruonxb?api-version=2020-11-01 + method: PUT + response: + body: "{\r\n \"name\": \"asotest-publicip-ruonxb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/publicIPAddresses/asotest-publicip-ruonxb\",\r\n + \ \"etag\": \"W/\\\"59ddeffa-f13c-44d7-a8ff-fe6b4d2f0d5e\\\"\",\r\n \"location\": + \"westus2\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n + \ \"resourceGuid\": \"cba28a72-c666-4de4-9c58-b1904bb758eb\",\r\n \"publicIPAddressVersion\": + \"IPv4\",\r\n \"publicIPAllocationMethod\": \"Static\",\r\n \"idleTimeoutInMinutes\": + 4,\r\n \"ipTags\": []\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n + \ \"sku\": {\r\n \"name\": \"Standard\",\r\n \"tier\": \"Regional\"\r\n + \ }\r\n}" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/c155ffc4-a2c7-496d-acc6-e5bcb3745235?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "664" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "1" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"location":"westus2","name":"asotest-nic-byjotm","properties":{"ipConfigurations":[{"name":"ipconfig1","properties":{"privateIPAllocationMethod":"Dynamic","publicIPAddress":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/publicIPAddresses/asotest-publicip-ruonxb"},"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun/subnets/asotest-subnet-usdgwr"}}}],"networkSecurityGroup":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk"}}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "723" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm?api-version=2020-11-01 + method: PUT + response: + body: "{\r\n \"name\": \"asotest-nic-byjotm\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm\",\r\n + \ \"etag\": \"W/\\\"6be063be-cd6a-4fac-8c41-c84ff67d9d67\\\"\",\r\n \"location\": + \"westus2\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"a69295b1-a246-47c8-a3a3-37031d434398\",\r\n \"ipConfigurations\": + [\r\n {\r\n \"name\": \"ipconfig1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm/ipConfigurations/ipconfig1\",\r\n + \ \"etag\": \"W/\\\"6be063be-cd6a-4fac-8c41-c84ff67d9d67\\\"\",\r\n \"type\": + \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateIPAddress\": + \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": + {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/publicIPAddresses/asotest-publicip-ruonxb\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun/subnets/asotest-subnet-usdgwr\"\r\n + \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": + \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": + [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": + \"umjutmzzlfbefhxugjfo5e12te.xx.internal.cloudapp.net\"\r\n },\r\n \"enableAcceleratedNetworking\": + false,\r\n \"vnetEncryptionSupported\": false,\r\n \"enableIPForwarding\": + false,\r\n \"networkSecurityGroup\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk\"\r\n + \ },\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\n + \ \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/aa5d41a1-4bb0-4c7e-bc89-2ef4d58e09c8?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "2160" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-nic-byjotm\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm\",\r\n + \ \"etag\": \"W/\\\"6be063be-cd6a-4fac-8c41-c84ff67d9d67\\\"\",\r\n \"location\": + \"westus2\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"a69295b1-a246-47c8-a3a3-37031d434398\",\r\n \"ipConfigurations\": + [\r\n {\r\n \"name\": \"ipconfig1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm/ipConfigurations/ipconfig1\",\r\n + \ \"etag\": \"W/\\\"6be063be-cd6a-4fac-8c41-c84ff67d9d67\\\"\",\r\n \"type\": + \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateIPAddress\": + \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": \"Dynamic\",\r\n \"publicIPAddress\": + {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/publicIPAddresses/asotest-publicip-ruonxb\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun/subnets/asotest-subnet-usdgwr\"\r\n + \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": + \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": + [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": + \"umjutmzzlfbefhxugjfo5e12te.xx.internal.cloudapp.net\"\r\n },\r\n \"enableAcceleratedNetworking\": + false,\r\n \"vnetEncryptionSupported\": false,\r\n \"enableIPForwarding\": + false,\r\n \"networkSecurityGroup\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkSecurityGroups/asotest-nsg-pjizxk\"\r\n + \ },\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\n + \ \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Etag: + - W/"6be063be-cd6a-4fac-8c41-c84ff67d9d67" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/3e679ded-8732-4e2c-a5ab-a96195b0fc47?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun/subnets/asotest-subnet-usdgwr?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-subnet-usdgwr\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun/subnets/asotest-subnet-usdgwr\",\r\n + \ \"etag\": \"W/\\\"408172b6-5d69-4611-a1e4-4bbaeb29a852\\\"\",\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n + \ \"ipConfigurations\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm/ipConfigurations/ipconfig1\"\r\n + \ }\r\n ],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": + \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n + \ \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Etag: + - W/"408172b6-5d69-4611-a1e4-4bbaeb29a852" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/c155ffc4-a2c7-496d-acc6-e5bcb3745235?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"status\": \"Succeeded\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/publicIPAddresses/asotest-publicip-ruonxb?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-publicip-ruonxb\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/publicIPAddresses/asotest-publicip-ruonxb\",\r\n + \ \"etag\": \"W/\\\"d2cc4bcc-97a1-4dee-9020-851dd99313ec\\\"\",\r\n \"location\": + \"westus2\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"cba28a72-c666-4de4-9c58-b1904bb758eb\",\r\n \"ipAddress\": + \"20.230.210.31\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n \"publicIPAllocationMethod\": + \"Static\",\r\n \"idleTimeoutInMinutes\": 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": + {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm/ipConfigurations/ipconfig1\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n \"sku\": + {\r\n \"name\": \"Standard\",\r\n \"tier\": \"Regional\"\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Etag: + - W/"d2cc4bcc-97a1-4dee-9020-851dd99313ec" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"location":"westus2","name":"asotest-vm-fsdzay","properties":{"hardwareProfile":{"vmSize":"Standard_A1_v2"},"networkProfile":{"networkInterfaces":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm"}]},"osProfile":{"adminPassword":"{PASSWORD}","adminUsername":"bloom","computerName":"poppy"},"storageProfile":{"imageReference":{"offer":"UbuntuServer","publisher":"Canonical","sku":"18.04-LTS","version":"latest"}}}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "560" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay?api-version=2020-12-01 + method: PUT + response: + body: "{\r\n \"name\": \"asotest-vm-fsdzay\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus2\",\r\n + \ \"tags\": {\r\n \"platformsettings.host_environment.service.platform_optedin_for_rootcerts\": + \"true\"\r\n },\r\n \"properties\": {\r\n \"vmId\": \"880b3560-9057-49bb-802b-b36805cefbf5\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202206230\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": {\r\n + \ \"computerName\": \"poppy\",\r\n \"adminUsername\": \"bloom\",\r\n + \ \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\"\r\n }\r\n },\r\n + \ \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\": + true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm\"}]},\r\n + \ \"provisioningState\": \"Creating\"\r\n }\r\n}" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus2/operations/1cf0572d-bd88-480c-bdcd-525ba8cc393a?p=b26caeba-1a35-4884-92ce-d47b44b28157&api-version=2020-12-01 + Cache-Control: + - no-cache + Content-Length: + - "1671" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "10" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199 + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus2/operations/1cf0572d-bd88-480c-bdcd-525ba8cc393a?p=b26caeba-1a35-4884-92ce-d47b44b28157&api-version=2020-12-01 + method: GET + response: + body: "{\r\n \"startTime\": \"2022-07-05T21:48:47.362208+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"1cf0572d-bd88-480c-bdcd-525ba8cc393a\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Retry-After: + - "35" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29999 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus2/operations/1cf0572d-bd88-480c-bdcd-525ba8cc393a?p=b26caeba-1a35-4884-92ce-d47b44b28157&api-version=2020-12-01 + method: GET + response: + body: "{\r\n \"startTime\": \"2022-07-05T21:48:47.362208+00:00\",\r\n \"endTime\": + \"2022-07-05T21:49:28.0028945+00:00\",\r\n \"status\": \"Succeeded\",\r\n \"name\": + \"1cf0572d-bd88-480c-bdcd-525ba8cc393a\"\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29998 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay?api-version=2020-12-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-vm-fsdzay\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus2\",\r\n + \ \"tags\": {\r\n \"platformsettings.host_environment.service.platform_optedin_for_rootcerts\": + \"true\"\r\n },\r\n \"properties\": {\r\n \"vmId\": \"880b3560-9057-49bb-802b-b36805cefbf5\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202206230\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"asotest-vm-fsdzay_OsDisk_1_7895eb75354f4eb797f0a506c423f702\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/disks/asotest-vm-fsdzay_OsDisk_1_7895eb75354f4eb797f0a506c423f702\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"poppy\",\r\n + \ \"adminUsername\": \"bloom\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\"\r\n }\r\n },\r\n + \ \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\": + true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm\"}]},\r\n + \ \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31999 + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"identity":{"type":"SystemAssigned"},"location":"westus2","name":"asotestqlydwm","properties":{"computeLocation":"westus2","computeType":"VirtualMachine","disableLocalAuth":true,"properties":{"administratorAccount":{"password":"{PASSWORD}","username":"bloom"},"sshPort":22},"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay"},"sku":{"name":"Standard_S1","tier":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "520" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/computes/asotestqlydwm?api-version=2021-07-01 + method: PUT + response: + body: |- + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/computes/asotestqlydwm", + "name": "asotestqlydwm", + "type": "Microsoft.MachineLearningServices/workspaces/computes", + "location": "westus2", + "tags": null, + "identity": { + "type": "SystemAssigned", + "principalId": "933f5e84-691f-4715-90e5-955788b45c2c", + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "properties": { + "createdOn": "2022-07-05T21:49:40.6359365+00:00", + "modifiedOn": "2022-07-05T21:49:40.6359365+00:00", + "disableLocalAuth": true, + "description": null, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay", + "computeType": "VirtualMachine", + "computeLocation": "westus2", + "provisioningState": "Creating", + "provisioningErrors": null, + "isAttachedCompute": true, + "properties": { + "virtualMachineSize": "STANDARD_A1_V2", + "sshPort": 22, + "notebookServerPort": null, + "address": "20.230.210.31", + "ipAddress": "20.230.210.31", + "administratorAccount": null, + "imageVersion": null, + "applicationUris": null, + "createdBy": null + } + } + } + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/computeOperationsStatus/ffa637e2-3b66-46d4-9e94-274625adb4fc?api-version=2021-07-01&service=new + Cache-Control: + - no-cache + Content-Length: + - "1336" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-7b8c50e7f4b2ca40aae3e4b99e4c6858-664537d1cc99ff48-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "2.237" + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/computeOperationsStatus/ffa637e2-3b66-46d4-9e94-274625adb4fc?api-version=2021-07-01&service=new + method: GET + response: + body: |- + { + "status": "Failed", + "error": { + "code": "BadRequest", + "message": "Could not authenticate '20.230.210.31:22' against the SSH service. Verify that the supplied credentials are correct." + } + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-caf58a2ab05f5d479ece4d26ff519b8a-f0c1bf92e14d5553-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.012" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/computes/asotestqlydwm?api-version=2021-07-01 + method: GET + response: + body: |- + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/computes/asotestqlydwm", + "name": "asotestqlydwm", + "type": "Microsoft.MachineLearningServices/workspaces/computes", + "location": "westus2", + "tags": null, + "identity": { + "type": "SystemAssigned", + "principalId": "933f5e84-691f-4715-90e5-955788b45c2c", + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "properties": { + "createdOn": "2022-07-05T21:49:40.6359365+00:00", + "modifiedOn": "2022-07-05T21:49:41.5294205+00:00", + "disableLocalAuth": true, + "description": null, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay", + "computeType": "VirtualMachine", + "computeLocation": "westus2", + "provisioningState": "Failed", + "provisioningErrors": [ + { + "error": { + "code": "UserError", + "message": "Could not authenticate '20.230.210.31:22' against the SSH service. Verify that the supplied credentials are correct." + } + } + ], + "isAttachedCompute": true, + "properties": { + "virtualMachineSize": "STANDARD_A1_V2", + "sshPort": 22, + "notebookServerPort": null, + "address": "20.230.210.31", + "ipAddress": "20.230.210.31", + "administratorAccount": null, + "imageVersion": null, + "applicationUris": null, + "createdBy": null + } + } + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-31895d325650f646bbdd9a3affc37d2e-ca999efe1f3dff20-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.107" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/computes/asotestqlydwm?api-version=2021-07-01 + method: DELETE + response: + body: "" + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/computeOperationsStatus/5c330402-ef98-4e82-85b3-6e612e21af81?api-version=2021-07-01&service=new + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.463" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm/computes/asotestqlydwm?api-version=2021-07-01 + method: GET + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aml-Cluster: + - vienna-eastus-02 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.074" + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay?api-version=2020-12-01 + method: DELETE + response: + body: "" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus2/operations/0dd4b1e6-4bd6-4c8a-8eff-ca7065c6c094?p=b26caeba-1a35-4884-92ce-d47b44b28157&api-version=2020-12-01 + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus2/operations/0dd4b1e6-4bd6-4c8a-8eff-ca7065c6c094?p=b26caeba-1a35-4884-92ce-d47b44b28157&monitor=true&api-version=2020-12-01 + Pragma: + - no-cache + Retry-After: + - "10" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/DeleteVM3Min;239,Microsoft.Compute/DeleteVM30Min;1199 + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay?api-version=2020-12-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-vm-fsdzay\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus2\",\r\n + \ \"tags\": {\r\n \"platformsettings.host_environment.service.platform_optedin_for_rootcerts\": + \"true\"\r\n },\r\n \"properties\": {\r\n \"vmId\": \"880b3560-9057-49bb-802b-b36805cefbf5\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202206230\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"asotest-vm-fsdzay_OsDisk_1_7895eb75354f4eb797f0a506c423f702\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/disks/asotest-vm-fsdzay_OsDisk_1_7895eb75354f4eb797f0a506c423f702\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"poppy\",\r\n + \ \"adminUsername\": \"bloom\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\"\r\n }\r\n },\r\n + \ \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\": + true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm\"}]},\r\n + \ \"provisioningState\": \"Deleting\"\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31996 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay?api-version=2020-12-01 + method: GET + response: + body: "{\r\n \"name\": \"asotest-vm-fsdzay\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus2\",\r\n + \ \"tags\": {\r\n \"platformsettings.host_environment.service.platform_optedin_for_rootcerts\": + \"true\"\r\n },\r\n \"properties\": {\r\n \"vmId\": \"880b3560-9057-49bb-802b-b36805cefbf5\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_A1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"Canonical\",\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202206230\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"asotest-vm-fsdzay_OsDisk_1_7895eb75354f4eb797f0a506c423f702\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/disks/asotest-vm-fsdzay_OsDisk_1_7895eb75354f4eb797f0a506c423f702\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"poppy\",\r\n + \ \"adminUsername\": \"bloom\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\"\r\n }\r\n },\r\n + \ \"secrets\": [],\r\n \"allowExtensionOperations\": true,\r\n \"requireGuestProvisionSignal\": + true\r\n },\r\n \"networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm\"}]},\r\n + \ \"provisioningState\": \"Deleting\"\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31995 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Compute/virtualMachines/asotest-vm-fsdzay?api-version=2020-12-01 + method: GET + response: + body: "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": + \"The entity was not found in this Azure location.\"\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Length: + - "115" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Resource: + - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31994 + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm?api-version=2020-11-01 + method: DELETE + response: + body: "" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/cc2d85b2-d9b9-4948-9076-6994cf816421?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operationResults/cc2d85b2-d9b9-4948-9076-6994cf816421?api-version=2020-11-01 + Pragma: + - no-cache + Retry-After: + - "4" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm?api-version=2020-11-01 + method: GET + response: + body: "{\r\n \"error\": {\r\n \"code\": \"NotFound\",\r\n \"message\": + \"Resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/networkInterfaces/asotest-nic-byjotm + not found.\",\r\n \"details\": []\r\n }\r\n}" + headers: + Cache-Control: + - no-cache + Content-Length: + - "256" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun?api-version=2020-11-01 + method: DELETE + response: + body: "" + headers: + Azure-Asyncnotification: + - Enabled + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operations/bd779f15-33f6-400c-9bc8-6551c92adeb0?api-version=2020-11-01 + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus2/operationResults/bd779f15-33f6-400c-9bc8-6551c92adeb0?api-version=2020-11-01 + Pragma: + - no-cache + Retry-After: + - "10" + Server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Network/virtualNetworks/asotest-vn-nsreun?api-version=2020-11-01 + method: GET + response: + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Network/virtualNetworks/asotest-vn-nsreun'' + under resource group ''asotest-rg-vicazh'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "240" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: DELETE + response: + body: "" + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/35df9984-0cb8-4fbd-bc18-ebef03c39f99?api-version=2021-07-01&type=async + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus/workspaceOperationsStatus/35df9984-0cb8-4fbd-bc18-ebef03c39f99?api-version=2021-07-01&type=location + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aml-Cluster: + - vienna-eastus-01 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.244" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWSUNBWkgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: GET + response: + body: |- + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "name": "asotestworktmjmhm", + "type": "Microsoft.MachineLearningServices/workspaces", + "location": "eastus", + "tags": {}, + "etag": null, + "properties": { + "friendlyName": "", + "description": "", + "storageAccount": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw", + "keyVault": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Keyvault/vaults/asotest-keyvault-qpxtvz", + "applicationInsights": null, + "hbiWorkspace": false, + "tenantId": "00000000-0000-0000-0000-000000000000", + "imageBuildCompute": null, + "provisioningState": "Deleting", + "containerRegistry": null, + "notebookInfo": { + "resourceId": "3ee9f3bf02514babb674a4ce385236a1", + "fqdn": "ml-asotestworktmjmh-eastus-88174ee2-3d0e-4b26-baab-19b88e05a0d1.eastus.notebooks.azure.net", + "isPrivateLinkEnabled": false, + "notebookPreparationError": null + }, + "storageHnsEnabled": false, + "workspaceId": "88174ee2-3d0e-4b26-baab-19b88e05a0d1", + "linkedModelInventoryArmId": null, + "privateLinkCount": 0, + "allowPublicAccessWhenBehindVnet": false, + "discoveryUrl": "https://eastus.api.azureml.ms/discovery", + "mlFlowTrackingUri": "azureml://eastus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "sdkTelemetryAppInsightsKey": "71fa86c2-fe23-49db-bb2e-8537edfb6ead", + "sasGetterUri": "" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "eee353e8-3aa0-414e-99e3-cf25fa73a8e6", + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "sku": { + "name": "Basic", + "tier": "Basic" + }, + "systemData": { + "createdAt": "2001-02-03T04:05:06Z", + "createdBy": "harshdsingh@microsoft.com", + "createdByType": "User", + "lastModifiedAt": "2001-02-03T04:05:06Z", + "lastModifiedBy": "harshdsingh@microsoft.com", + "lastModifiedByType": "User" + } + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-3f15d597a61eff4d911d418b2ca23f0e-4f44f75e8d321cd3-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-01 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.046" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz?api-version=2021-04-01-preview + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-IIS/10.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Aspnet-Version: + - 4.0.30319 + X-Content-Type-Options: + - nosniff + X-Ms-Keyvault-Service-Version: + - 1.5.413.0 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw?api-version=2021-04-01 + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Content-Type: + - text/plain; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz?api-version=2021-04-01-preview + method: GET + response: + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/asotest-keyvault-qpxtvz'' + under resource group ''asotest-rg-vicazh'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "238" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw?api-version=2021-04-01 + method: GET + response: + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Storage/storageAccounts/asoteststorotpbaw'' + under resource group ''asotest-rg-vicazh'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "240" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh","name":"asotest-rg-vicazh","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: GET + response: + body: |- + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "name": "asotestworktmjmhm", + "type": "Microsoft.MachineLearningServices/workspaces", + "location": "eastus", + "tags": {}, + "etag": null, + "properties": { + "friendlyName": "", + "description": "", + "storageAccount": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Storage/storageAccounts/asoteststorotpbaw", + "keyVault": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.Keyvault/vaults/asotest-keyvault-qpxtvz", + "applicationInsights": null, + "hbiWorkspace": false, + "tenantId": "00000000-0000-0000-0000-000000000000", + "imageBuildCompute": null, + "provisioningState": "Deleting", + "containerRegistry": null, + "notebookInfo": { + "resourceId": "3ee9f3bf02514babb674a4ce385236a1", + "fqdn": "ml-asotestworktmjmh-eastus-88174ee2-3d0e-4b26-baab-19b88e05a0d1.eastus.notebooks.azure.net", + "isPrivateLinkEnabled": false, + "notebookPreparationError": null + }, + "storageHnsEnabled": false, + "workspaceId": "88174ee2-3d0e-4b26-baab-19b88e05a0d1", + "linkedModelInventoryArmId": null, + "privateLinkCount": 0, + "allowPublicAccessWhenBehindVnet": false, + "discoveryUrl": "https://eastus.api.azureml.ms/discovery", + "mlFlowTrackingUri": "azureml://eastus.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm", + "sdkTelemetryAppInsightsKey": "71fa86c2-fe23-49db-bb2e-8537edfb6ead", + "sasGetterUri": "" + }, + "identity": { + "type": "SystemAssigned", + "principalId": "eee353e8-3aa0-414e-99e3-cf25fa73a8e6", + "tenantId": "00000000-0000-0000-0000-000000000000" + }, + "sku": { + "name": "Basic", + "tier": "Basic" + }, + "systemData": { + "createdAt": "2001-02-03T04:05:06Z", + "createdBy": "harshdsingh@microsoft.com", + "createdByType": "User", + "lastModifiedAt": "2001-02-03T04:05:06Z", + "lastModifiedBy": "harshdsingh@microsoft.com", + "lastModifiedByType": "User" + } + } + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Request-Context: + - appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d + Server-Timing: + - traceparent;desc="00-205843a39995d34d931f54751edc6daf-01c295485ce25057-01" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding,Accept-Encoding + X-Aml-Cluster: + - vienna-eastus-01 + X-Content-Type-Options: + - nosniff + X-Ms-Response-Type: + - standard + X-Request-Time: + - "0.053" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh","name":"asotest-rg-vicazh","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh","name":"asotest-rg-vicazh","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh/providers/Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm?api-version=2021-07-01 + method: GET + response: + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.MachineLearningServices/workspaces/asotestworktmjmhm'' + under resource group ''asotest-rg-vicazh'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "251" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh","name":"asotest-rg-vicazh","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Deleting"}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vicazh?api-version=2020-06-01 + method: GET + response: + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-vicazh'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + status: 404 Not Found + code: 404 + duration: "" diff --git a/v2/internal/genericarmclient/generic_client.go b/v2/internal/genericarmclient/generic_client.go index ca9614493b..04b5310a30 100644 --- a/v2/internal/genericarmclient/generic_client.go +++ b/v2/internal/genericarmclient/generic_client.go @@ -11,9 +11,8 @@ import ( "strings" "time" - "github.com/pkg/errors" - "github.com/Azure/azure-service-operator/v2/internal/metrics" + "github.com/pkg/errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" diff --git a/v2/internal/testcommon/creds.go b/v2/internal/testcommon/creds.go index 3d4c2d72a4..3017fcefa2 100644 --- a/v2/internal/testcommon/creds.go +++ b/v2/internal/testcommon/creds.go @@ -18,9 +18,14 @@ import ( // this is shared between tests because // instantiating it requires HTTP calls var cachedCreds azcore.TokenCredential -var cachedSubID string +var cachedSubID AzureIDs -func getCreds() (azcore.TokenCredential, string, error) { +type AzureIDs struct { + subscriptionID string + tenantID string +} + +func getCreds() (azcore.TokenCredential, AzureIDs, error) { if cachedCreds != nil { return cachedCreds, cachedSubID, nil @@ -28,15 +33,25 @@ func getCreds() (azcore.TokenCredential, string, error) { creds, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - return nil, "", errors.Wrapf(err, "creating default credential") + return nil, AzureIDs{}, errors.Wrapf(err, "creating default credential") } subscriptionID := os.Getenv(config.SubscriptionIDVar) if subscriptionID == "" { - return nil, "", errors.Errorf("required environment variable %q was not supplied", config.SubscriptionIDVar) + return nil, AzureIDs{}, errors.Errorf("required environment variable %q was not supplied", config.SubscriptionIDVar) + } + + tenantID := os.Getenv(config.TenantIDVar) + if tenantID == "" { + return nil, AzureIDs{}, errors.Errorf("required environment variable %q was not supplied", config.TenantIDVar) + } + + ids := AzureIDs{ + subscriptionID: subscriptionID, + tenantID: tenantID, } cachedCreds = creds - cachedSubID = subscriptionID - return creds, subscriptionID, nil + cachedSubID = ids + return creds, ids, nil } diff --git a/v2/internal/testcommon/test_context.go b/v2/internal/testcommon/test_context.go index c15bf40dca..bdc36e95db 100644 --- a/v2/internal/testcommon/test_context.go +++ b/v2/internal/testcommon/test_context.go @@ -49,6 +49,7 @@ type PerTestContext struct { AzureClientRecorder *recorder.Recorder AzureClient *genericarmclient.GenericClient AzureSubscription string + AzureTenant string AzureMatch *ARMMatcher Namer ResourceNamer NoSpaceNamer ResourceNamer @@ -87,7 +88,7 @@ func (tc TestContext) ForTest(t *testing.T) (PerTestContext, error) { logger := NewTestLogger(t) cassetteName := "recordings/" + t.Name() - creds, subscriptionID, recorder, err := createRecorder(cassetteName, tc.RecordReplay) + creds, azureIDs, recorder, err := createRecorder(cassetteName, tc.RecordReplay) if err != nil { return PerTestContext{}, errors.Wrapf(err, "creating recorder") } @@ -100,7 +101,7 @@ func (tc TestContext) ForTest(t *testing.T) (PerTestContext, error) { Transport: addCountHeader(translateErrors(recorder, cassetteName, t)), } var armClient *genericarmclient.GenericClient - armClient, err = genericarmclient.NewGenericClientFromHTTPClient(cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint, creds, httpClient, subscriptionID, metrics.NewARMClientMetrics()) + armClient, err = genericarmclient.NewGenericClientFromHTTPClient(cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint, creds, httpClient, azureIDs.subscriptionID, metrics.NewARMClientMetrics()) if err != nil { logger.Error(err, "failed to get new generic client") t.Fail() @@ -139,7 +140,8 @@ func (tc TestContext) ForTest(t *testing.T) (PerTestContext, error) { Namer: namer, NoSpaceNamer: namer.WithSeparator(""), AzureClient: armClient, - AzureSubscription: subscriptionID, + AzureSubscription: azureIDs.subscriptionID, + AzureTenant: azureIDs.tenantID, AzureMatch: NewARMMatcher(armClient), AzureClientRecorder: recorder, TestName: t.Name(), @@ -183,7 +185,7 @@ func ensureCassetteFileExists(cassetteName string) error { return nil } -func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredential, string, *recorder.Recorder, error) { +func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredential, AzureIDs, *recorder.Recorder, error) { var err error var r *recorder.Recorder if recordReplay { @@ -193,23 +195,24 @@ func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredent } if err != nil { - return nil, "", nil, errors.Wrapf(err, "creating recorder") + return nil, AzureIDs{}, nil, errors.Wrapf(err, "creating recorder") } var creds azcore.TokenCredential - var subscriptionID string + var azureIDs AzureIDs if r.Mode() == recorder.ModeRecording || r.Mode() == recorder.ModeDisabled { // if we are recording, we need auth - creds, subscriptionID, err = getCreds() + creds, azureIDs, err = getCreds() if err != nil { - return nil, "", nil, err + return nil, azureIDs, nil, err } } else { // if we are replaying, we won't need auth - // and we use a dummy subscription ID - subscriptionID = uuid.Nil.String() + // and we use a dummy subscription ID/tenant ID creds = mockTokenCred{} + azureIDs.tenantID = uuid.Nil.String() + azureIDs.subscriptionID = uuid.Nil.String() } // check body as well as URL/Method (copied from go-vcr documentation) @@ -240,23 +243,29 @@ func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredent // rewrite all request/response fields to hide the real subscription ID // this is *not* a security measure but intended to make the tests updateable from // any subscription, so a contributor can update the tests against their own sub. - hideSubID := func(s string) string { - return strings.ReplaceAll(s, subscriptionID, uuid.Nil.String()) + hideID := func(s string, id string) string { + return strings.ReplaceAll(s, id, uuid.Nil.String()) } - i.Request.Body = hideRecordingData(hideSubID(i.Request.Body)) - i.Response.Body = hideRecordingData(hideSubID(i.Response.Body)) - i.Request.URL = hideSubID(i.Request.URL) + i.Request.Body = hideRecordingData(hideID(i.Request.Body, azureIDs.subscriptionID)) + i.Response.Body = hideRecordingData(hideID(i.Response.Body, azureIDs.subscriptionID)) + i.Request.URL = hideID(i.Request.URL, azureIDs.subscriptionID) + + i.Request.Body = hideRecordingData(hideID(i.Request.Body, azureIDs.tenantID)) + i.Response.Body = hideRecordingData(hideID(i.Response.Body, azureIDs.tenantID)) + i.Request.URL = hideID(i.Request.URL, azureIDs.tenantID) for _, values := range i.Request.Headers { for i := range values { - values[i] = hideSubID(values[i]) + values[i] = hideID(values[i], azureIDs.subscriptionID) + values[i] = hideID(values[i], azureIDs.tenantID) } } for _, values := range i.Response.Headers { for i := range values { - values[i] = hideSubID(values[i]) + values[i] = hideID(values[i], azureIDs.subscriptionID) + values[i] = hideID(values[i], azureIDs.tenantID) } } @@ -271,7 +280,7 @@ func createRecorder(cassetteName string, recordReplay bool) (azcore.TokenCredent return nil }) - return creds, subscriptionID, r, nil + return creds, azureIDs, r, nil } var requestHeadersToRemove = []string{ diff --git a/v2/tools/generator/internal/codegen/pipeline/resource_registration_file.go b/v2/tools/generator/internal/codegen/pipeline/resource_registration_file.go index 2b61d7d2ea..3188fb4204 100644 --- a/v2/tools/generator/internal/codegen/pipeline/resource_registration_file.go +++ b/v2/tools/generator/internal/codegen/pipeline/resource_registration_file.go @@ -293,6 +293,7 @@ func createGetKnownStorageTypesFunc( // } if indexFuncs, ok := indexFunctions[typeName]; ok { sliceBuilder := astbuilder.NewSliceLiteralBuilder(astmodel.IndexRegistrationType.AsType(codeGenerationContext), true) + sort.Slice(indexFuncs, orderByFunctionName(indexFuncs)) for _, indexFunc := range indexFuncs { newIndexFunctionBuilder := astbuilder.NewCompositeLiteralBuilder(astmodel.IndexRegistrationType.AsType(codeGenerationContext)) @@ -313,6 +314,8 @@ func createGetKnownStorageTypesFunc( // } if secretKeys, ok := secretPropertyKeys[typeName]; ok { newWatchBuilder := astbuilder.NewCompositeLiteralBuilder(astmodel.WatchRegistrationType.AsType(codeGenerationContext)) + sort.Strings(secretKeys) + // Not using astbuilder here because we want this to go onto a single line source := &dst.CompositeLit{ Type: astmodel.ControllerRuntimeSourceKindType.AsType(codeGenerationContext),