From 03b5354d274520bf545dbf420f6858c1a423faf1 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:59:05 +1300 Subject: [PATCH 01/10] Add EventHub 2024-01-01 and export keys --- docs/hugo/content/reference/_index.md | 12 + .../hugo/content/reference/eventhub/_index.md | 12 + .../customizations/namespace_extension.go | 115 + .../namespace_extension_types_gen.go | 6 +- ...namespaces_authorization_rule_extension.go | 113 + ..._authorization_rule_extension_types_gen.go | 6 +- ...namespaces_eventhub_extension_types_gen.go | 6 +- ..._eventhubs_authorization_rule_extension.go | 113 + ..._authorization_rule_extension_types_gen.go | 6 +- ...hubs_consumer_group_extension_types_gen.go | 6 +- .../v1api20211101/namespace_types_gen.go | 480 +-- .../v1api20211101/namespace_types_gen_test.go | 204 +- ...namespaces_authorization_rule_types_gen.go | 272 +- ...paces_authorization_rule_types_gen_test.go | 217 +- .../namespaces_eventhub_types_gen.go | 163 +- .../namespaces_eventhub_types_gen_test.go | 3 +- ..._eventhubs_authorization_rule_types_gen.go | 272 +- ...thubs_authorization_rule_types_gen_test.go | 217 +- ...aces_eventhubs_consumer_group_types_gen.go | 51 +- ...eventhubs_consumer_group_types_gen_test.go | 3 +- .../storage/namespace_types_gen.go | 2504 ++++++++++- .../storage/namespace_types_gen_test.go | 1037 ++++- ...namespaces_authorization_rule_types_gen.go | 636 ++- ...paces_authorization_rule_types_gen_test.go | 384 ++ .../storage/namespaces_eventhub_types_gen.go | 1019 ++++- .../namespaces_eventhub_types_gen_test.go | 338 ++ ..._eventhubs_authorization_rule_types_gen.go | 636 ++- ...thubs_authorization_rule_types_gen_test.go | 384 ++ ...aces_eventhubs_consumer_group_types_gen.go | 405 +- ...eventhubs_consumer_group_types_gen_test.go | 170 + .../v1api20211101/storage/structure.txt | 121 +- .../storage/zz_generated.deepcopy.go | 222 + v2/api/eventhub/v1api20211101/structure.txt | 24 +- .../v1api20211101/zz_generated.deepcopy.go | 180 + v2/api/eventhub/v1api20240101/doc.go | 10 + .../v1api20240101/groupversion_info_gen.go | 32 + .../namespace_spec_arm_types_gen.go | 154 + .../namespace_spec_arm_types_gen_test.go | 587 +++ .../namespace_status_arm_types_gen.go | 227 + .../namespace_status_arm_types_gen_test.go | 744 ++++ .../v1api20240101/namespace_types_gen.go | 3811 +++++++++++++++++ .../v1api20240101/namespace_types_gen_test.go | 2173 ++++++++++ ...s_authorization_rule_spec_arm_types_gen.go | 35 + ...horization_rule_spec_arm_types_gen_test.go | 154 + ...authorization_rule_status_arm_types_gen.go | 30 + ...rization_rule_status_arm_types_gen_test.go | 158 + ...namespaces_authorization_rule_types_gen.go | 1021 +++++ ...paces_authorization_rule_types_gen_test.go | 605 +++ .../namespaces_eventhub_spec_arm_types_gen.go | 123 + ...spaces_eventhub_spec_arm_types_gen_test.go | 515 +++ ...amespaces_eventhub_status_arm_types_gen.go | 135 + ...aces_eventhub_status_arm_types_gen_test.go | 533 +++ .../namespaces_eventhub_types_gen.go | 2660 ++++++++++++ .../namespaces_eventhub_types_gen_test.go | 1322 ++++++ ...s_authorization_rule_spec_arm_types_gen.go | 35 + ...horization_rule_spec_arm_types_gen_test.go | 154 + ...authorization_rule_status_arm_types_gen.go | 30 + ...rization_rule_status_arm_types_gen_test.go | 158 + ..._eventhubs_authorization_rule_types_gen.go | 1021 +++++ ...thubs_authorization_rule_types_gen_test.go | 605 +++ ...aces_eventhubs_consumer_group_types_gen.go | 788 ++++ ...eventhubs_consumer_group_types_gen_test.go | 393 ++ ...nthubs_consumergroup_spec_arm_types_gen.go | 37 + ...s_consumergroup_spec_arm_types_gen_test.go | 154 + ...hubs_consumergroup_status_arm_types_gen.go | 38 + ...consumergroup_status_arm_types_gen_test.go | 160 + .../storage/groupversion_info_gen.go | 32 + .../storage/namespace_types_gen.go | 391 ++ .../storage/namespace_types_gen_test.go | 1316 ++++++ ...namespaces_authorization_rule_types_gen.go | 228 + ...paces_authorization_rule_types_gen_test.go | 352 ++ .../storage/namespaces_eventhub_types_gen.go | 313 ++ .../namespaces_eventhub_types_gen_test.go | 808 ++++ ..._eventhubs_authorization_rule_types_gen.go | 228 + ...thubs_authorization_rule_types_gen_test.go | 352 ++ ...aces_eventhubs_consumer_group_types_gen.go | 213 + ...eventhubs_consumer_group_types_gen_test.go | 224 + .../v1api20240101/storage/structure.txt | 283 ++ .../storage/zz_generated.deepcopy.go | 2082 +++++++++ v2/api/eventhub/v1api20240101/structure.txt | 669 +++ .../v1api20240101/zz_generated.deepcopy.go | 3318 ++++++++++++++ v2/api/eventhub/versions_matrix.md | 142 +- v2/azure-arm.yaml | 59 +- v2/go.mod | 1 + v2/go.sum | 2 + .../controllers/controller_resources_gen.go | 28 +- ...> crd_eventhub_namespace_20211101_test.go} | 81 +- .../crd_eventhub_namespace_20240101_test.go | 257 ++ ...Test_EventHub_Namespace_20211101_CRUD.yaml | 2337 ++++++++++ .../Test_EventHub_Namespace_CRUD.yaml | 1335 ------ ...st_Eventhub_v1api_CreationAndDeletion.yaml | 901 ---- .../v1api20211101_namespace.yaml | 0 ...i20211101_namespacesauthorizationrule.yaml | 0 .../v1api20211101_namespaceseventhub.yaml | 0 ..._namespaceseventhubsauthorizationrule.yaml | 0 ...1101_namespaceseventhubsconsumergroup.yaml | 0 .../v1api20240101_namespace.yaml | 20 + ...i20240101_namespacesauthorizationrule.yaml | 19 + .../v1api20240101_namespaceseventhub.yaml | 10 + ..._namespaceseventhubsauthorizationrule.yaml | 19 + ...0101_namespaceseventhubsconsumergroup.yaml | 9 + 101 files changed, 41878 insertions(+), 3090 deletions(-) create mode 100644 v2/api/eventhub/customizations/namespace_extension.go create mode 100644 v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go create mode 100644 v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go create mode 100644 v2/api/eventhub/v1api20240101/doc.go create mode 100644 v2/api/eventhub/v1api20240101/groupversion_info_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespace_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespace_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespace_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go create mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go create mode 100644 v2/api/eventhub/v1api20240101/storage/structure.txt create mode 100644 v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go create mode 100644 v2/api/eventhub/v1api20240101/structure.txt create mode 100644 v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go rename v2/internal/controllers/{crd_eventhub_namespace_test.go => crd_eventhub_namespace_20211101_test.go} (57%) create mode 100644 v2/internal/controllers/crd_eventhub_namespace_20240101_test.go create mode 100644 v2/internal/controllers/recordings/Test_EventHub_Namespace_20211101_CRUD.yaml delete mode 100644 v2/internal/controllers/recordings/Test_EventHub_Namespace_CRUD.yaml delete mode 100644 v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api_CreationAndDeletion.yaml rename v2/samples/eventhub/{v1api => v1api20211101}/v1api20211101_namespace.yaml (100%) rename v2/samples/eventhub/{v1api => v1api20211101}/v1api20211101_namespacesauthorizationrule.yaml (100%) rename v2/samples/eventhub/{v1api => v1api20211101}/v1api20211101_namespaceseventhub.yaml (100%) rename v2/samples/eventhub/{v1api => v1api20211101}/v1api20211101_namespaceseventhubsauthorizationrule.yaml (100%) rename v2/samples/eventhub/{v1api => v1api20211101}/v1api20211101_namespaceseventhubsconsumergroup.yaml (100%) create mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml create mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml create mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml create mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml create mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index 9478d38a82a..56765cdb339 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -387,6 +387,18 @@ These resource(s) are available for use in the current release of ASO. Different To install the CRDs for these resources, your ASO configuration must include `eventhub.azure.com/*` as a one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations. +### Next Release + +Development of these new resources is complete and they will be available in the next release of ASO. + +| Resource | ARM Version | CRD Version | Supported From | Sample | +|--------------------------------------|-------------|---------------|----------------|--------| +| Namespace | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesEventhub | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesEventhubsAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesEventhubsConsumerGroup | 2024-01-01 | v1api20240101 | v2.7.0 | - | + ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. diff --git a/docs/hugo/content/reference/eventhub/_index.md b/docs/hugo/content/reference/eventhub/_index.md index 2ac7a460ad2..2ae1e949d5c 100644 --- a/docs/hugo/content/reference/eventhub/_index.md +++ b/docs/hugo/content/reference/eventhub/_index.md @@ -5,6 +5,18 @@ no_list: true --- To install the CRDs for these resources, your ASO configuration must include `eventhub.azure.com/*` as a one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations. +### Next Release + +Development of these new resources is complete and they will be available in the next release of ASO. + +| Resource | ARM Version | CRD Version | Supported From | Sample | +|--------------------------------------|-------------|---------------|----------------|--------| +| Namespace | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesEventhub | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesEventhubsAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | +| NamespacesEventhubsConsumerGroup | 2024-01-01 | v1api20240101 | v2.7.0 | - | + ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. diff --git a/v2/api/eventhub/customizations/namespace_extension.go b/v2/api/eventhub/customizations/namespace_extension.go new file mode 100644 index 00000000000..d2e9e39b7d6 --- /dev/null +++ b/v2/api/eventhub/customizations/namespace_extension.go @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + */ + +package customizations + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" + "github.com/go-logr/logr" + "github.com/pkg/errors" + v1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/conversion" + + "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "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/secrets" +) + +var _ genruntime.KubernetesExporter = &NamespaceExtension{} + +func (ext *NamespaceExtension) ExportKubernetesResources( + ctx context.Context, + obj genruntime.MetaObject, + armClient *genericarmclient.GenericClient, + log logr.Logger, +) ([]client.Object, 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.Namespace) + if !ok { + return nil, errors.Errorf("cannot run on unknown resource type %T, expected *eventhub.Namespace", 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 := namespaceSecretsSpecified(typedObj) + if !hasSecrets { + log.V(Debug).Info("No secrets retrieval to perform as operatorSpec is empty") + return nil, nil + } + + id, err := genruntime.GetAndParseResourceID(typedObj) + if err != nil { + return nil, err + } + + // Only bother calling ListKeys if there are secrets to retrieve + var res armeventhub.NamespacesClientListKeysResponse + if hasSecrets { + subscription := id.SubscriptionID + // Using armClient.ClientOptions() here ensures we share the same HTTP connection, so this is not opening a new + // connection each time through + var confClient *armeventhub.NamespacesClient + confClient, err = armeventhub.NewNamespacesClient(subscription, armClient.Creds(), armClient.ClientOptions()) + if err != nil { + return nil, errors.Wrapf(err, "failed to create new NamespaceClient") + } + + // RootManageSharedAccessKey is the default auth rule for namespace. + // See https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string + res, err = confClient.ListKeys(ctx, id.ResourceGroupName, typedObj.AzureName(), "RootManageSharedAccessKey", nil) + if err != nil { + return nil, errors.Wrapf(err, "failed to retreive response") + } + + } + + secretSlice, err := namespaceSecretsToWrite(typedObj, res.AccessKeys) + if err != nil { + return nil, err + } + + return secrets.SliceToClientObjectSlice(secretSlice), nil +} + +func namespaceSecretsSpecified(obj *storage.Namespace) bool { + if obj.Spec.OperatorSpec == nil || obj.Spec.OperatorSpec.Secrets == nil { + return false + } + + secrets := obj.Spec.OperatorSpec.Secrets + + if secrets.PrimaryKey != nil || + secrets.SecondaryKey != nil || + secrets.PrimaryConnectionString != nil || + secrets.SecondaryConnectionString != nil { + return true + } + + return false +} + +func namespaceSecretsToWrite(obj *storage.Namespace, keys armeventhub.AccessKeys) ([]*v1.Secret, error) { + operatorSpecSecrets := obj.Spec.OperatorSpec.Secrets + if operatorSpecSecrets == nil { + return nil, errors.Errorf("unexpected nil operatorspec") + } + + collector := secrets.NewCollector(obj.Namespace) + + collector.AddValue(operatorSpecSecrets.PrimaryKey, *keys.PrimaryKey) + collector.AddValue(operatorSpecSecrets.SecondaryKey, *keys.SecondaryKey) + collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, *keys.PrimaryConnectionString) + collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, *keys.SecondaryConnectionString) + + return collector.Values() +} diff --git a/v2/api/eventhub/customizations/namespace_extension_types_gen.go b/v2/api/eventhub/customizations/namespace_extension_types_gen.go index b83e3d7878c..042ff7939bf 100644 --- a/v2/api/eventhub/customizations/namespace_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespace_extension_types_gen.go @@ -6,6 +6,8 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +18,7 @@ type NamespaceExtension struct { func (extension *NamespaceExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.Namespace{}, - &v20211101s.Namespace{}} + &v20211101s.Namespace{}, + &v20240101.Namespace{}, + &v20240101s.Namespace{}} } diff --git a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go new file mode 100644 index 00000000000..54c84522118 --- /dev/null +++ b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go @@ -0,0 +1,113 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + */ + +package customizations + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" + "github.com/go-logr/logr" + "github.com/pkg/errors" + v1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/conversion" + + "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "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/secrets" +) + +var _ genruntime.KubernetesExporter = &NamespacesAuthorizationRuleExtension{} + +func (ext *NamespacesAuthorizationRuleExtension) ExportKubernetesResources( + ctx context.Context, + obj genruntime.MetaObject, + armClient *genericarmclient.GenericClient, + log logr.Logger, +) ([]client.Object, 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.NamespacesAuthorizationRule) + if !ok { + return nil, errors.Errorf("cannot run on unknown resource type %T, expected *eventhub.NamespacesAuthorizationRule", 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 := namespacesAuthorizationRuleSecretsSpecified(typedObj) + if !hasSecrets { + log.V(Debug).Info("No secrets retrieval to perform as operatorSpec is empty") + return nil, nil + } + + id, err := genruntime.GetAndParseResourceID(typedObj) + if err != nil { + return nil, err + } + + // Only bother calling ListKeys if there are secrets to retrieve + var res armeventhub.NamespacesClientListKeysResponse + if hasSecrets { + subscription := id.SubscriptionID + // Using armClient.ClientOptions() here ensures we share the same HTTP connection, so this is not opening a new + // connection each time through + var confClient *armeventhub.NamespacesClient + confClient, err = armeventhub.NewNamespacesClient(subscription, armClient.Creds(), armClient.ClientOptions()) + if err != nil { + return nil, errors.Wrapf(err, "failed to create new NamespaceClient") + } + + res, err = confClient.ListKeys(ctx, id.ResourceGroupName, id.Parent.Name, typedObj.AzureName(), nil) + if err != nil { + return nil, errors.Wrapf(err, "failed to retreive response") + } + + } + + secretSlice, err := namespacesAuthorizationRuleSecretsToWrite(typedObj, res.AccessKeys) + if err != nil { + return nil, err + } + + return secrets.SliceToClientObjectSlice(secretSlice), nil +} + +func namespacesAuthorizationRuleSecretsSpecified(obj *storage.NamespacesAuthorizationRule) bool { + if obj.Spec.OperatorSpec == nil || obj.Spec.OperatorSpec.Secrets == nil { + return false + } + + secrets := obj.Spec.OperatorSpec.Secrets + + if secrets.PrimaryKey != nil || + secrets.SecondaryKey != nil || + secrets.PrimaryConnectionString != nil || + secrets.SecondaryConnectionString != nil { + return true + } + + return false +} + +func namespacesAuthorizationRuleSecretsToWrite(obj *storage.NamespacesAuthorizationRule, keys armeventhub.AccessKeys) ([]*v1.Secret, error) { + operatorSpecSecrets := obj.Spec.OperatorSpec.Secrets + if operatorSpecSecrets == nil { + return nil, errors.Errorf("unexpected nil operatorspec") + } + + collector := secrets.NewCollector(obj.Namespace) + + collector.AddValue(operatorSpecSecrets.PrimaryKey, *keys.PrimaryKey) + collector.AddValue(operatorSpecSecrets.SecondaryKey, *keys.SecondaryKey) + collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, *keys.PrimaryConnectionString) + collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, *keys.SecondaryConnectionString) + + return collector.Values() +} diff --git a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go index a625e2fdacc..befcc3cd3f8 100644 --- a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go @@ -6,6 +6,8 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +18,7 @@ type NamespacesAuthorizationRuleExtension struct { func (extension *NamespacesAuthorizationRuleExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesAuthorizationRule{}, - &v20211101s.NamespacesAuthorizationRule{}} + &v20211101s.NamespacesAuthorizationRule{}, + &v20240101.NamespacesAuthorizationRule{}, + &v20240101s.NamespacesAuthorizationRule{}} } diff --git a/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go index 51d80422dc9..59dbe19a9a4 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go @@ -6,6 +6,8 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +18,7 @@ type NamespacesEventhubExtension struct { func (extension *NamespacesEventhubExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesEventhub{}, - &v20211101s.NamespacesEventhub{}} + &v20211101s.NamespacesEventhub{}, + &v20240101.NamespacesEventhub{}, + &v20240101s.NamespacesEventhub{}} } diff --git a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go new file mode 100644 index 00000000000..22557311c01 --- /dev/null +++ b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go @@ -0,0 +1,113 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + */ + +package customizations + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" + "github.com/go-logr/logr" + "github.com/pkg/errors" + v1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/conversion" + + "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "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/secrets" +) + +var _ genruntime.KubernetesExporter = &NamespacesEventhubsAuthorizationRuleExtension{} + +func (ext *NamespacesEventhubsAuthorizationRuleExtension) ExportKubernetesResources( + ctx context.Context, + obj genruntime.MetaObject, + armClient *genericarmclient.GenericClient, + log logr.Logger, +) ([]client.Object, 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.NamespacesEventhubsAuthorizationRule) + if !ok { + return nil, errors.Errorf("cannot run on unknown resource type %T, expected *eventhub.NamespacesEventhubsAuthorizationRule", 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 := namespacesEventHubAuthorizationRuleSecretsSpecified(typedObj) + if !hasSecrets { + log.V(Debug).Info("No secrets retrieval to perform as operatorSpec is empty") + return nil, nil + } + + id, err := genruntime.GetAndParseResourceID(typedObj) + if err != nil { + return nil, err + } + + // Only bother calling ListKeys if there are secrets to retrieve + var res armeventhub.EventHubsClientListKeysResponse + if hasSecrets { + subscription := id.SubscriptionID + // Using armClient.ClientOptions() here ensures we share the same HTTP connection, so this is not opening a new + // connection each time through + var confClient *armeventhub.EventHubsClient + confClient, err = armeventhub.NewEventHubsClient(subscription, armClient.Creds(), armClient.ClientOptions()) + if err != nil { + return nil, errors.Wrapf(err, "failed to create new EventHubsClient") + } + + res, err = confClient.ListKeys(ctx, id.ResourceGroupName, id.Parent.Parent.Name, id.Parent.Name, typedObj.Name, nil) + if err != nil { + return nil, errors.Wrapf(err, "failed to retreive response") + } + + } + + secretSlice, err := namespacesEventHubAuthorizationRuleSecretsToWrite(typedObj, res.AccessKeys) + if err != nil { + return nil, err + } + + return secrets.SliceToClientObjectSlice(secretSlice), nil +} + +func namespacesEventHubAuthorizationRuleSecretsSpecified(obj *storage.NamespacesEventhubsAuthorizationRule) bool { + if obj.Spec.OperatorSpec == nil || obj.Spec.OperatorSpec.Secrets == nil { + return false + } + + secrets := obj.Spec.OperatorSpec.Secrets + + if secrets.PrimaryKey != nil || + secrets.SecondaryKey != nil || + secrets.PrimaryConnectionString != nil || + secrets.SecondaryConnectionString != nil { + return true + } + + return false +} + +func namespacesEventHubAuthorizationRuleSecretsToWrite(obj *storage.NamespacesEventhubsAuthorizationRule, keys armeventhub.AccessKeys) ([]*v1.Secret, error) { + operatorSpecSecrets := obj.Spec.OperatorSpec.Secrets + if operatorSpecSecrets == nil { + return nil, errors.Errorf("unexpected nil operatorspec") + } + + collector := secrets.NewCollector(obj.Namespace) + + collector.AddValue(operatorSpecSecrets.PrimaryKey, *keys.PrimaryKey) + collector.AddValue(operatorSpecSecrets.SecondaryKey, *keys.SecondaryKey) + collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, *keys.PrimaryConnectionString) + collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, *keys.SecondaryConnectionString) + + return collector.Values() +} diff --git a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go index 06a7276a861..85c5785440e 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go @@ -6,6 +6,8 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +18,7 @@ type NamespacesEventhubsAuthorizationRuleExtension struct { func (extension *NamespacesEventhubsAuthorizationRuleExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesEventhubsAuthorizationRule{}, - &v20211101s.NamespacesEventhubsAuthorizationRule{}} + &v20211101s.NamespacesEventhubsAuthorizationRule{}, + &v20240101.NamespacesEventhubsAuthorizationRule{}, + &v20240101s.NamespacesEventhubsAuthorizationRule{}} } diff --git a/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go index 6c071470275..8d8b70ce884 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go @@ -6,6 +6,8 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +18,7 @@ type NamespacesEventhubsConsumerGroupExtension struct { func (extension *NamespacesEventhubsConsumerGroupExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesEventhubsConsumerGroup{}, - &v20211101s.NamespacesEventhubsConsumerGroup{}} + &v20211101s.NamespacesEventhubsConsumerGroup{}, + &v20240101.NamespacesEventhubsConsumerGroup{}, + &v20240101s.NamespacesEventhubsConsumerGroup{}} } diff --git a/v2/api/eventhub/v1api20211101/namespace_types_gen.go b/v2/api/eventhub/v1api20211101/namespace_types_gen.go index ea3cd27bf0b..d0054136bef 100644 --- a/v2/api/eventhub/v1api20211101/namespace_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespace_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &Namespace{} // ConvertFrom populates our Namespace from the provided hub Namespace func (namespace *Namespace) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20211101s.Namespace) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var source v20211101s.Namespace + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = namespace.AssignProperties_From_Namespace(&source) + if err != nil { + return errors.Wrap(err, "converting from source to namespace") } - return namespace.AssignProperties_From_Namespace(source) + return nil } // ConvertTo populates the provided hub Namespace from our Namespace func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20211101s.Namespace) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var destination v20211101s.Namespace + err := namespace.AssignProperties_To_Namespace(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from namespace") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return namespace.AssignProperties_To_Namespace(destination) + return nil } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaces,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaces.eventhub.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (namespace *Namespace) defaultAzureName() { // defaultImpl applies the code generated defaults to the Namespace resource func (namespace *Namespace) defaultImpl() { namespace.defaultAzureName() } -var _ genruntime.ImportableResource = &Namespace{} - -// InitializeSpec initializes the spec for this resource from the given status -func (namespace *Namespace) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespace_STATUS); ok { - return namespace.Spec.Initialize_From_Namespace_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespace_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &Namespace{} // AzureName returns the Azure name of the resource @@ -208,7 +211,7 @@ func (namespace *Namespace) ValidateUpdate(old runtime.Object) (admission.Warnin // createValidations validates the creation of the resource func (namespace *Namespace) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){namespace.validateResourceReferences, namespace.validateOwnerReference} + return []func() (admission.Warnings, error){namespace.validateResourceReferences, namespace.validateOwnerReference, namespace.validateSecretDestinations} } // deleteValidations validates the deletion of the resource @@ -226,6 +229,9 @@ func (namespace *Namespace) updateValidations() []func(old runtime.Object) (admi func(old runtime.Object) (admission.Warnings, error) { return namespace.validateOwnerReference() }, + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateSecretDestinations() + }, } } @@ -243,6 +249,23 @@ func (namespace *Namespace) validateResourceReferences() (admission.Warnings, er return genruntime.ValidateResourceReferences(refs) } +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (namespace *Namespace) validateSecretDestinations() (admission.Warnings, error) { + if namespace.Spec.OperatorSpec == nil { + return nil, nil + } + if namespace.Spec.OperatorSpec.Secrets == nil { + return nil, nil + } + toValidate := []*genruntime.SecretDestination{ + namespace.Spec.OperatorSpec.Secrets.PrimaryConnectionString, + namespace.Spec.OperatorSpec.Secrets.PrimaryKey, + namespace.Spec.OperatorSpec.Secrets.SecondaryConnectionString, + namespace.Spec.OperatorSpec.Secrets.SecondaryKey, + } + return genruntime.ValidateSecretDestinations(toValidate) +} + // validateWriteOnceProperties validates all WriteOnce properties func (namespace *Namespace) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { oldObj, ok := old.(*Namespace) @@ -365,6 +388,10 @@ type Namespace_Spec struct { // throughput units. ( '0' if AutoInflateEnabled = true) MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespaceOperatorSpec `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 @@ -574,6 +601,8 @@ func (namespace *Namespace_Spec) PopulateFromARM(owner genruntime.ArbitraryOwner } } + // no assignment for property "OperatorSpec" + // Set property "Owner": namespace.Owner = &genruntime.KnownResourceReference{ Name: owner.Name, @@ -733,6 +762,18 @@ func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *v2 // MaximumThroughputUnits namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespaceOperatorSpec + err := operatorSpec.AssignProperties_From_NamespaceOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSpec() to populate field OperatorSpec") + } + namespace.OperatorSpec = &operatorSpec + } else { + namespace.OperatorSpec = nil + } + // Owner if source.Owner != nil { owner := source.Owner.Copy() @@ -841,6 +882,18 @@ func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination // MaximumThroughputUnits destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits) + // OperatorSpec + if namespace.OperatorSpec != nil { + var operatorSpec v20211101s.NamespaceOperatorSpec + err := namespace.OperatorSpec.AssignProperties_To_NamespaceOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + // OriginalVersion destination.OriginalVersion = namespace.OriginalVersion() @@ -886,101 +939,6 @@ func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination return nil } -// Initialize_From_Namespace_STATUS populates our Namespace_Spec from the provided source Namespace_STATUS -func (namespace *Namespace_Spec) Initialize_From_Namespace_STATUS(source *Namespace_STATUS) error { - - // AlternateName - namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) - - // ClusterArmReference - if source.ClusterArmId != nil { - clusterArmReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterArmId) - namespace.ClusterArmReference = &clusterArmReference - } else { - namespace.ClusterArmReference = nil - } - - // DisableLocalAuth - if source.DisableLocalAuth != nil { - disableLocalAuth := *source.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } else { - namespace.DisableLocalAuth = nil - } - - // Encryption - if source.Encryption != nil { - var encryption Encryption - err := encryption.Initialize_From_Encryption_STATUS(source.Encryption) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Encryption_STATUS() to populate field Encryption") - } - namespace.Encryption = &encryption - } else { - namespace.Encryption = nil - } - - // Identity - if source.Identity != nil { - var identity Identity - err := identity.Initialize_From_Identity_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Identity_STATUS() to populate field Identity") - } - namespace.Identity = &identity - } else { - namespace.Identity = nil - } - - // IsAutoInflateEnabled - if source.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *source.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - namespace.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if source.KafkaEnabled != nil { - kafkaEnabled := *source.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } else { - namespace.KafkaEnabled = nil - } - - // Location - namespace.Location = genruntime.ClonePointerToString(source.Location) - - // MaximumThroughputUnits - namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) - - // Sku - if source.Sku != nil { - var sku Sku - err := sku.Initialize_From_Sku_STATUS(source.Sku) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Sku_STATUS() to populate field Sku") - } - namespace.Sku = &sku - } else { - namespace.Sku = nil - } - - // Tags - namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) - - // ZoneRedundant - if source.ZoneRedundant != nil { - zoneRedundant := *source.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } else { - namespace.ZoneRedundant = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (namespace *Namespace_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1826,47 +1784,6 @@ func (encryption *Encryption) AssignProperties_To_Encryption(destination *v20211 return nil } -// Initialize_From_Encryption_STATUS populates our Encryption from the provided source Encryption_STATUS -func (encryption *Encryption) Initialize_From_Encryption_STATUS(source *Encryption_STATUS) error { - - // KeySource - if source.KeySource != nil { - keySource := Encryption_KeySource(*source.KeySource) - encryption.KeySource = &keySource - } else { - encryption.KeySource = nil - } - - // KeyVaultProperties - if source.KeyVaultProperties != nil { - keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty KeyVaultProperties - err := keyVaultProperty.Initialize_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - encryption.KeyVaultProperties = keyVaultPropertyList - } else { - encryption.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if source.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *source.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - encryption.RequireInfrastructureEncryption = nil - } - - // No error - return nil -} - // Properties to configure Encryption type Encryption_STATUS struct { // KeySource: Enumerates the possible value of keySource for Encryption @@ -2146,33 +2063,6 @@ func (identity *Identity) AssignProperties_To_Identity(destination *v20211101s.I return nil } -// Initialize_From_Identity_STATUS populates our Identity from the provided source Identity_STATUS -func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error { - - // Type - if source.Type != nil { - typeVar := Identity_Type(*source.Type) - identity.Type = &typeVar - } else { - identity.Type = nil - } - - // UserAssignedIdentities - if source.UserAssignedIdentities != nil { - userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities)) - for userAssignedIdentitiesKey := range source.UserAssignedIdentities { - userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey) - userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef}) - } - identity.UserAssignedIdentities = userAssignedIdentityList - } else { - identity.UserAssignedIdentities = nil - } - - // No error - return nil -} - // Properties to configure Identity for Bring your Own Keys type Identity_STATUS struct { // PrincipalId: ObjectId from the KeyVault @@ -2324,6 +2214,59 @@ func (identity *Identity_STATUS) AssignProperties_To_Identity_STATUS(destination return nil } +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespaceOperatorSpec struct { + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespaceOperatorSpec populates our NamespaceOperatorSpec from the provided source NamespaceOperatorSpec +func (operator *NamespaceOperatorSpec) AssignProperties_From_NamespaceOperatorSpec(source *v20211101s.NamespaceOperatorSpec) error { + + // Secrets + if source.Secrets != nil { + var secret NamespaceOperatorSecrets + err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespaceOperatorSpec populates the provided destination NamespaceOperatorSpec from our NamespaceOperatorSpec +func (operator *NamespaceOperatorSpec) AssignProperties_To_NamespaceOperatorSpec(destination *v20211101s.NamespaceOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20211101s.NamespaceOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSecrets() 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 +} + // Properties of the PrivateEndpointConnection. type PrivateEndpointConnection_STATUS struct { // Id: Fully qualified resource ID for the resource. Ex - @@ -2533,37 +2476,6 @@ func (sku *Sku) AssignProperties_To_Sku(destination *v20211101s.Sku) error { return nil } -// Initialize_From_Sku_STATUS populates our Sku from the provided source Sku_STATUS -func (sku *Sku) Initialize_From_Sku_STATUS(source *Sku_STATUS) error { - - // Capacity - if source.Capacity != nil { - capacity := *source.Capacity - sku.Capacity = &capacity - } else { - sku.Capacity = nil - } - - // Name - if source.Name != nil { - name := Sku_Name(*source.Name) - sku.Name = &name - } else { - sku.Name = nil - } - - // Tier - if source.Tier != nil { - tier := Sku_Tier(*source.Tier) - sku.Tier = &tier - } else { - sku.Tier = nil - } - - // No error - return nil -} - // SKU parameters supplied to the create namespace operation type Sku_STATUS struct { // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. @@ -3000,34 +2912,6 @@ func (properties *KeyVaultProperties) AssignProperties_To_KeyVaultProperties(des return nil } -// Initialize_From_KeyVaultProperties_STATUS populates our KeyVaultProperties from the provided source KeyVaultProperties_STATUS -func (properties *KeyVaultProperties) Initialize_From_KeyVaultProperties_STATUS(source *KeyVaultProperties_STATUS) error { - - // Identity - if source.Identity != nil { - var identity UserAssignedIdentityProperties - err := identity.Initialize_From_UserAssignedIdentityProperties_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") - } - properties.Identity = &identity - } else { - properties.Identity = nil - } - - // KeyName - properties.KeyName = genruntime.ClonePointerToString(source.KeyName) - - // KeyVaultUri - properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) - - // KeyVersion - properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) - - // No error - return nil -} - // Properties to configure keyVault Properties type KeyVaultProperties_STATUS struct { Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` @@ -3154,6 +3038,111 @@ func (properties *KeyVaultProperties_STATUS) AssignProperties_To_KeyVaultPropert return nil } +type NamespaceOperatorSecrets struct { + // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + + // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from + // Azure. + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + + // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + + // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved + // from Azure. + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespaceOperatorSecrets populates our NamespaceOperatorSecrets from the provided source NamespaceOperatorSecrets +func (secrets *NamespaceOperatorSecrets) AssignProperties_From_NamespaceOperatorSecrets(source *v20211101s.NamespaceOperatorSecrets) error { + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespaceOperatorSecrets populates the provided destination NamespaceOperatorSecrets from our NamespaceOperatorSecrets +func (secrets *NamespaceOperatorSecrets) AssignProperties_To_NamespaceOperatorSecrets(destination *v20211101s.NamespaceOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + // Recognized Dictionary value. type UserAssignedIdentity_STATUS struct { // ClientId: Client Id of user assigned identity @@ -3345,13 +3334,6 @@ func (properties *UserAssignedIdentityProperties) AssignProperties_To_UserAssign return nil } -// Initialize_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties_STATUS -func (properties *UserAssignedIdentityProperties) Initialize_From_UserAssignedIdentityProperties_STATUS(source *UserAssignedIdentityProperties_STATUS) error { - - // No error - return nil -} - type UserAssignedIdentityProperties_STATUS struct { // UserAssignedIdentity: ARM ID of user Identity selected for encryption UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` diff --git a/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go index 98277e0d141..9d7d49712d1 100644 --- a/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.Namespace + var hub v20240101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -287,6 +288,7 @@ func AddIndependentPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Ge func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { gens["Encryption"] = gen.PtrOf(EncryptionGenerator()) gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespaceOperatorSpecGenerator()) gens["Sku"] = gen.PtrOf(SkuGenerator()) } @@ -903,6 +905,109 @@ func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUSGenerator()) } +func Test_NamespaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSpec to NamespaceOperatorSpec via AssignProperties_To_NamespaceOperatorSpec & AssignProperties_From_NamespaceOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSpec tests if a specific instance of NamespaceOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20211101s.NamespaceOperatorSpec + err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespaceOperatorSpec + err = actual.AssignProperties_From_NamespaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespaceOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSpec runs a test to see if a specific instance of NamespaceOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSpec instances for property testing - lazily instantiated by +// NamespaceOperatorSpecGenerator() +var namespaceOperatorSpecGenerator gopter.Gen + +// NamespaceOperatorSpecGenerator returns a generator of NamespaceOperatorSpec instances for property testing. +func NamespaceOperatorSpecGenerator() gopter.Gen { + if namespaceOperatorSpecGenerator != nil { + return namespaceOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(generators) + namespaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSpec{}), generators) + + return namespaceOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespaceOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) +} + func Test_PrivateEndpointConnection_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1566,6 +1671,103 @@ func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]go gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) } +func Test_NamespaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSecrets to NamespaceOperatorSecrets via AssignProperties_To_NamespaceOperatorSecrets & AssignProperties_From_NamespaceOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSecrets tests if a specific instance of NamespaceOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20211101s.NamespaceOperatorSecrets + err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespaceOperatorSecrets + err = actual.AssignProperties_From_NamespaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespaceOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSecrets runs a test to see if a specific instance of NamespaceOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSecrets instances for property testing - lazily instantiated by +// NamespaceOperatorSecretsGenerator() +var namespaceOperatorSecretsGenerator gopter.Gen + +// NamespaceOperatorSecretsGenerator returns a generator of NamespaceOperatorSecrets instances for property testing. +func NamespaceOperatorSecretsGenerator() gopter.Gen { + if namespaceOperatorSecretsGenerator != nil { + return namespaceOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSecrets{}), generators) + + return namespaceOperatorSecretsGenerator +} + func Test_UserAssignedIdentity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go index a7820c70c57..2cdabf3fa14 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesAuthorizationRule{} // ConvertFrom populates our NamespacesAuthorizationRule from the provided hub NamespacesAuthorizationRule func (rule *NamespacesAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20211101s.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var source v20211101s.NamespacesAuthorizationRule + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") } - return rule.AssignProperties_From_NamespacesAuthorizationRule(source) + err = rule.AssignProperties_From_NamespacesAuthorizationRule(&source) + if err != nil { + return errors.Wrap(err, "converting from source to rule") + } + + return nil } // ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20211101s.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var destination v20211101s.NamespacesAuthorizationRule + err := rule.AssignProperties_To_NamespacesAuthorizationRule(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) + return nil } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespacesauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (rule *NamespacesAuthorizationRule) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesAuthorizationRule resource func (rule *NamespacesAuthorizationRule) defaultImpl() { rule.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesAuthorizationRule{} - -// InitializeSpec initializes the spec for this resource from the given status -func (rule *NamespacesAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { - return rule.Spec.Initialize_From_Namespaces_AuthorizationRule_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_AuthorizationRule_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -208,7 +211,7 @@ func (rule *NamespacesAuthorizationRule) ValidateUpdate(old runtime.Object) (adm // createValidations validates the creation of the resource func (rule *NamespacesAuthorizationRule) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference} + return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference, rule.validateSecretDestinations} } // deleteValidations validates the deletion of the resource @@ -226,6 +229,9 @@ func (rule *NamespacesAuthorizationRule) updateValidations() []func(old runtime. func(old runtime.Object) (admission.Warnings, error) { return rule.validateOwnerReference() }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateSecretDestinations() + }, } } @@ -243,6 +249,23 @@ func (rule *NamespacesAuthorizationRule) validateResourceReferences() (admission return genruntime.ValidateResourceReferences(refs) } +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (rule *NamespacesAuthorizationRule) validateSecretDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + if rule.Spec.OperatorSpec.Secrets == nil { + return nil, nil + } + toValidate := []*genruntime.SecretDestination{ + rule.Spec.OperatorSpec.Secrets.PrimaryConnectionString, + rule.Spec.OperatorSpec.Secrets.PrimaryKey, + rule.Spec.OperatorSpec.Secrets.SecondaryConnectionString, + rule.Spec.OperatorSpec.Secrets.SecondaryKey, + } + return genruntime.ValidateSecretDestinations(toValidate) +} + // validateWriteOnceProperties validates all WriteOnce properties func (rule *NamespacesAuthorizationRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { oldObj, ok := old.(*NamespacesAuthorizationRule) @@ -330,6 +353,10 @@ type Namespaces_AuthorizationRule_Spec struct { // doesn't have to be. AzureName string `json:"azureName,omitempty"` + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `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 @@ -378,6 +405,8 @@ func (rule *Namespaces_AuthorizationRule_Spec) PopulateFromARM(owner genruntime. // Set property "AzureName": rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + // no assignment for property "OperatorSpec" + // Set property "Owner": rule.Owner = &genruntime.KnownResourceReference{ Name: owner.Name, @@ -452,6 +481,18 @@ func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_From_Namespaces_ // AzureName rule.AzureName = source.AzureName + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesAuthorizationRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + // Owner if source.Owner != nil { owner := source.Owner.Copy() @@ -485,6 +526,18 @@ func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_Au // AzureName destination.AzureName = rule.AzureName + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20211101s.NamespacesAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + // OriginalVersion destination.OriginalVersion = rule.OriginalVersion() @@ -520,27 +573,6 @@ func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_Au return nil } -// Initialize_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_Spec) Initialize_From_Namespaces_AuthorizationRule_STATUS(source *Namespaces_AuthorizationRule_STATUS) error { - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - right := Namespaces_AuthorizationRule_Properties_Rights_Spec(rightItem) - rightList[rightIndex] = right - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (rule *Namespaces_AuthorizationRule_Spec) OriginalVersion() string { return GroupVersion.Version @@ -808,6 +840,164 @@ const ( Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send = Namespaces_AuthorizationRule_Properties_Rights_STATUS("Send") ) +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesAuthorizationRuleOperatorSpec struct { + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec populates our NamespacesAuthorizationRuleOperatorSpec from the provided source NamespacesAuthorizationRuleOperatorSpec +func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error { + + // Secrets + if source.Secrets != nil { + var secret NamespacesAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec populates the provided destination NamespacesAuthorizationRuleOperatorSpec from our NamespacesAuthorizationRuleOperatorSpec +func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(destination *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20211101s.NamespacesAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets() 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 NamespacesAuthorizationRuleOperatorSecrets struct { + // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + + // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from + // Azure. + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + + // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + + // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved + // from Azure. + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets populates our NamespacesAuthorizationRuleOperatorSecrets from the provided source NamespacesAuthorizationRuleOperatorSecrets +func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error { + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets populates the provided destination NamespacesAuthorizationRuleOperatorSecrets from our NamespacesAuthorizationRuleOperatorSecrets +func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(destination *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + func init() { SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) } diff --git a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go index 771b31c9701..c365e980caa 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesAuthorizationRule + var hub v20240101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -251,6 +252,9 @@ func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec(subject Namesp var namespaces_AuthorizationRule_SpecGenerator gopter.Gen // Namespaces_AuthorizationRule_SpecGenerator returns a generator of Namespaces_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { if namespaces_AuthorizationRule_SpecGenerator != nil { return namespaces_AuthorizationRule_SpecGenerator @@ -260,6 +264,12 @@ func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + return namespaces_AuthorizationRule_SpecGenerator } @@ -269,6 +279,11 @@ func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens m gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_AuthorizationRule_Properties_Rights_Spec_Send)) } +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) +} + func Test_Namespaces_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -389,3 +404,203 @@ func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSpec to NamespacesAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20211101s.NamespacesAuthorizationRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSpecGenerator() +var namespacesAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(generators) + namespacesAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSpec{}), generators) + + return namespacesAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSecrets to NamespacesAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20211101s.NamespacesAuthorizationRuleOperatorSecrets + err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRuleOperatorSecrets + err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSecretsGenerator() +var namespacesAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go index 5ade92cd52f..75057a677ff 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesEventhub{} // ConvertFrom populates our NamespacesEventhub from the provided hub NamespacesEventhub func (eventhub *NamespacesEventhub) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20211101s.NamespacesEventhub) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhub but received %T instead", hub) + // intermediate variable for conversion + var source v20211101s.NamespacesEventhub + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = eventhub.AssignProperties_From_NamespacesEventhub(&source) + if err != nil { + return errors.Wrap(err, "converting from source to eventhub") } - return eventhub.AssignProperties_From_NamespacesEventhub(source) + return nil } // ConvertTo populates the provided hub NamespacesEventhub from our NamespacesEventhub func (eventhub *NamespacesEventhub) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20211101s.NamespacesEventhub) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhub but received %T instead", hub) + // intermediate variable for conversion + var destination v20211101s.NamespacesEventhub + err := eventhub.AssignProperties_To_NamespacesEventhub(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from eventhub") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return eventhub.AssignProperties_To_NamespacesEventhub(destination) + return nil } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespaceseventhub,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaceseventhubs.eventhub.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (eventhub *NamespacesEventhub) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesEventhub resource func (eventhub *NamespacesEventhub) defaultImpl() { eventhub.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesEventhub{} - -// InitializeSpec initializes the spec for this resource from the given status -func (eventhub *NamespacesEventhub) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Eventhub_STATUS); ok { - return eventhub.Spec.Initialize_From_Namespaces_Eventhub_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Eventhub_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesEventhub{} // AzureName returns the Azure name of the resource @@ -597,41 +600,6 @@ func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_To_Namespaces_Eventhu return nil } -// Initialize_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_Spec) Initialize_From_Namespaces_Eventhub_STATUS(source *Namespaces_Eventhub_STATUS) error { - - // CaptureDescription - if source.CaptureDescription != nil { - var captureDescription CaptureDescription - err := captureDescription.Initialize_From_CaptureDescription_STATUS(source.CaptureDescription) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_CaptureDescription_STATUS() to populate field CaptureDescription") - } - eventhub.CaptureDescription = &captureDescription - } else { - eventhub.CaptureDescription = nil - } - - // MessageRetentionInDays - if source.MessageRetentionInDays != nil { - messageRetentionInDay := *source.MessageRetentionInDays - eventhub.MessageRetentionInDays = &messageRetentionInDay - } else { - eventhub.MessageRetentionInDays = nil - } - - // PartitionCount - if source.PartitionCount != nil { - partitionCount := *source.PartitionCount - eventhub.PartitionCount = &partitionCount - } else { - eventhub.PartitionCount = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (eventhub *Namespaces_Eventhub_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1242,55 +1210,6 @@ func (description *CaptureDescription) AssignProperties_To_CaptureDescription(de return nil } -// Initialize_From_CaptureDescription_STATUS populates our CaptureDescription from the provided source CaptureDescription_STATUS -func (description *CaptureDescription) Initialize_From_CaptureDescription_STATUS(source *CaptureDescription_STATUS) error { - - // Destination - if source.Destination != nil { - var destination Destination - err := destination.Initialize_From_Destination_STATUS(source.Destination) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Destination_STATUS() to populate field Destination") - } - description.Destination = &destination - } else { - description.Destination = nil - } - - // Enabled - if source.Enabled != nil { - enabled := *source.Enabled - description.Enabled = &enabled - } else { - description.Enabled = nil - } - - // Encoding - if source.Encoding != nil { - encoding := CaptureDescription_Encoding(*source.Encoding) - description.Encoding = &encoding - } else { - description.Encoding = nil - } - - // IntervalInSeconds - description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) - - // SizeLimitInBytes - description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) - - // SkipEmptyArchives - if source.SkipEmptyArchives != nil { - skipEmptyArchive := *source.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchive - } else { - description.SkipEmptyArchives = nil - } - - // No error - return nil -} - // Properties to configure capture description for eventhub type CaptureDescription_STATUS struct { // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) @@ -1746,44 +1665,6 @@ func (destination *Destination) AssignProperties_To_Destination(target *v2021110 return nil } -// Initialize_From_Destination_STATUS populates our Destination from the provided source Destination_STATUS -func (destination *Destination) Initialize_From_Destination_STATUS(source *Destination_STATUS) error { - - // ArchiveNameFormat - destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) - - // BlobContainer - destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) - - // DataLakeAccountName - destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) - - // DataLakeFolderPath - destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) - - // DataLakeSubscriptionId - if source.DataLakeSubscriptionId != nil { - dataLakeSubscriptionId := *source.DataLakeSubscriptionId - destination.DataLakeSubscriptionId = &dataLakeSubscriptionId - } else { - destination.DataLakeSubscriptionId = nil - } - - // Name - destination.Name = genruntime.ClonePointerToString(source.Name) - - // StorageAccountResourceReference - if source.StorageAccountResourceId != nil { - storageAccountResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.StorageAccountResourceId) - destination.StorageAccountResourceReference = &storageAccountResourceReference - } else { - destination.StorageAccountResourceReference = nil - } - - // No error - return nil -} - // Capture storage details for capture description type Destination_STATUS struct { // ArchiveNameFormat: Blob naming convention for archive, e.g. diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go index c470b6c6d38..56072f5e24b 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesEventhub(subject NamespacesEventhub) copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesEventhub + var hub v20240101s.NamespacesEventhub err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go index 59132760d2f..9a7eb06e4f8 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesEventhubsAuthorizationRule{} // ConvertFrom populates our NamespacesEventhubsAuthorizationRule from the provided hub NamespacesEventhubsAuthorizationRule func (rule *NamespacesEventhubsAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20211101s.NamespacesEventhubsAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var source v20211101s.NamespacesEventhubsAuthorizationRule + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") } - return rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(source) + err = rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(&source) + if err != nil { + return errors.Wrap(err, "converting from source to rule") + } + + return nil } // ConvertTo populates the provided hub NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule func (rule *NamespacesEventhubsAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20211101s.NamespacesEventhubsAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var destination v20211101s.NamespacesEventhubsAuthorizationRule + err := rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination) + return nil } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespaceseventhubsauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaceseventhubsauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (rule *NamespacesEventhubsAuthorizationRule) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesEventhubsAuthorizationRule resource func (rule *NamespacesEventhubsAuthorizationRule) defaultImpl() { rule.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesEventhubsAuthorizationRule{} - -// InitializeSpec initializes the spec for this resource from the given status -func (rule *NamespacesEventhubsAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { - return rule.Spec.Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Eventhubs_AuthorizationRule_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -208,7 +211,7 @@ func (rule *NamespacesEventhubsAuthorizationRule) ValidateUpdate(old runtime.Obj // createValidations validates the creation of the resource func (rule *NamespacesEventhubsAuthorizationRule) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference} + return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference, rule.validateSecretDestinations} } // deleteValidations validates the deletion of the resource @@ -226,6 +229,9 @@ func (rule *NamespacesEventhubsAuthorizationRule) updateValidations() []func(old func(old runtime.Object) (admission.Warnings, error) { return rule.validateOwnerReference() }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateSecretDestinations() + }, } } @@ -243,6 +249,23 @@ func (rule *NamespacesEventhubsAuthorizationRule) validateResourceReferences() ( return genruntime.ValidateResourceReferences(refs) } +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (rule *NamespacesEventhubsAuthorizationRule) validateSecretDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + if rule.Spec.OperatorSpec.Secrets == nil { + return nil, nil + } + toValidate := []*genruntime.SecretDestination{ + rule.Spec.OperatorSpec.Secrets.PrimaryConnectionString, + rule.Spec.OperatorSpec.Secrets.PrimaryKey, + rule.Spec.OperatorSpec.Secrets.SecondaryConnectionString, + rule.Spec.OperatorSpec.Secrets.SecondaryKey, + } + return genruntime.ValidateSecretDestinations(toValidate) +} + // validateWriteOnceProperties validates all WriteOnce properties func (rule *NamespacesEventhubsAuthorizationRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { oldObj, ok := old.(*NamespacesEventhubsAuthorizationRule) @@ -330,6 +353,10 @@ type Namespaces_Eventhubs_AuthorizationRule_Spec struct { // doesn't have to be. AzureName string `json:"azureName,omitempty"` + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesEventhubsAuthorizationRuleOperatorSpec `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 @@ -378,6 +405,8 @@ func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) PopulateFromARM(owner g // Set property "AzureName": rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + // no assignment for property "OperatorSpec" + // Set property "Owner": rule.Owner = &genruntime.KnownResourceReference{ Name: owner.Name, @@ -452,6 +481,18 @@ func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_From_N // AzureName rule.AzureName = source.AzureName + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesEventhubsAuthorizationRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + // Owner if source.Owner != nil { owner := source.Owner.Copy() @@ -485,6 +526,18 @@ func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_To_Nam // AzureName destination.AzureName = rule.AzureName + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + // OriginalVersion destination.OriginalVersion = rule.OriginalVersion() @@ -520,27 +573,6 @@ func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_To_Nam return nil } -// Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *Namespaces_Eventhubs_AuthorizationRule_STATUS) error { - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - right := Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec(rightItem) - rightList[rightIndex] = right - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) OriginalVersion() string { return GroupVersion.Version @@ -808,6 +840,164 @@ const ( Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Send = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS("Send") ) +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesEventhubsAuthorizationRuleOperatorSpec struct { + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec populates our NamespacesEventhubsAuthorizationRuleOperatorSpec from the provided source NamespacesEventhubsAuthorizationRuleOperatorSpec +func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source *v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { + + // Secrets + if source.Secrets != nil { + var secret NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSpec from our NamespacesEventhubsAuthorizationRuleOperatorSpec +func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(destination *v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets() 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 NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { + // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + + // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from + // Azure. + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + + // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + + // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved + // from Azure. + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates our NamespacesEventhubsAuthorizationRuleOperatorSecrets from the provided source NamespacesEventhubsAuthorizationRuleOperatorSecrets +func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source *v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSecrets from our NamespacesEventhubsAuthorizationRuleOperatorSecrets +func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(destination *v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + func init() { SchemeBuilder.Register(&NamespacesEventhubsAuthorizationRule{}, &NamespacesEventhubsAuthorizationRuleList{}) } diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go index 574a061072a..3baf1f796c1 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesEventhubsAuthorizationRule(subject Na copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesEventhubsAuthorizationRule + var hub v20240101s.NamespacesEventhubsAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -251,6 +252,9 @@ func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subj var namespaces_Eventhubs_AuthorizationRule_SpecGenerator gopter.Gen // Namespaces_Eventhubs_AuthorizationRule_SpecGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { if namespaces_Eventhubs_AuthorizationRule_SpecGenerator != nil { return namespaces_Eventhubs_AuthorizationRule_SpecGenerator @@ -260,6 +264,12 @@ func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + return namespaces_Eventhubs_AuthorizationRule_SpecGenerator } @@ -269,6 +279,11 @@ func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_S gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send)) } +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator()) +} + func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -389,3 +404,203 @@ func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_S func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSpec to NamespacesEventhubsAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(generators) + namespacesEventhubsAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSpec{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSecrets to NamespacesEventhubsAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20211101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated +// by NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go index 80d5b7f0094..8a06488b5aa 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesEventhubsConsumerGroup{} // ConvertFrom populates our NamespacesEventhubsConsumerGroup from the provided hub NamespacesEventhubsConsumerGroup func (group *NamespacesEventhubsConsumerGroup) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20211101s.NamespacesEventhubsConsumerGroup) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) + // intermediate variable for conversion + var source v20211101s.NamespacesEventhubsConsumerGroup + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") } - return group.AssignProperties_From_NamespacesEventhubsConsumerGroup(source) + err = group.AssignProperties_From_NamespacesEventhubsConsumerGroup(&source) + if err != nil { + return errors.Wrap(err, "converting from source to group") + } + + return nil } // ConvertTo populates the provided hub NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup func (group *NamespacesEventhubsConsumerGroup) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20211101s.NamespacesEventhubsConsumerGroup) - if !ok { - return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) + // intermediate variable for conversion + var destination v20211101s.NamespacesEventhubsConsumerGroup + err := group.AssignProperties_To_NamespacesEventhubsConsumerGroup(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from group") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return group.AssignProperties_To_NamespacesEventhubsConsumerGroup(destination) + return nil } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespaceseventhubsconsumergroup,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaceseventhubsconsumergroups.eventhub.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (group *NamespacesEventhubsConsumerGroup) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesEventhubsConsumerGroup resource func (group *NamespacesEventhubsConsumerGroup) defaultImpl() { group.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesEventhubsConsumerGroup{} - -// InitializeSpec initializes the spec for this resource from the given status -func (group *NamespacesEventhubsConsumerGroup) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { - return group.Spec.Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Eventhubs_Consumergroup_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} // AzureName returns the Azure name of the resource @@ -504,16 +507,6 @@ func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_T return nil } -// Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *Namespaces_Eventhubs_Consumergroup_STATUS) error { - - // UserMetadata - consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go index ff0a3ab57ed..23986396ec5 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesEventhubsConsumerGroup(subject Namesp copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesEventhubsConsumerGroup + var hub v20240101s.NamespacesEventhubsConsumerGroup err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go index f7d0fb4d1fd..a913c2cf6fa 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go @@ -4,19 +4,18 @@ package storage import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaces,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaces/status,namespaces/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" @@ -44,6 +43,28 @@ func (namespace *Namespace) SetConditions(conditions conditions.Conditions) { namespace.Status.Conditions = conditions } +var _ conversion.Convertible = &Namespace{} + +// ConvertFrom populates our Namespace from the provided hub Namespace +func (namespace *Namespace) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.Namespace) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_From_Namespace(source) +} + +// ConvertTo populates the provided hub Namespace from our Namespace +func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.Namespace) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_To_Namespace(destination) +} + var _ genruntime.KubernetesResource = &Namespace{} // AzureName returns the Azure name of the resource @@ -115,8 +136,75 @@ func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error return nil } -// Hub marks that this Namespace is the hub type for conversion -func (namespace *Namespace) Hub() {} +// AssignProperties_From_Namespace populates our Namespace from the provided source Namespace +func (namespace *Namespace) AssignProperties_From_Namespace(source *v20240101s.Namespace) error { + + // ObjectMeta + namespace.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespace_Spec + err := spec.AssignProperties_From_Namespace_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespace_Spec() to populate field Spec") + } + namespace.Spec = spec + + // Status + var status Namespace_STATUS + err = status.AssignProperties_From_Namespace_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespace_STATUS() to populate field Status") + } + namespace.Status = status + + // Invoke the augmentConversionForNamespace interface (if implemented) to customize the conversion + var namespaceAsAny any = namespace + if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace); ok { + err := augmentedNamespace.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespace populates the provided destination Namespace from our Namespace +func (namespace *Namespace) AssignProperties_To_Namespace(destination *v20240101s.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespace_Spec + err := namespace.Spec.AssignProperties_To_Namespace_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespace_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespace_STATUS + err = namespace.Status.AssignProperties_To_Namespace_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespace_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespace interface (if implemented) to customize the conversion + var namespaceAsAny any = namespace + if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace); ok { + err := augmentedNamespace.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { @@ -144,6 +232,11 @@ type APIVersion string const APIVersion_Value = APIVersion("2021-11-01") +type augmentConversionForNamespace interface { + AssignPropertiesFrom(src *v20240101s.Namespace) error + AssignPropertiesTo(dst *v20240101s.Namespace) error +} + // Storage version of v1api20211101.Namespace_Spec type Namespace_Spec struct { AlternateName *string `json:"alternateName,omitempty"` @@ -161,6 +254,7 @@ type Namespace_Spec struct { KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` Location *string `json:"location,omitempty"` MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + OperatorSpec *NamespaceOperatorSpec `json:"operatorSpec,omitempty"` OriginalVersion string `json:"originalVersion,omitempty"` // +kubebuilder:validation:Required @@ -178,20 +272,368 @@ var _ genruntime.ConvertibleSpec = &Namespace_Spec{} // ConvertSpecFrom populates our Namespace_Spec from the provided source func (namespace *Namespace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20240101s.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespace_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(namespace) + // Update our instance from src + err = namespace.AssignProperties_From_Namespace_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our Namespace_Spec func (namespace *Namespace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20240101s.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespace_Spec{} + err := namespace.AssignProperties_To_Namespace_Spec(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 +} + +// AssignProperties_From_Namespace_Spec populates our Namespace_Spec from the provided source Namespace_Spec +func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *v20240101s.Namespace_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // AzureName + namespace.AzureName = source.AzureName + + // ClusterArmReference + if source.ClusterArmReference != nil { + clusterArmReference := source.ClusterArmReference.Copy() + namespace.ClusterArmReference = &clusterArmReference + } else { + namespace.ClusterArmReference = nil + } + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } else { + namespace.DisableLocalAuth = nil + } + + // Encryption + if source.Encryption != nil { + var encryption Encryption + err := encryption.AssignProperties_From_Encryption(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Encryption() to populate field Encryption") + } + namespace.Encryption = &encryption + } else { + namespace.Encryption = nil + } + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.AssignProperties_From_Identity(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Identity() to populate field Identity") + } + namespace.Identity = &identity + } else { + namespace.Identity = nil + } + + // IsAutoInflateEnabled + if source.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *source.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + namespace.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if source.KafkaEnabled != nil { + kafkaEnabled := *source.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } else { + namespace.KafkaEnabled = nil + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MaximumThroughputUnits + namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + propertyBag.Add("MinimumTlsVersion", *source.MinimumTlsVersion) + } else { + propertyBag.Remove("MinimumTlsVersion") + } + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespaceOperatorSpec + err := operatorSpec.AssignProperties_From_NamespaceOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSpec() to populate field OperatorSpec") + } + namespace.OperatorSpec = &operatorSpec + } else { + namespace.OperatorSpec = nil + } + + // OriginalVersion + namespace.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + namespace.Owner = &owner + } else { + namespace.Owner = nil + } + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + propertyBag.Add("PublicNetworkAccess", *source.PublicNetworkAccess) + } else { + propertyBag.Remove("PublicNetworkAccess") + } + + // Sku + if source.Sku != nil { + var sku Sku + err := sku.AssignProperties_From_Sku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Sku() to populate field Sku") + } + namespace.Sku = &sku + } else { + namespace.Sku = nil + } + + // Tags + namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // ZoneRedundant + if source.ZoneRedundant != nil { + zoneRedundant := *source.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } else { + namespace.ZoneRedundant = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + namespace.PropertyBag = propertyBag + } else { + namespace.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespace_Spec interface (if implemented) to customize the conversion + var namespaceAsAny any = namespace + if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_Spec); ok { + err := augmentedNamespace.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespace_Spec populates the provided destination Namespace_Spec from our Namespace_Spec +func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination *v20240101s.Namespace_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(namespace.PropertyBag) + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // AzureName + destination.AzureName = namespace.AzureName + + // ClusterArmReference + if namespace.ClusterArmReference != nil { + clusterArmReference := namespace.ClusterArmReference.Copy() + destination.ClusterArmReference = &clusterArmReference + } else { + destination.ClusterArmReference = nil + } + + // DisableLocalAuth + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20240101s.Encryption + err := namespace.Encryption.AssignProperties_To_Encryption(&encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Encryption() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // Identity + if namespace.Identity != nil { + var identity v20240101s.Identity + err := namespace.Identity.AssignProperties_To_Identity(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Identity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // IsAutoInflateEnabled + if namespace.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *namespace.IsAutoInflateEnabled + destination.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + destination.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if namespace.KafkaEnabled != nil { + kafkaEnabled := *namespace.KafkaEnabled + destination.KafkaEnabled = &kafkaEnabled + } else { + destination.KafkaEnabled = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MaximumThroughputUnits + destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits) + + // MinimumTlsVersion + if propertyBag.Contains("MinimumTlsVersion") { + var minimumTlsVersion string + err := propertyBag.Pull("MinimumTlsVersion", &minimumTlsVersion) + if err != nil { + return errors.Wrap(err, "pulling 'MinimumTlsVersion' from propertyBag") + } + + destination.MinimumTlsVersion = &minimumTlsVersion + } else { + destination.MinimumTlsVersion = nil + } + + // OperatorSpec + if namespace.OperatorSpec != nil { + var operatorSpec v20240101s.NamespaceOperatorSpec + err := namespace.OperatorSpec.AssignProperties_To_NamespaceOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = namespace.OriginalVersion + + // Owner + if namespace.Owner != nil { + owner := namespace.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // PublicNetworkAccess + if propertyBag.Contains("PublicNetworkAccess") { + var publicNetworkAccess string + err := propertyBag.Pull("PublicNetworkAccess", &publicNetworkAccess) + if err != nil { + return errors.Wrap(err, "pulling 'PublicNetworkAccess' from propertyBag") + } + + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // Sku + if namespace.Sku != nil { + var sku v20240101s.Sku + err := namespace.Sku.AssignProperties_To_Sku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Sku() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) + + // ZoneRedundant + if namespace.ZoneRedundant != nil { + zoneRedundant := *namespace.ZoneRedundant + destination.ZoneRedundant = &zoneRedundant + } else { + destination.ZoneRedundant = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespace_Spec interface (if implemented) to customize the conversion + var namespaceAsAny any = namespace + if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_Spec); ok { + err := augmentedNamespace.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } } - return destination.ConvertSpecFrom(namespace) + // No error + return nil } // Storage version of v1api20211101.Namespace_STATUS @@ -227,142 +669,1956 @@ var _ genruntime.ConvertibleStatus = &Namespace_STATUS{} // ConvertStatusFrom populates our Namespace_STATUS from the provided source func (namespace *Namespace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20240101s.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespace_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(namespace) + // Update our instance from src + err = namespace.AssignProperties_From_Namespace_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil } // ConvertStatusTo populates the provided destination from our Namespace_STATUS func (namespace *Namespace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20240101s.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) } - return destination.ConvertStatusFrom(namespace) -} + // Convert to an intermediate form + dst = &v20240101s.Namespace_STATUS{} + err := namespace.AssignProperties_To_Namespace_STATUS(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } -// Storage version of v1api20211101.Encryption -// Properties to configure Encryption -type Encryption struct { - KeySource *string `json:"keySource,omitempty"` - KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusTo()") + } -// Storage version of v1api20211101.Encryption_STATUS -// Properties to configure Encryption -type Encryption_STATUS struct { - KeySource *string `json:"keySource,omitempty"` - KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` + return nil } -// Storage version of v1api20211101.Identity -// Properties to configure Identity for Bring your Own Keys -type Identity struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Type *string `json:"type,omitempty"` - UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` -} +// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS +func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *v20240101s.Namespace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) -// Storage version of v1api20211101.Identity_STATUS -// Properties to configure Identity for Bring your Own Keys -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"` -} + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) -// Storage version of v1api20211101.PrivateEndpointConnection_STATUS -// Properties of the PrivateEndpointConnection. -type PrivateEndpointConnection_STATUS struct { - Id *string `json:"id,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} + // ClusterArmId + namespace.ClusterArmId = genruntime.ClonePointerToString(source.ClusterArmId) -// Storage version of v1api20211101.Sku -// SKU parameters supplied to the create namespace operation -type Sku struct { - Capacity *int `json:"capacity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Tier *string `json:"tier,omitempty"` -} + // Conditions + namespace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) -// Storage version of v1api20211101.Sku_STATUS -// SKU parameters supplied to the create namespace operation -type Sku_STATUS struct { - Capacity *int `json:"capacity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Tier *string `json:"tier,omitempty"` -} + // CreatedAt + namespace.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) -// Storage version of v1api20211101.SystemData_STATUS -// Metadata pertaining to creation and last modification of the resource. -type SystemData_STATUS struct { - CreatedAt *string `json:"createdAt,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - CreatedByType *string `json:"createdByType,omitempty"` - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedByType *string `json:"lastModifiedByType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } else { + namespace.DisableLocalAuth = nil + } -// Storage version of v1api20211101.KeyVaultProperties -// Properties to configure keyVault Properties -type KeyVaultProperties struct { - Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} + // Encryption + if source.Encryption != nil { + var encryption Encryption_STATUS + err := encryption.AssignProperties_From_Encryption_STATUS(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Encryption_STATUS() to populate field Encryption") + } + namespace.Encryption = &encryption + } else { + namespace.Encryption = nil + } -// Storage version of v1api20211101.KeyVaultProperties_STATUS -// Properties to configure keyVault Properties -type KeyVaultProperties_STATUS struct { - Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} + // Id + namespace.Id = genruntime.ClonePointerToString(source.Id) -// Storage version of v1api20211101.UserAssignedIdentity_STATUS -// Recognized Dictionary value. -type UserAssignedIdentity_STATUS struct { - ClientId *string `json:"clientId,omitempty"` - PrincipalId *string `json:"principalId,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} + // Identity + if source.Identity != nil { + var identity Identity_STATUS + err := identity.AssignProperties_From_Identity_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Identity_STATUS() to populate field Identity") + } + namespace.Identity = &identity + } else { + namespace.Identity = nil + } -// Storage version of v1api20211101.UserAssignedIdentityDetails -// Information about the user assigned identity for the resource -type UserAssignedIdentityDetails struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` -} + // IsAutoInflateEnabled + if source.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *source.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + namespace.IsAutoInflateEnabled = nil + } -// Storage version of v1api20211101.UserAssignedIdentityProperties -type UserAssignedIdentityProperties struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + // KafkaEnabled + if source.KafkaEnabled != nil { + kafkaEnabled := *source.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } else { + namespace.KafkaEnabled = nil + } - // UserAssignedIdentityReference: ARM ID of user Identity selected for encryption - UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` -} + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) -// Storage version of v1api20211101.UserAssignedIdentityProperties_STATUS -type UserAssignedIdentityProperties_STATUS struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` + // MaximumThroughputUnits + namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) + + // MetricId + namespace.MetricId = genruntime.ClonePointerToString(source.MetricId) + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + propertyBag.Add("MinimumTlsVersion", *source.MinimumTlsVersion) + } else { + propertyBag.Remove("MinimumTlsVersion") + } + + // Name + namespace.Name = genruntime.ClonePointerToString(source.Name) + + // PrivateEndpointConnections + if source.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]PrivateEndpointConnection_STATUS, len(source.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range source.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection PrivateEndpointConnection_STATUS + err := privateEndpointConnection.AssignProperties_From_PrivateEndpointConnection_STATUS(&privateEndpointConnectionItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + namespace.PrivateEndpointConnections = privateEndpointConnectionList + } else { + namespace.PrivateEndpointConnections = nil + } + + // ProvisioningState + namespace.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState) + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + propertyBag.Add("PublicNetworkAccess", *source.PublicNetworkAccess) + } else { + propertyBag.Remove("PublicNetworkAccess") + } + + // ServiceBusEndpoint + namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) + + // Sku + if source.Sku != nil { + var sku Sku_STATUS + err := sku.AssignProperties_From_Sku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Sku_STATUS() to populate field Sku") + } + namespace.Sku = &sku + } else { + namespace.Sku = nil + } + + // Status + namespace.Status = genruntime.ClonePointerToString(source.Status) + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + namespace.SystemData = &systemDatum + } else { + namespace.SystemData = nil + } + + // Tags + namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // Type + namespace.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + namespace.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // ZoneRedundant + if source.ZoneRedundant != nil { + zoneRedundant := *source.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } else { + namespace.ZoneRedundant = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + namespace.PropertyBag = propertyBag + } else { + namespace.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespace_STATUS interface (if implemented) to customize the conversion + var namespaceAsAny any = namespace + if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_STATUS); ok { + err := augmentedNamespace.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespace_STATUS populates the provided destination Namespace_STATUS from our Namespace_STATUS +func (namespace *Namespace_STATUS) AssignProperties_To_Namespace_STATUS(destination *v20240101s.Namespace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(namespace.PropertyBag) + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // ClusterArmId + destination.ClusterArmId = genruntime.ClonePointerToString(namespace.ClusterArmId) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(namespace.Conditions) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(namespace.CreatedAt) + + // DisableLocalAuth + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20240101s.Encryption_STATUS + err := namespace.Encryption.AssignProperties_To_Encryption_STATUS(&encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Encryption_STATUS() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(namespace.Id) + + // Identity + if namespace.Identity != nil { + var identity v20240101s.Identity_STATUS + err := namespace.Identity.AssignProperties_To_Identity_STATUS(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Identity_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // IsAutoInflateEnabled + if namespace.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *namespace.IsAutoInflateEnabled + destination.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + destination.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if namespace.KafkaEnabled != nil { + kafkaEnabled := *namespace.KafkaEnabled + destination.KafkaEnabled = &kafkaEnabled + } else { + destination.KafkaEnabled = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MaximumThroughputUnits + destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits) + + // MetricId + destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) + + // MinimumTlsVersion + if propertyBag.Contains("MinimumTlsVersion") { + var minimumTlsVersion string + err := propertyBag.Pull("MinimumTlsVersion", &minimumTlsVersion) + if err != nil { + return errors.Wrap(err, "pulling 'MinimumTlsVersion' from propertyBag") + } + + destination.MinimumTlsVersion = &minimumTlsVersion + } else { + destination.MinimumTlsVersion = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(namespace.Name) + + // PrivateEndpointConnections + if namespace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]v20240101s.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection v20240101s.PrivateEndpointConnection_STATUS + err := privateEndpointConnectionItem.AssignProperties_To_PrivateEndpointConnection_STATUS(&privateEndpointConnection) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + destination.PrivateEndpointConnections = privateEndpointConnectionList + } else { + destination.PrivateEndpointConnections = nil + } + + // ProvisioningState + destination.ProvisioningState = genruntime.ClonePointerToString(namespace.ProvisioningState) + + // PublicNetworkAccess + if propertyBag.Contains("PublicNetworkAccess") { + var publicNetworkAccess string + err := propertyBag.Pull("PublicNetworkAccess", &publicNetworkAccess) + if err != nil { + return errors.Wrap(err, "pulling 'PublicNetworkAccess' from propertyBag") + } + + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // ServiceBusEndpoint + destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) + + // Sku + if namespace.Sku != nil { + var sku v20240101s.Sku_STATUS + err := namespace.Sku.AssignProperties_To_Sku_STATUS(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Sku_STATUS() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // Status + destination.Status = genruntime.ClonePointerToString(namespace.Status) + + // SystemData + if namespace.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := namespace.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) + + // Type + destination.Type = genruntime.ClonePointerToString(namespace.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(namespace.UpdatedAt) + + // ZoneRedundant + if namespace.ZoneRedundant != nil { + zoneRedundant := *namespace.ZoneRedundant + destination.ZoneRedundant = &zoneRedundant + } else { + destination.ZoneRedundant = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespace_STATUS interface (if implemented) to customize the conversion + var namespaceAsAny any = namespace + if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_STATUS); ok { + err := augmentedNamespace.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespace_Spec interface { + AssignPropertiesFrom(src *v20240101s.Namespace_Spec) error + AssignPropertiesTo(dst *v20240101s.Namespace_Spec) error +} + +type augmentConversionForNamespace_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Namespace_STATUS) error + AssignPropertiesTo(dst *v20240101s.Namespace_STATUS) error +} + +// Storage version of v1api20211101.Encryption +// Properties to configure Encryption +type Encryption struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +// AssignProperties_From_Encryption populates our Encryption from the provided source Encryption +func (encryption *Encryption) AssignProperties_From_Encryption(source *v20240101s.Encryption) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // KeySource + encryption.KeySource = genruntime.ClonePointerToString(source.KeySource) + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty KeyVaultProperties + err := keyVaultProperty.AssignProperties_From_KeyVaultProperties(&keyVaultPropertyItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + encryption.KeyVaultProperties = keyVaultPropertyList + } else { + encryption.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if source.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *source.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + encryption.RequireInfrastructureEncryption = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + encryption.PropertyBag = propertyBag + } else { + encryption.PropertyBag = nil + } + + // Invoke the augmentConversionForEncryption interface (if implemented) to customize the conversion + var encryptionAsAny any = encryption + if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption); ok { + err := augmentedEncryption.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Encryption populates the provided destination Encryption from our Encryption +func (encryption *Encryption) AssignProperties_To_Encryption(destination *v20240101s.Encryption) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(encryption.PropertyBag) + + // KeySource + destination.KeySource = genruntime.ClonePointerToString(encryption.KeySource) + + // KeyVaultProperties + if encryption.KeyVaultProperties != nil { + keyVaultPropertyList := make([]v20240101s.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20240101s.KeyVaultProperties + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties(&keyVaultProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + destination.KeyVaultProperties = keyVaultPropertyList + } else { + destination.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if encryption.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption + destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + destination.RequireInfrastructureEncryption = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForEncryption interface (if implemented) to customize the conversion + var encryptionAsAny any = encryption + if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption); ok { + err := augmentedEncryption.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.Encryption_STATUS +// Properties to configure Encryption +type Encryption_STATUS struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +// AssignProperties_From_Encryption_STATUS populates our Encryption_STATUS from the provided source Encryption_STATUS +func (encryption *Encryption_STATUS) AssignProperties_From_Encryption_STATUS(source *v20240101s.Encryption_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // KeySource + encryption.KeySource = genruntime.ClonePointerToString(source.KeySource) + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + keyVaultPropertyList := make([]KeyVaultProperties_STATUS, len(source.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty KeyVaultProperties_STATUS + err := keyVaultProperty.AssignProperties_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + encryption.KeyVaultProperties = keyVaultPropertyList + } else { + encryption.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if source.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *source.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + encryption.RequireInfrastructureEncryption = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + encryption.PropertyBag = propertyBag + } else { + encryption.PropertyBag = nil + } + + // Invoke the augmentConversionForEncryption_STATUS interface (if implemented) to customize the conversion + var encryptionAsAny any = encryption + if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption_STATUS); ok { + err := augmentedEncryption.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Encryption_STATUS populates the provided destination Encryption_STATUS from our Encryption_STATUS +func (encryption *Encryption_STATUS) AssignProperties_To_Encryption_STATUS(destination *v20240101s.Encryption_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(encryption.PropertyBag) + + // KeySource + destination.KeySource = genruntime.ClonePointerToString(encryption.KeySource) + + // KeyVaultProperties + if encryption.KeyVaultProperties != nil { + keyVaultPropertyList := make([]v20240101s.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20240101s.KeyVaultProperties_STATUS + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + destination.KeyVaultProperties = keyVaultPropertyList + } else { + destination.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if encryption.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption + destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + destination.RequireInfrastructureEncryption = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForEncryption_STATUS interface (if implemented) to customize the conversion + var encryptionAsAny any = encryption + if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption_STATUS); ok { + err := augmentedEncryption.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.Identity +// Properties to configure Identity for Bring your Own Keys +type Identity struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` + UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} + +// AssignProperties_From_Identity populates our Identity from the provided source Identity +func (identity *Identity) AssignProperties_From_Identity(source *v20240101s.Identity) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Type + identity.Type = genruntime.ClonePointerToString(source.Type) + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity UserAssignedIdentityDetails + err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + identity.PropertyBag = propertyBag + } else { + identity.PropertyBag = nil + } + + // Invoke the augmentConversionForIdentity interface (if implemented) to customize the conversion + var identityAsAny any = identity + if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity); ok { + err := augmentedIdentity.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Identity populates the provided destination Identity from our Identity +func (identity *Identity) AssignProperties_To_Identity(destination *v20240101s.Identity) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(identity.PropertyBag) + + // Type + destination.Type = genruntime.ClonePointerToString(identity.Type) + + // UserAssignedIdentities + if identity.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]v20240101s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity v20240101s.UserAssignedIdentityDetails + err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityList + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForIdentity interface (if implemented) to customize the conversion + var identityAsAny any = identity + if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity); ok { + err := augmentedIdentity.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.Identity_STATUS +// Properties to configure Identity for Bring your Own Keys +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"` +} + +// AssignProperties_From_Identity_STATUS populates our Identity_STATUS from the provided source Identity_STATUS +func (identity *Identity_STATUS) AssignProperties_From_Identity_STATUS(source *v20240101s.Identity_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // TenantId + identity.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // Type + identity.Type = genruntime.ClonePointerToString(source.Type) + + // 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.AssignProperties_From_UserAssignedIdentity_STATUS(&userAssignedIdentityValue) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") + } + userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityMap + } else { + identity.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + identity.PropertyBag = propertyBag + } else { + identity.PropertyBag = nil + } + + // Invoke the augmentConversionForIdentity_STATUS interface (if implemented) to customize the conversion + var identityAsAny any = identity + if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity_STATUS); ok { + err := augmentedIdentity.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Identity_STATUS populates the provided destination Identity_STATUS from our Identity_STATUS +func (identity *Identity_STATUS) AssignProperties_To_Identity_STATUS(destination *v20240101s.Identity_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(identity.PropertyBag) + + // PrincipalId + destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId) + + // TenantId + destination.TenantId = genruntime.ClonePointerToString(identity.TenantId) + + // Type + destination.Type = genruntime.ClonePointerToString(identity.Type) + + // UserAssignedIdentities + if identity.UserAssignedIdentities != nil { + userAssignedIdentityMap := make(map[string]v20240101s.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity v20240101s.UserAssignedIdentity_STATUS + err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") + } + userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityMap + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForIdentity_STATUS interface (if implemented) to customize the conversion + var identityAsAny any = identity + if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity_STATUS); ok { + err := augmentedIdentity.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.NamespaceOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespaceOperatorSpec struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespaceOperatorSpec populates our NamespaceOperatorSpec from the provided source NamespaceOperatorSpec +func (operator *NamespaceOperatorSpec) AssignProperties_From_NamespaceOperatorSpec(source *v20240101s.NamespaceOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Secrets + if source.Secrets != nil { + var secret NamespaceOperatorSecrets + err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaceOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespaceOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespaceOperatorSpec populates the provided destination NamespaceOperatorSpec from our NamespaceOperatorSpec +func (operator *NamespaceOperatorSpec) AssignProperties_To_NamespaceOperatorSpec(destination *v20240101s.NamespaceOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // Secrets + if operator.Secrets != nil { + var secret v20240101s.NamespaceOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSecrets() to populate field Secrets") + } + destination.Secrets = &secret + } else { + destination.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaceOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespaceOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.PrivateEndpointConnection_STATUS +// Properties of the PrivateEndpointConnection. +type PrivateEndpointConnection_STATUS struct { + Id *string `json:"id,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_PrivateEndpointConnection_STATUS populates our PrivateEndpointConnection_STATUS from the provided source PrivateEndpointConnection_STATUS +func (connection *PrivateEndpointConnection_STATUS) AssignProperties_From_PrivateEndpointConnection_STATUS(source *v20240101s.PrivateEndpointConnection_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Id + connection.Id = genruntime.ClonePointerToString(source.Id) + + // Update the property bag + if len(propertyBag) > 0 { + connection.PropertyBag = propertyBag + } else { + connection.PropertyBag = nil + } + + // Invoke the augmentConversionForPrivateEndpointConnection_STATUS interface (if implemented) to customize the conversion + var connectionAsAny any = connection + if augmentedConnection, ok := connectionAsAny.(augmentConversionForPrivateEndpointConnection_STATUS); ok { + err := augmentedConnection.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_PrivateEndpointConnection_STATUS populates the provided destination PrivateEndpointConnection_STATUS from our PrivateEndpointConnection_STATUS +func (connection *PrivateEndpointConnection_STATUS) AssignProperties_To_PrivateEndpointConnection_STATUS(destination *v20240101s.PrivateEndpointConnection_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(connection.PropertyBag) + + // Id + destination.Id = genruntime.ClonePointerToString(connection.Id) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForPrivateEndpointConnection_STATUS interface (if implemented) to customize the conversion + var connectionAsAny any = connection + if augmentedConnection, ok := connectionAsAny.(augmentConversionForPrivateEndpointConnection_STATUS); ok { + err := augmentedConnection.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.Sku +// SKU parameters supplied to the create namespace operation +type Sku struct { + Capacity *int `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// AssignProperties_From_Sku populates our Sku from the provided source Sku +func (sku *Sku) AssignProperties_From_Sku(source *v20240101s.Sku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Capacity + sku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + sku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sku.Tier = genruntime.ClonePointerToString(source.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + sku.PropertyBag = propertyBag + } else { + sku.PropertyBag = nil + } + + // Invoke the augmentConversionForSku interface (if implemented) to customize the conversion + var skuAsAny any = sku + if augmentedSku, ok := skuAsAny.(augmentConversionForSku); ok { + err := augmentedSku.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Sku populates the provided destination Sku from our Sku +func (sku *Sku) AssignProperties_To_Sku(destination *v20240101s.Sku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(sku.PropertyBag) + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity) + + // 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 + } + + // Invoke the augmentConversionForSku interface (if implemented) to customize the conversion + var skuAsAny any = sku + if augmentedSku, ok := skuAsAny.(augmentConversionForSku); ok { + err := augmentedSku.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.Sku_STATUS +// SKU parameters supplied to the create namespace operation +type Sku_STATUS struct { + Capacity *int `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// AssignProperties_From_Sku_STATUS populates our Sku_STATUS from the provided source Sku_STATUS +func (sku *Sku_STATUS) AssignProperties_From_Sku_STATUS(source *v20240101s.Sku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Capacity + sku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + sku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sku.Tier = genruntime.ClonePointerToString(source.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + sku.PropertyBag = propertyBag + } else { + sku.PropertyBag = nil + } + + // Invoke the augmentConversionForSku_STATUS interface (if implemented) to customize the conversion + var skuAsAny any = sku + if augmentedSku, ok := skuAsAny.(augmentConversionForSku_STATUS); ok { + err := augmentedSku.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Sku_STATUS populates the provided destination Sku_STATUS from our Sku_STATUS +func (sku *Sku_STATUS) AssignProperties_To_Sku_STATUS(destination *v20240101s.Sku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(sku.PropertyBag) + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity) + + // 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 + } + + // Invoke the augmentConversionForSku_STATUS interface (if implemented) to customize the conversion + var skuAsAny any = sku + if augmentedSku, ok := skuAsAny.(augmentConversionForSku_STATUS); ok { + err := augmentedSku.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.SystemData_STATUS +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByType *string `json:"createdByType,omitempty"` + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedByType *string `json:"lastModifiedByType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *v20240101s.SystemData_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CreatedAt + data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + data.CreatedByType = genruntime.ClonePointerToString(source.CreatedByType) + + // LastModifiedAt + data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt) + + // LastModifiedBy + data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) + + // LastModifiedByType + data.LastModifiedByType = genruntime.ClonePointerToString(source.LastModifiedByType) + + // Update the property bag + if len(propertyBag) > 0 { + data.PropertyBag = propertyBag + } else { + data.PropertyBag = nil + } + + // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion + var dataAsAny any = data + if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { + err := augmentedData.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *v20240101s.SystemData_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(data.PropertyBag) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt) + + // CreatedBy + destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy) + + // CreatedByType + destination.CreatedByType = genruntime.ClonePointerToString(data.CreatedByType) + + // LastModifiedAt + destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt) + + // LastModifiedBy + destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy) + + // LastModifiedByType + destination.LastModifiedByType = genruntime.ClonePointerToString(data.LastModifiedByType) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion + var dataAsAny any = data + if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { + err := augmentedData.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForEncryption interface { + AssignPropertiesFrom(src *v20240101s.Encryption) error + AssignPropertiesTo(dst *v20240101s.Encryption) error +} + +type augmentConversionForEncryption_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Encryption_STATUS) error + AssignPropertiesTo(dst *v20240101s.Encryption_STATUS) error +} + +type augmentConversionForIdentity interface { + AssignPropertiesFrom(src *v20240101s.Identity) error + AssignPropertiesTo(dst *v20240101s.Identity) error +} + +type augmentConversionForIdentity_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Identity_STATUS) error + AssignPropertiesTo(dst *v20240101s.Identity_STATUS) error +} + +type augmentConversionForNamespaceOperatorSpec interface { + AssignPropertiesFrom(src *v20240101s.NamespaceOperatorSpec) error + AssignPropertiesTo(dst *v20240101s.NamespaceOperatorSpec) error +} + +type augmentConversionForPrivateEndpointConnection_STATUS interface { + AssignPropertiesFrom(src *v20240101s.PrivateEndpointConnection_STATUS) error + AssignPropertiesTo(dst *v20240101s.PrivateEndpointConnection_STATUS) error +} + +type augmentConversionForSku interface { + AssignPropertiesFrom(src *v20240101s.Sku) error + AssignPropertiesTo(dst *v20240101s.Sku) error +} + +type augmentConversionForSku_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Sku_STATUS) error + AssignPropertiesTo(dst *v20240101s.Sku_STATUS) error +} + +type augmentConversionForSystemData_STATUS interface { + AssignPropertiesFrom(src *v20240101s.SystemData_STATUS) error + AssignPropertiesTo(dst *v20240101s.SystemData_STATUS) error +} + +// Storage version of v1api20211101.KeyVaultProperties +// Properties to configure keyVault Properties +type KeyVaultProperties struct { + Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_KeyVaultProperties populates our KeyVaultProperties from the provided source KeyVaultProperties +func (properties *KeyVaultProperties) AssignProperties_From_KeyVaultProperties(source *v20240101s.KeyVaultProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties + err := identity.AssignProperties_From_UserAssignedIdentityProperties(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties() to populate field Identity") + } + properties.Identity = &identity + } else { + properties.Identity = nil + } + + // KeyName + properties.KeyName = genruntime.ClonePointerToString(source.KeyName) + + // KeyVaultUri + properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) + + // KeyVersion + properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) + + // Update the property bag + if len(propertyBag) > 0 { + properties.PropertyBag = propertyBag + } else { + properties.PropertyBag = nil + } + + // Invoke the augmentConversionForKeyVaultProperties interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties); ok { + err := augmentedProperties.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_KeyVaultProperties populates the provided destination KeyVaultProperties from our KeyVaultProperties +func (properties *KeyVaultProperties) AssignProperties_To_KeyVaultProperties(destination *v20240101s.KeyVaultProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity v20240101s.UserAssignedIdentityProperties + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // KeyName + destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) + + // KeyVaultUri + destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) + + // KeyVersion + destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForKeyVaultProperties interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties); ok { + err := augmentedProperties.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.KeyVaultProperties_STATUS +// Properties to configure keyVault Properties +type KeyVaultProperties_STATUS struct { + Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_KeyVaultProperties_STATUS populates our KeyVaultProperties_STATUS from the provided source KeyVaultProperties_STATUS +func (properties *KeyVaultProperties_STATUS) AssignProperties_From_KeyVaultProperties_STATUS(source *v20240101s.KeyVaultProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties_STATUS + err := identity.AssignProperties_From_UserAssignedIdentityProperties_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") + } + properties.Identity = &identity + } else { + properties.Identity = nil + } + + // KeyName + properties.KeyName = genruntime.ClonePointerToString(source.KeyName) + + // KeyVaultUri + properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) + + // KeyVersion + properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) + + // Update the property bag + if len(propertyBag) > 0 { + properties.PropertyBag = propertyBag + } else { + properties.PropertyBag = nil + } + + // Invoke the augmentConversionForKeyVaultProperties_STATUS interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties_STATUS); ok { + err := augmentedProperties.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_KeyVaultProperties_STATUS populates the provided destination KeyVaultProperties_STATUS from our KeyVaultProperties_STATUS +func (properties *KeyVaultProperties_STATUS) AssignProperties_To_KeyVaultProperties_STATUS(destination *v20240101s.KeyVaultProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity v20240101s.UserAssignedIdentityProperties_STATUS + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // KeyName + destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) + + // KeyVaultUri + destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) + + // KeyVersion + destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForKeyVaultProperties_STATUS interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties_STATUS); ok { + err := augmentedProperties.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.NamespaceOperatorSecrets +type NamespaceOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespaceOperatorSecrets populates our NamespaceOperatorSecrets from the provided source NamespaceOperatorSecrets +func (secrets *NamespaceOperatorSecrets) AssignProperties_From_NamespaceOperatorSecrets(source *v20240101s.NamespaceOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + secrets.PropertyBag = propertyBag + } else { + secrets.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaceOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespaceOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespaceOperatorSecrets populates the provided destination NamespaceOperatorSecrets from our NamespaceOperatorSecrets +func (secrets *NamespaceOperatorSecrets) AssignProperties_To_NamespaceOperatorSecrets(destination *v20240101s.NamespaceOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaceOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespaceOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.UserAssignedIdentity_STATUS +// Recognized Dictionary value. +type UserAssignedIdentity_STATUS struct { + ClientId *string `json:"clientId,omitempty"` + PrincipalId *string `json:"principalId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_UserAssignedIdentity_STATUS populates our UserAssignedIdentity_STATUS from the provided source UserAssignedIdentity_STATUS +func (identity *UserAssignedIdentity_STATUS) AssignProperties_From_UserAssignedIdentity_STATUS(source *v20240101s.UserAssignedIdentity_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ClientId + identity.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // Update the property bag + if len(propertyBag) > 0 { + identity.PropertyBag = propertyBag + } else { + identity.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentity_STATUS interface (if implemented) to customize the conversion + var identityAsAny any = identity + if augmentedIdentity, ok := identityAsAny.(augmentConversionForUserAssignedIdentity_STATUS); ok { + err := augmentedIdentity.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentity_STATUS populates the provided destination UserAssignedIdentity_STATUS from our UserAssignedIdentity_STATUS +func (identity *UserAssignedIdentity_STATUS) AssignProperties_To_UserAssignedIdentity_STATUS(destination *v20240101s.UserAssignedIdentity_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(identity.PropertyBag) + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(identity.ClientId) + + // PrincipalId + destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentity_STATUS interface (if implemented) to customize the conversion + var identityAsAny any = identity + if augmentedIdentity, ok := identityAsAny.(augmentConversionForUserAssignedIdentity_STATUS); ok { + err := augmentedIdentity.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.UserAssignedIdentityDetails +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` +} + +// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails +func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *v20240101s.UserAssignedIdentityDetails) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Reference + details.Reference = source.Reference.Copy() + + // Update the property bag + if len(propertyBag) > 0 { + details.PropertyBag = propertyBag + } else { + details.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentityDetails interface (if implemented) to customize the conversion + var detailsAsAny any = details + if augmentedDetails, ok := detailsAsAny.(augmentConversionForUserAssignedIdentityDetails); ok { + err := augmentedDetails.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityDetails populates the provided destination UserAssignedIdentityDetails from our UserAssignedIdentityDetails +func (details *UserAssignedIdentityDetails) AssignProperties_To_UserAssignedIdentityDetails(destination *v20240101s.UserAssignedIdentityDetails) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(details.PropertyBag) + + // Reference + destination.Reference = details.Reference.Copy() + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentityDetails interface (if implemented) to customize the conversion + var detailsAsAny any = details + if augmentedDetails, ok := detailsAsAny.(augmentConversionForUserAssignedIdentityDetails); ok { + err := augmentedDetails.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForKeyVaultProperties interface { + AssignPropertiesFrom(src *v20240101s.KeyVaultProperties) error + AssignPropertiesTo(dst *v20240101s.KeyVaultProperties) error +} + +type augmentConversionForKeyVaultProperties_STATUS interface { + AssignPropertiesFrom(src *v20240101s.KeyVaultProperties_STATUS) error + AssignPropertiesTo(dst *v20240101s.KeyVaultProperties_STATUS) error +} + +type augmentConversionForNamespaceOperatorSecrets interface { + AssignPropertiesFrom(src *v20240101s.NamespaceOperatorSecrets) error + AssignPropertiesTo(dst *v20240101s.NamespaceOperatorSecrets) error +} + +type augmentConversionForUserAssignedIdentity_STATUS interface { + AssignPropertiesFrom(src *v20240101s.UserAssignedIdentity_STATUS) error + AssignPropertiesTo(dst *v20240101s.UserAssignedIdentity_STATUS) error +} + +type augmentConversionForUserAssignedIdentityDetails interface { + AssignPropertiesFrom(src *v20240101s.UserAssignedIdentityDetails) error + AssignPropertiesTo(dst *v20240101s.UserAssignedIdentityDetails) error +} + +// Storage version of v1api20211101.UserAssignedIdentityProperties +type UserAssignedIdentityProperties struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // UserAssignedIdentityReference: ARM ID of user Identity selected for encryption + UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` +} + +// AssignProperties_From_UserAssignedIdentityProperties populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties +func (properties *UserAssignedIdentityProperties) AssignProperties_From_UserAssignedIdentityProperties(source *v20240101s.UserAssignedIdentityProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // UserAssignedIdentityReference + if source.UserAssignedIdentityReference != nil { + userAssignedIdentityReference := source.UserAssignedIdentityReference.Copy() + properties.UserAssignedIdentityReference = &userAssignedIdentityReference + } else { + properties.UserAssignedIdentityReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + properties.PropertyBag = propertyBag + } else { + properties.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentityProperties interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties); ok { + err := augmentedProperties.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityProperties populates the provided destination UserAssignedIdentityProperties from our UserAssignedIdentityProperties +func (properties *UserAssignedIdentityProperties) AssignProperties_To_UserAssignedIdentityProperties(destination *v20240101s.UserAssignedIdentityProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // UserAssignedIdentityReference + if properties.UserAssignedIdentityReference != nil { + userAssignedIdentityReference := properties.UserAssignedIdentityReference.Copy() + destination.UserAssignedIdentityReference = &userAssignedIdentityReference + } else { + destination.UserAssignedIdentityReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentityProperties interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties); ok { + err := augmentedProperties.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20211101.UserAssignedIdentityProperties_STATUS +type UserAssignedIdentityProperties_STATUS struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +// AssignProperties_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties_STATUS from the provided source UserAssignedIdentityProperties_STATUS +func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_From_UserAssignedIdentityProperties_STATUS(source *v20240101s.UserAssignedIdentityProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // UserAssignedIdentity + properties.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) + + // Update the property bag + if len(propertyBag) > 0 { + properties.PropertyBag = propertyBag + } else { + properties.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentityProperties_STATUS interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties_STATUS); ok { + err := augmentedProperties.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityProperties_STATUS populates the provided destination UserAssignedIdentityProperties_STATUS from our UserAssignedIdentityProperties_STATUS +func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_To_UserAssignedIdentityProperties_STATUS(destination *v20240101s.UserAssignedIdentityProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // UserAssignedIdentity + destination.UserAssignedIdentity = genruntime.ClonePointerToString(properties.UserAssignedIdentity) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForUserAssignedIdentityProperties_STATUS interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties_STATUS); ok { + err := augmentedProperties.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForUserAssignedIdentityProperties interface { + AssignPropertiesFrom(src *v20240101s.UserAssignedIdentityProperties) error + AssignPropertiesTo(dst *v20240101s.UserAssignedIdentityProperties) error +} + +type augmentConversionForUserAssignedIdentityProperties_STATUS interface { + AssignPropertiesFrom(src *v20240101s.UserAssignedIdentityProperties_STATUS) error + AssignPropertiesTo(dst *v20240101s.UserAssignedIdentityProperties_STATUS) error } func init() { diff --git a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go index 52663c67cf3..ed90eefc437 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_Namespace_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespace tests if a specific instance of Namespace round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespace(subject Namespace) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.Namespace + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual Namespace + 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_Namespace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace to Namespace via AssignProperties_To_Namespace & AssignProperties_From_Namespace returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace tests if a specific instance of Namespace can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace(subject Namespace) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Namespace + err := copied.AssignProperties_To_Namespace(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespace + err = actual.AssignProperties_From_Namespace(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -78,6 +164,48 @@ func AddRelatedPropertyGeneratorsForNamespace(gens map[string]gopter.Gen) { gens["Status"] = Namespace_STATUSGenerator() } +func Test_Namespace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_Spec to Namespace_Spec via AssignProperties_To_Namespace_Spec & AssignProperties_From_Namespace_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_Spec, Namespace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_Spec tests if a specific instance of Namespace_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_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 v20240101s.Namespace_Spec + err := copied.AssignProperties_To_Namespace_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespace_Spec + err = actual.AssignProperties_From_Namespace_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespace_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -160,9 +288,52 @@ func AddIndependentPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Ge func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { gens["Encryption"] = gen.PtrOf(EncryptionGenerator()) gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespaceOperatorSpecGenerator()) gens["Sku"] = gen.PtrOf(SkuGenerator()) } +func Test_Namespace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_STATUS to Namespace_STATUS via AssignProperties_To_Namespace_STATUS & AssignProperties_From_Namespace_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_STATUS, Namespace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_STATUS tests if a specific instance of Namespace_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_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 v20240101s.Namespace_STATUS + err := copied.AssignProperties_To_Namespace_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespace_STATUS + err = actual.AssignProperties_From_Namespace_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -258,6 +429,48 @@ func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_Encryption_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption to Encryption via AssignProperties_To_Encryption & AssignProperties_From_Encryption returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption, EncryptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption tests if a specific instance of Encryption can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption(subject Encryption) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Encryption + err := copied.AssignProperties_To_Encryption(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Encryption + err = actual.AssignProperties_From_Encryption(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Encryption_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -333,6 +546,48 @@ func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) } +func Test_Encryption_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption_STATUS to Encryption_STATUS via AssignProperties_To_Encryption_STATUS & AssignProperties_From_Encryption_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption_STATUS, Encryption_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption_STATUS tests if a specific instance of Encryption_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_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 v20240101s.Encryption_STATUS + err := copied.AssignProperties_To_Encryption_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Encryption_STATUS + err = actual.AssignProperties_From_Encryption_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Encryption_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -408,6 +663,48 @@ func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) } +func Test_Identity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity to Identity via AssignProperties_To_Identity & AssignProperties_From_Identity returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity tests if a specific instance of Identity can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity(subject Identity) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Identity + err := copied.AssignProperties_To_Identity(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity + err = actual.AssignProperties_From_Identity(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -482,6 +779,48 @@ func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) } +func Test_Identity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity_STATUS to Identity_STATUS via AssignProperties_To_Identity_STATUS & AssignProperties_From_Identity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity_STATUS tests if a specific instance of Identity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Identity_STATUS + err := copied.AssignProperties_To_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity_STATUS + err = actual.AssignProperties_From_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -558,34 +897,37 @@ func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUSGenerator()) } -func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { +func Test_NamespaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 + parameters.MaxSize = 10 properties := gopter.NewProperties(parameters) properties.Property( - "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) + "Round trip from NamespaceOperatorSpec to NamespaceOperatorSpec via AssignProperties_To_NamespaceOperatorSpec & AssignProperties_From_NamespaceOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) } -// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) +// RunPropertyAssignmentTestForNamespaceOperatorSpec tests if a specific instance of NamespaceOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespaceOperatorSpec + err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) if err != nil { return err.Error() } - // Deserialize back into memory - var actual PrivateEndpointConnection_STATUS - err = json.Unmarshal(bin, &actual) + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespaceOperatorSpec + err = actual.AssignProperties_From_NamespaceOperatorSpec(&other) if err != nil { return err.Error() } - // Check for outcome + // Check for a match match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) if !match { actualFmt := pretty.Sprint(actual) @@ -597,37 +939,221 @@ func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject Private return "" } -// Generator of PrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by -// PrivateEndpointConnection_STATUSGenerator() -var privateEndpointConnection_STATUSGenerator gopter.Gen - -// PrivateEndpointConnection_STATUSGenerator returns a generator of PrivateEndpointConnection_STATUS instances for property testing. -func PrivateEndpointConnection_STATUSGenerator() gopter.Gen { - if privateEndpointConnection_STATUSGenerator != nil { - return privateEndpointConnection_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(generators) - privateEndpointConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS{}), generators) - - return privateEndpointConnection_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { +func Test_NamespaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() parameters.MinSuccessfulTests = 100 parameters.MaxSize = 3 properties := gopter.NewProperties(parameters) properties.Property( - "Round trip of Sku via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSku, SkuGenerator())) + "Round trip of NamespaceOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSpec runs a test to see if a specific instance of NamespaceOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSpec instances for property testing - lazily instantiated by +// NamespaceOperatorSpecGenerator() +var namespaceOperatorSpecGenerator gopter.Gen + +// NamespaceOperatorSpecGenerator returns a generator of NamespaceOperatorSpec instances for property testing. +func NamespaceOperatorSpecGenerator() gopter.Gen { + if namespaceOperatorSpecGenerator != nil { + return namespaceOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(generators) + namespaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSpec{}), generators) + + return namespaceOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespaceOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) +} + +func Test_PrivateEndpointConnection_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PrivateEndpointConnection_STATUS to PrivateEndpointConnection_STATUS via AssignProperties_To_PrivateEndpointConnection_STATUS & AssignProperties_From_PrivateEndpointConnection_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS tests if a specific instance of PrivateEndpointConnection_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_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 v20240101s.PrivateEndpointConnection_STATUS + err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual PrivateEndpointConnection_STATUS + err = actual.AssignProperties_From_PrivateEndpointConnection_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateEndpointConnection_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 PrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by +// PrivateEndpointConnection_STATUSGenerator() +var privateEndpointConnection_STATUSGenerator gopter.Gen + +// PrivateEndpointConnection_STATUSGenerator returns a generator of PrivateEndpointConnection_STATUS instances for property testing. +func PrivateEndpointConnection_STATUSGenerator() gopter.Gen { + if privateEndpointConnection_STATUSGenerator != nil { + return privateEndpointConnection_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(generators) + privateEndpointConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS{}), generators) + + return privateEndpointConnection_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +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 AssignProperties_To_Sku & AssignProperties_From_Sku 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 storage 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 v20240101s.Sku + err := copied.AssignProperties_To_Sku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Sku + err = actual.AssignProperties_From_Sku(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSku, SkuGenerator())) properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) } @@ -681,6 +1207,48 @@ func AddIndependentPropertyGeneratorsForSku(gens map[string]gopter.Gen) { 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 AssignProperties_To_Sku_STATUS & AssignProperties_From_Sku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSku_STATUS, Sku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSku_STATUS tests if a specific instance of Sku_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForSku_STATUS(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 v20240101s.Sku_STATUS + err := copied.AssignProperties_To_Sku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Sku_STATUS + err = actual.AssignProperties_From_Sku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Sku_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -743,6 +1311,48 @@ func AddIndependentPropertyGeneratorsForSku_STATUS(gens map[string]gopter.Gen) { gens["Tier"] = gen.PtrOf(gen.AlphaString()) } +func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.SystemData_STATUS + err := copied.AssignProperties_To_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_STATUS + err = actual.AssignProperties_From_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -808,6 +1418,48 @@ func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter gens["LastModifiedByType"] = 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 AssignProperties_To_KeyVaultProperties & AssignProperties_From_KeyVaultProperties 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 storage 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 v20240101s.KeyVaultProperties + err := copied.AssignProperties_To_KeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual KeyVaultProperties + err = actual.AssignProperties_From_KeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -884,6 +1536,48 @@ func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Ge gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) } +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 AssignProperties_To_KeyVaultProperties_STATUS & AssignProperties_From_KeyVaultProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultProperties_STATUS tests if a specific instance of KeyVaultProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(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 v20240101s.KeyVaultProperties_STATUS + err := copied.AssignProperties_To_KeyVaultProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual KeyVaultProperties_STATUS + err = actual.AssignProperties_From_KeyVaultProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_KeyVaultProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -961,6 +1655,145 @@ func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]go gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) } +func Test_NamespaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSecrets to NamespaceOperatorSecrets via AssignProperties_To_NamespaceOperatorSecrets & AssignProperties_From_NamespaceOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSecrets tests if a specific instance of NamespaceOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespaceOperatorSecrets + err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespaceOperatorSecrets + err = actual.AssignProperties_From_NamespaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespaceOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSecrets runs a test to see if a specific instance of NamespaceOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSecrets instances for property testing - lazily instantiated by +// NamespaceOperatorSecretsGenerator() +var namespaceOperatorSecretsGenerator gopter.Gen + +// NamespaceOperatorSecretsGenerator returns a generator of NamespaceOperatorSecrets instances for property testing. +func NamespaceOperatorSecretsGenerator() gopter.Gen { + if namespaceOperatorSecretsGenerator != nil { + return namespaceOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSecrets{}), generators) + + return namespaceOperatorSecretsGenerator +} + +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 AssignProperties_To_UserAssignedIdentity_STATUS & AssignProperties_From_UserAssignedIdentity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentity_STATUS tests if a specific instance of UserAssignedIdentity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(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 v20240101s.UserAssignedIdentity_STATUS + err := copied.AssignProperties_To_UserAssignedIdentity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentity_STATUS + err = actual.AssignProperties_From_UserAssignedIdentity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_UserAssignedIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1023,6 +1856,48 @@ func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(gens map[str gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) } +func Test_UserAssignedIdentityDetails_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityDetails to UserAssignedIdentityDetails via AssignProperties_To_UserAssignedIdentityDetails & AssignProperties_From_UserAssignedIdentityDetails returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityDetails tests if a specific instance of UserAssignedIdentityDetails can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.UserAssignedIdentityDetails + err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityDetails + err = actual.AssignProperties_From_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1078,6 +1953,48 @@ func UserAssignedIdentityDetailsGenerator() gopter.Gen { return userAssignedIdentityDetailsGenerator } +func Test_UserAssignedIdentityProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties to UserAssignedIdentityProperties via AssignProperties_To_UserAssignedIdentityProperties & AssignProperties_From_UserAssignedIdentityProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties tests if a specific instance of UserAssignedIdentityProperties can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.UserAssignedIdentityProperties + err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityProperties + err = actual.AssignProperties_From_UserAssignedIdentityProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_UserAssignedIdentityProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1133,6 +2050,48 @@ func UserAssignedIdentityPropertiesGenerator() gopter.Gen { return userAssignedIdentityPropertiesGenerator } +func Test_UserAssignedIdentityProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties_STATUS to UserAssignedIdentityProperties_STATUS via AssignProperties_To_UserAssignedIdentityProperties_STATUS & AssignProperties_From_UserAssignedIdentityProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS tests if a specific instance of UserAssignedIdentityProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_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 v20240101s.UserAssignedIdentityProperties_STATUS + err := copied.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityProperties_STATUS + err = actual.AssignProperties_From_UserAssignedIdentityProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_UserAssignedIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go index 94a156cded6..a0bcb7913bc 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go @@ -4,19 +4,18 @@ package storage import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespacesauthorizationrules/status,namespacesauthorizationrules/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" @@ -44,6 +43,28 @@ func (rule *NamespacesAuthorizationRule) SetConditions(conditions conditions.Con rule.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesAuthorizationRule{} + +// ConvertFrom populates our NamespacesAuthorizationRule from the provided hub NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesAuthorizationRule(source) +} + +// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) +} + var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -115,8 +136,75 @@ func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.Convertible return nil } -// Hub marks that this NamespacesAuthorizationRule is the hub type for conversion -func (rule *NamespacesAuthorizationRule) Hub() {} +// AssignProperties_From_NamespacesAuthorizationRule populates our NamespacesAuthorizationRule from the provided source NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) AssignProperties_From_NamespacesAuthorizationRule(source *v20240101s.NamespacesAuthorizationRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_AuthorizationRule_Spec + err := spec.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_AuthorizationRule_STATUS + err = status.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_STATUS() to populate field Status") + } + rule.Status = status + + // Invoke the augmentConversionForNamespacesAuthorizationRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRule populates the provided destination NamespacesAuthorizationRule from our NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) AssignProperties_To_NamespacesAuthorizationRule(destination *v20240101s.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_AuthorizationRule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_AuthorizationRule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesAuthorizationRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { @@ -138,12 +226,18 @@ type NamespacesAuthorizationRuleList struct { Items []NamespacesAuthorizationRule `json:"items"` } +type augmentConversionForNamespacesAuthorizationRule interface { + AssignPropertiesFrom(src *v20240101s.NamespacesAuthorizationRule) error + AssignPropertiesTo(dst *v20240101s.NamespacesAuthorizationRule) error +} + // Storage version of v1api20211101.Namespaces_AuthorizationRule_Spec type Namespaces_AuthorizationRule_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"` - OriginalVersion string `json:"originalVersion,omitempty"` + AzureName string `json:"azureName,omitempty"` + OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `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 @@ -158,20 +252,158 @@ var _ genruntime.ConvertibleSpec = &Namespaces_AuthorizationRule_Spec{} // ConvertSpecFrom populates our Namespaces_AuthorizationRule_Spec from the provided source func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) } - return source.ConvertSpecTo(rule) + // Convert to an intermediate form + src = &v20240101s.Namespaces_AuthorizationRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_AuthorizationRule_Spec func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) } - return destination.ConvertSpecFrom(rule) + // Convert to an intermediate form + dst = &v20240101s.Namespaces_AuthorizationRule_Spec{} + err := rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(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 +} + +// AssignProperties_From_Namespaces_AuthorizationRule_Spec populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_Spec +func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_From_Namespaces_AuthorizationRule_Spec(source *v20240101s.Namespaces_AuthorizationRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AzureName + rule.AzureName = source.AzureName + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesAuthorizationRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + + // OriginalVersion + rule.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // Rights + rule.Rights = genruntime.CloneSliceOfString(source.Rights) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_AuthorizationRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_Spec); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_AuthorizationRule_Spec populates the provided destination Namespaces_AuthorizationRule_Spec from our Namespaces_AuthorizationRule_Spec +func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_AuthorizationRule_Spec(destination *v20240101s.Namespaces_AuthorizationRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // AzureName + destination.AzureName = rule.AzureName + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20240101s.NamespacesAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Rights + destination.Rights = genruntime.CloneSliceOfString(rule.Rights) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_AuthorizationRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_Spec); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.Namespaces_AuthorizationRule_STATUS @@ -190,20 +422,384 @@ var _ genruntime.ConvertibleStatus = &Namespaces_AuthorizationRule_STATUS{} // ConvertStatusFrom populates our Namespaces_AuthorizationRule_STATUS from the provided source func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_AuthorizationRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(rule) + return nil } // ConvertStatusTo populates the provided destination from our Namespaces_AuthorizationRule_STATUS func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_AuthorizationRule_STATUS{} + err := rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") } - return destination.ConvertStatusFrom(rule) + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_STATUS from the provided source Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_AuthorizationRule_STATUS(source *v20240101s.Namespaces_AuthorizationRule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // Rights + rule.Rights = genruntime.CloneSliceOfString(source.Rights) + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + rule.SystemData = &systemDatum + } else { + rule.SystemData = nil + } + + // Type + rule.Type = genruntime.ClonePointerToString(source.Type) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_AuthorizationRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_STATUS); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_AuthorizationRule_STATUS populates the provided destination Namespaces_AuthorizationRule_STATUS from our Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_AuthorizationRule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // Rights + destination.Rights = genruntime.CloneSliceOfString(rule.Rights) + + // SystemData + if rule.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_AuthorizationRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_STATUS); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_AuthorizationRule_Spec interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_AuthorizationRule_Spec) error + AssignPropertiesTo(dst *v20240101s.Namespaces_AuthorizationRule_Spec) error +} + +type augmentConversionForNamespaces_AuthorizationRule_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_AuthorizationRule_STATUS) error + AssignPropertiesTo(dst *v20240101s.Namespaces_AuthorizationRule_STATUS) error +} + +// Storage version of v1api20211101.NamespacesAuthorizationRuleOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesAuthorizationRuleOperatorSpec struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec populates our NamespacesAuthorizationRuleOperatorSpec from the provided source NamespacesAuthorizationRuleOperatorSpec +func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Secrets + if source.Secrets != nil { + var secret NamespacesAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec populates the provided destination NamespacesAuthorizationRuleOperatorSpec from our NamespacesAuthorizationRuleOperatorSpec +func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // Secrets + if operator.Secrets != nil { + var secret v20240101s.NamespacesAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + destination.Secrets = &secret + } else { + destination.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface { + AssignPropertiesFrom(src *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error + AssignPropertiesTo(dst *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error +} + +// Storage version of v1api20211101.NamespacesAuthorizationRuleOperatorSecrets +type NamespacesAuthorizationRuleOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets populates our NamespacesAuthorizationRuleOperatorSecrets from the provided source NamespacesAuthorizationRuleOperatorSecrets +func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + secrets.PropertyBag = propertyBag + } else { + secrets.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets populates the provided destination NamespacesAuthorizationRuleOperatorSecrets from our NamespacesAuthorizationRuleOperatorSecrets +func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface { + AssignPropertiesFrom(src *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error + AssignPropertiesTo(dst *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error } func init() { diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go index a94ab5da0d4..cb1d68dba27 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_NamespacesAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesAuthorizationRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesAuthorizationRule + 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_NamespacesAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to NamespacesAuthorizationRule via AssignProperties_To_NamespacesAuthorizationRule & AssignProperties_From_NamespacesAuthorizationRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesAuthorizationRule + err := copied.AssignProperties_To_NamespacesAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRule + err = actual.AssignProperties_From_NamespacesAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -79,6 +165,48 @@ func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(gens map[string] gens["Status"] = Namespaces_AuthorizationRule_STATUSGenerator() } +func Test_Namespaces_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_AuthorizationRule_Spec to Namespaces_AuthorizationRule_Spec via AssignProperties_To_Namespaces_AuthorizationRule_Spec & AssignProperties_From_Namespaces_AuthorizationRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec tests if a specific instance of Namespaces_AuthorizationRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_Spec + err := copied.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_AuthorizationRule_Spec + err = actual.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -123,6 +251,9 @@ func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec(subject Namesp var namespaces_AuthorizationRule_SpecGenerator gopter.Gen // Namespaces_AuthorizationRule_SpecGenerator returns a generator of Namespaces_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { if namespaces_AuthorizationRule_SpecGenerator != nil { return namespaces_AuthorizationRule_SpecGenerator @@ -132,6 +263,12 @@ func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + return namespaces_AuthorizationRule_SpecGenerator } @@ -142,6 +279,53 @@ func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens m gens["Rights"] = gen.SliceOf(gen.AlphaString()) } +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) +} + +func Test_Namespaces_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_AuthorizationRule_STATUS to Namespaces_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_AuthorizationRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS tests if a specific instance of Namespaces_AuthorizationRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_STATUS + err := copied.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_AuthorizationRule_STATUS + err = actual.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -220,3 +404,203 @@ func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSpec to NamespacesAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesAuthorizationRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSpecGenerator() +var namespacesAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(generators) + namespacesAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSpec{}), generators) + + return namespacesAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSecrets to NamespacesAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesAuthorizationRuleOperatorSecrets + err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRuleOperatorSecrets + err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSecretsGenerator() +var namespacesAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go index 97bec1cec9e..b0eccd0e4df 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go @@ -4,19 +4,18 @@ package storage import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubs/status,namespaceseventhubs/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" @@ -44,6 +43,28 @@ func (eventhub *NamespacesEventhub) SetConditions(conditions conditions.Conditio eventhub.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesEventhub{} + +// ConvertFrom populates our NamespacesEventhub from the provided hub NamespacesEventhub +func (eventhub *NamespacesEventhub) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesEventhub) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) + } + + return eventhub.AssignProperties_From_NamespacesEventhub(source) +} + +// ConvertTo populates the provided hub NamespacesEventhub from our NamespacesEventhub +func (eventhub *NamespacesEventhub) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesEventhub) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) + } + + return eventhub.AssignProperties_To_NamespacesEventhub(destination) +} + var _ genruntime.KubernetesResource = &NamespacesEventhub{} // AzureName returns the Azure name of the resource @@ -115,8 +136,75 @@ func (eventhub *NamespacesEventhub) SetStatus(status genruntime.ConvertibleStatu return nil } -// Hub marks that this NamespacesEventhub is the hub type for conversion -func (eventhub *NamespacesEventhub) Hub() {} +// AssignProperties_From_NamespacesEventhub populates our NamespacesEventhub from the provided source NamespacesEventhub +func (eventhub *NamespacesEventhub) AssignProperties_From_NamespacesEventhub(source *v20240101s.NamespacesEventhub) error { + + // ObjectMeta + eventhub.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Eventhub_Spec + err := spec.AssignProperties_From_Namespaces_Eventhub_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_Spec() to populate field Spec") + } + eventhub.Spec = spec + + // Status + var status Namespaces_Eventhub_STATUS + err = status.AssignProperties_From_Namespaces_Eventhub_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_STATUS() to populate field Status") + } + eventhub.Status = status + + // Invoke the augmentConversionForNamespacesEventhub interface (if implemented) to customize the conversion + var eventhubAsAny any = eventhub + if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespacesEventhub); ok { + err := augmentedEventhub.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhub populates the provided destination NamespacesEventhub from our NamespacesEventhub +func (eventhub *NamespacesEventhub) AssignProperties_To_NamespacesEventhub(destination *v20240101s.NamespacesEventhub) error { + + // ObjectMeta + destination.ObjectMeta = *eventhub.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_Eventhub_Spec + err := eventhub.Spec.AssignProperties_To_Namespaces_Eventhub_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_Eventhub_STATUS + err = eventhub.Status.AssignProperties_To_Namespaces_Eventhub_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesEventhub interface (if implemented) to customize the conversion + var eventhubAsAny any = eventhub + if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespacesEventhub); ok { + err := augmentedEventhub.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (eventhub *NamespacesEventhub) OriginalGVK() *schema.GroupVersionKind { @@ -138,6 +226,11 @@ type NamespacesEventhubList struct { Items []NamespacesEventhub `json:"items"` } +type augmentConversionForNamespacesEventhub interface { + AssignPropertiesFrom(src *v20240101s.NamespacesEventhub) error + AssignPropertiesTo(dst *v20240101s.NamespacesEventhub) error +} + // Storage version of v1api20211101.Namespaces_Eventhub_Spec type Namespaces_Eventhub_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 @@ -160,20 +253,184 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Eventhub_Spec{} // ConvertSpecFrom populates our Namespaces_Eventhub_Spec from the provided source func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20240101s.Namespaces_Eventhub_Spec) + if ok { + // Populate our instance from source + return eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) } - return source.ConvertSpecTo(eventhub) + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhub_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_Eventhub_Spec func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20240101s.Namespaces_Eventhub_Spec) + if ok { + // Populate destination from our instance + return eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhub_Spec{} + err := eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(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 +} + +// AssignProperties_From_Namespaces_Eventhub_Spec populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_Spec +func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_From_Namespaces_Eventhub_Spec(source *v20240101s.Namespaces_Eventhub_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AzureName + eventhub.AzureName = source.AzureName + + // CaptureDescription + if source.CaptureDescription != nil { + var captureDescription CaptureDescription + err := captureDescription.AssignProperties_From_CaptureDescription(source.CaptureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription() to populate field CaptureDescription") + } + eventhub.CaptureDescription = &captureDescription + } else { + eventhub.CaptureDescription = nil + } + + // MessageRetentionInDays + eventhub.MessageRetentionInDays = genruntime.ClonePointerToInt(source.MessageRetentionInDays) + + // OriginalVersion + eventhub.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + eventhub.Owner = &owner + } else { + eventhub.Owner = nil + } + + // PartitionCount + eventhub.PartitionCount = genruntime.ClonePointerToInt(source.PartitionCount) + + // RetentionDescription + if source.RetentionDescription != nil { + propertyBag.Add("RetentionDescription", *source.RetentionDescription) + } else { + propertyBag.Remove("RetentionDescription") + } + + // Update the property bag + if len(propertyBag) > 0 { + eventhub.PropertyBag = propertyBag + } else { + eventhub.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhub_Spec interface (if implemented) to customize the conversion + var eventhubAsAny any = eventhub + if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_Spec); ok { + err := augmentedEventhub.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } } - return destination.ConvertSpecFrom(eventhub) + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhub_Spec populates the provided destination Namespaces_Eventhub_Spec from our Namespaces_Eventhub_Spec +func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_To_Namespaces_Eventhub_Spec(destination *v20240101s.Namespaces_Eventhub_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(eventhub.PropertyBag) + + // AzureName + destination.AzureName = eventhub.AzureName + + // CaptureDescription + if eventhub.CaptureDescription != nil { + var captureDescription v20240101s.CaptureDescription + err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription(&captureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription() to populate field CaptureDescription") + } + destination.CaptureDescription = &captureDescription + } else { + destination.CaptureDescription = nil + } + + // MessageRetentionInDays + destination.MessageRetentionInDays = genruntime.ClonePointerToInt(eventhub.MessageRetentionInDays) + + // OriginalVersion + destination.OriginalVersion = eventhub.OriginalVersion + + // Owner + if eventhub.Owner != nil { + owner := eventhub.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // PartitionCount + destination.PartitionCount = genruntime.ClonePointerToInt(eventhub.PartitionCount) + + // RetentionDescription + if propertyBag.Contains("RetentionDescription") { + var retentionDescription v20240101s.RetentionDescription + err := propertyBag.Pull("RetentionDescription", &retentionDescription) + if err != nil { + return errors.Wrap(err, "pulling 'RetentionDescription' from propertyBag") + } + + destination.RetentionDescription = &retentionDescription + } else { + destination.RetentionDescription = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhub_Spec interface (if implemented) to customize the conversion + var eventhubAsAny any = eventhub + if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_Spec); ok { + err := augmentedEventhub.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.Namespaces_Eventhub_STATUS @@ -198,20 +455,244 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Eventhub_STATUS{} // ConvertStatusFrom populates our Namespaces_Eventhub_STATUS from the provided source func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20240101s.Namespaces_Eventhub_STATUS) + if ok { + // Populate our instance from source + return eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) } - return source.ConvertStatusTo(eventhub) + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhub_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil } // ConvertStatusTo populates the provided destination from our Namespaces_Eventhub_STATUS func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20240101s.Namespaces_Eventhub_STATUS) + if ok { + // Populate destination from our instance + return eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhub_STATUS{} + err := eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(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 +} + +// AssignProperties_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_STATUS from the provided source Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_From_Namespaces_Eventhub_STATUS(source *v20240101s.Namespaces_Eventhub_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CaptureDescription + if source.CaptureDescription != nil { + var captureDescription CaptureDescription_STATUS + err := captureDescription.AssignProperties_From_CaptureDescription_STATUS(source.CaptureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription_STATUS() to populate field CaptureDescription") + } + eventhub.CaptureDescription = &captureDescription + } else { + eventhub.CaptureDescription = nil + } + + // Conditions + eventhub.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedAt + eventhub.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // Id + eventhub.Id = genruntime.ClonePointerToString(source.Id) + + // Location + eventhub.Location = genruntime.ClonePointerToString(source.Location) + + // MessageRetentionInDays + eventhub.MessageRetentionInDays = genruntime.ClonePointerToInt(source.MessageRetentionInDays) + + // Name + eventhub.Name = genruntime.ClonePointerToString(source.Name) + + // PartitionCount + eventhub.PartitionCount = genruntime.ClonePointerToInt(source.PartitionCount) + + // PartitionIds + eventhub.PartitionIds = genruntime.CloneSliceOfString(source.PartitionIds) + + // RetentionDescription + if source.RetentionDescription != nil { + propertyBag.Add("RetentionDescription", *source.RetentionDescription) + } else { + propertyBag.Remove("RetentionDescription") + } + + // Status + eventhub.Status = genruntime.ClonePointerToString(source.Status) + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + eventhub.SystemData = &systemDatum + } else { + eventhub.SystemData = nil + } + + // Type + eventhub.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + eventhub.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + eventhub.PropertyBag = propertyBag + } else { + eventhub.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhub_STATUS interface (if implemented) to customize the conversion + var eventhubAsAny any = eventhub + if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_STATUS); ok { + err := augmentedEventhub.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhub_STATUS populates the provided destination Namespaces_Eventhub_STATUS from our Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_To_Namespaces_Eventhub_STATUS(destination *v20240101s.Namespaces_Eventhub_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(eventhub.PropertyBag) + + // CaptureDescription + if eventhub.CaptureDescription != nil { + var captureDescription v20240101s.CaptureDescription_STATUS + err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription_STATUS(&captureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription_STATUS() to populate field CaptureDescription") + } + destination.CaptureDescription = &captureDescription + } else { + destination.CaptureDescription = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(eventhub.Conditions) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(eventhub.CreatedAt) + + // Id + destination.Id = genruntime.ClonePointerToString(eventhub.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(eventhub.Location) + + // MessageRetentionInDays + destination.MessageRetentionInDays = genruntime.ClonePointerToInt(eventhub.MessageRetentionInDays) + + // Name + destination.Name = genruntime.ClonePointerToString(eventhub.Name) + + // PartitionCount + destination.PartitionCount = genruntime.ClonePointerToInt(eventhub.PartitionCount) + + // PartitionIds + destination.PartitionIds = genruntime.CloneSliceOfString(eventhub.PartitionIds) + + // RetentionDescription + if propertyBag.Contains("RetentionDescription") { + var retentionDescription v20240101s.RetentionDescription_STATUS + err := propertyBag.Pull("RetentionDescription", &retentionDescription) + if err != nil { + return errors.Wrap(err, "pulling 'RetentionDescription' from propertyBag") + } + + destination.RetentionDescription = &retentionDescription + } else { + destination.RetentionDescription = nil } - return destination.ConvertStatusFrom(eventhub) + // Status + destination.Status = genruntime.ClonePointerToString(eventhub.Status) + + // SystemData + if eventhub.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := eventhub.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(eventhub.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(eventhub.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhub_STATUS interface (if implemented) to customize the conversion + var eventhubAsAny any = eventhub + if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_STATUS); ok { + err := augmentedEventhub.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Eventhub_Spec interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhub_Spec) error + AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhub_Spec) error +} + +type augmentConversionForNamespaces_Eventhub_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhub_STATUS) error + AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhub_STATUS) error } // Storage version of v1api20211101.CaptureDescription @@ -226,6 +707,130 @@ type CaptureDescription struct { SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` } +// AssignProperties_From_CaptureDescription populates our CaptureDescription from the provided source CaptureDescription +func (description *CaptureDescription) AssignProperties_From_CaptureDescription(source *v20240101s.CaptureDescription) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Destination + if source.Destination != nil { + var destination Destination + err := destination.AssignProperties_From_Destination(source.Destination) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Destination() to populate field Destination") + } + description.Destination = &destination + } else { + description.Destination = nil + } + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + description.Enabled = &enabled + } else { + description.Enabled = nil + } + + // Encoding + description.Encoding = genruntime.ClonePointerToString(source.Encoding) + + // IntervalInSeconds + description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) + + // SizeLimitInBytes + description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) + + // SkipEmptyArchives + if source.SkipEmptyArchives != nil { + skipEmptyArchive := *source.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchive + } else { + description.SkipEmptyArchives = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + description.PropertyBag = propertyBag + } else { + description.PropertyBag = nil + } + + // Invoke the augmentConversionForCaptureDescription interface (if implemented) to customize the conversion + var descriptionAsAny any = description + if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription); ok { + err := augmentedDescription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_CaptureDescription populates the provided destination CaptureDescription from our CaptureDescription +func (description *CaptureDescription) AssignProperties_To_CaptureDescription(destination *v20240101s.CaptureDescription) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(description.PropertyBag) + + // Destination + if description.Destination != nil { + var destinationLocal v20240101s.Destination + err := description.Destination.AssignProperties_To_Destination(&destinationLocal) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Destination() to populate field Destination") + } + destination.Destination = &destinationLocal + } else { + destination.Destination = nil + } + + // Enabled + if description.Enabled != nil { + enabled := *description.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Encoding + destination.Encoding = genruntime.ClonePointerToString(description.Encoding) + + // IntervalInSeconds + destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) + + // SizeLimitInBytes + destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) + + // SkipEmptyArchives + if description.SkipEmptyArchives != nil { + skipEmptyArchive := *description.SkipEmptyArchives + destination.SkipEmptyArchives = &skipEmptyArchive + } else { + destination.SkipEmptyArchives = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCaptureDescription interface (if implemented) to customize the conversion + var descriptionAsAny any = description + if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription); ok { + err := augmentedDescription.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.CaptureDescription_STATUS // Properties to configure capture description for eventhub type CaptureDescription_STATUS struct { @@ -238,6 +843,140 @@ type CaptureDescription_STATUS struct { SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` } +// AssignProperties_From_CaptureDescription_STATUS populates our CaptureDescription_STATUS from the provided source CaptureDescription_STATUS +func (description *CaptureDescription_STATUS) AssignProperties_From_CaptureDescription_STATUS(source *v20240101s.CaptureDescription_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Destination + if source.Destination != nil { + var destination Destination_STATUS + err := destination.AssignProperties_From_Destination_STATUS(source.Destination) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Destination_STATUS() to populate field Destination") + } + description.Destination = &destination + } else { + description.Destination = nil + } + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + description.Enabled = &enabled + } else { + description.Enabled = nil + } + + // Encoding + description.Encoding = genruntime.ClonePointerToString(source.Encoding) + + // IntervalInSeconds + description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) + + // SizeLimitInBytes + description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) + + // SkipEmptyArchives + if source.SkipEmptyArchives != nil { + skipEmptyArchive := *source.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchive + } else { + description.SkipEmptyArchives = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + description.PropertyBag = propertyBag + } else { + description.PropertyBag = nil + } + + // Invoke the augmentConversionForCaptureDescription_STATUS interface (if implemented) to customize the conversion + var descriptionAsAny any = description + if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription_STATUS); ok { + err := augmentedDescription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_CaptureDescription_STATUS populates the provided destination CaptureDescription_STATUS from our CaptureDescription_STATUS +func (description *CaptureDescription_STATUS) AssignProperties_To_CaptureDescription_STATUS(destination *v20240101s.CaptureDescription_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(description.PropertyBag) + + // Destination + if description.Destination != nil { + var destinationLocal v20240101s.Destination_STATUS + err := description.Destination.AssignProperties_To_Destination_STATUS(&destinationLocal) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Destination_STATUS() to populate field Destination") + } + destination.Destination = &destinationLocal + } else { + destination.Destination = nil + } + + // Enabled + if description.Enabled != nil { + enabled := *description.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Encoding + destination.Encoding = genruntime.ClonePointerToString(description.Encoding) + + // IntervalInSeconds + destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) + + // SizeLimitInBytes + destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) + + // SkipEmptyArchives + if description.SkipEmptyArchives != nil { + skipEmptyArchive := *description.SkipEmptyArchives + destination.SkipEmptyArchives = &skipEmptyArchive + } else { + destination.SkipEmptyArchives = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCaptureDescription_STATUS interface (if implemented) to customize the conversion + var descriptionAsAny any = description + if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription_STATUS); ok { + err := augmentedDescription.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForCaptureDescription interface { + AssignPropertiesFrom(src *v20240101s.CaptureDescription) error + AssignPropertiesTo(dst *v20240101s.CaptureDescription) error +} + +type augmentConversionForCaptureDescription_STATUS interface { + AssignPropertiesFrom(src *v20240101s.CaptureDescription_STATUS) error + AssignPropertiesTo(dst *v20240101s.CaptureDescription_STATUS) error +} + // Storage version of v1api20211101.Destination // Capture storage details for capture description type Destination struct { @@ -253,6 +992,128 @@ type Destination struct { StorageAccountResourceReference *genruntime.ResourceReference `armReference:"StorageAccountResourceId" json:"storageAccountResourceReference,omitempty"` } +// AssignProperties_From_Destination populates our Destination from the provided source Destination +func (destination *Destination) AssignProperties_From_Destination(source *v20240101s.Destination) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ArchiveNameFormat + destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) + + // BlobContainer + destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) + + // DataLakeAccountName + destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) + + // DataLakeFolderPath + destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) + + // DataLakeSubscriptionId + destination.DataLakeSubscriptionId = genruntime.ClonePointerToString(source.DataLakeSubscriptionId) + + // Identity + if source.Identity != nil { + propertyBag.Add("Identity", *source.Identity) + } else { + propertyBag.Remove("Identity") + } + + // Name + destination.Name = genruntime.ClonePointerToString(source.Name) + + // StorageAccountResourceReference + if source.StorageAccountResourceReference != nil { + storageAccountResourceReference := source.StorageAccountResourceReference.Copy() + destination.StorageAccountResourceReference = &storageAccountResourceReference + } else { + destination.StorageAccountResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForDestination interface (if implemented) to customize the conversion + var destinationAsAny any = destination + if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination); ok { + err := augmentedDestination.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Destination populates the provided destination Destination from our Destination +func (destination *Destination) AssignProperties_To_Destination(target *v20240101s.Destination) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(destination.PropertyBag) + + // ArchiveNameFormat + target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) + + // BlobContainer + target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) + + // DataLakeAccountName + target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) + + // DataLakeFolderPath + target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) + + // DataLakeSubscriptionId + target.DataLakeSubscriptionId = genruntime.ClonePointerToString(destination.DataLakeSubscriptionId) + + // Identity + if propertyBag.Contains("Identity") { + var identity v20240101s.CaptureIdentity + err := propertyBag.Pull("Identity", &identity) + if err != nil { + return errors.Wrap(err, "pulling 'Identity' from propertyBag") + } + + target.Identity = &identity + } else { + target.Identity = nil + } + + // Name + target.Name = genruntime.ClonePointerToString(destination.Name) + + // StorageAccountResourceReference + if destination.StorageAccountResourceReference != nil { + storageAccountResourceReference := destination.StorageAccountResourceReference.Copy() + target.StorageAccountResourceReference = &storageAccountResourceReference + } else { + target.StorageAccountResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + target.PropertyBag = propertyBag + } else { + target.PropertyBag = nil + } + + // Invoke the augmentConversionForDestination interface (if implemented) to customize the conversion + var destinationAsAny any = destination + if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination); ok { + err := augmentedDestination.AssignPropertiesTo(target) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.Destination_STATUS // Capture storage details for capture description type Destination_STATUS struct { @@ -266,6 +1127,128 @@ type Destination_STATUS struct { StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` } +// AssignProperties_From_Destination_STATUS populates our Destination_STATUS from the provided source Destination_STATUS +func (destination *Destination_STATUS) AssignProperties_From_Destination_STATUS(source *v20240101s.Destination_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ArchiveNameFormat + destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) + + // BlobContainer + destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) + + // DataLakeAccountName + destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) + + // DataLakeFolderPath + destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) + + // DataLakeSubscriptionId + destination.DataLakeSubscriptionId = genruntime.ClonePointerToString(source.DataLakeSubscriptionId) + + // Identity + if source.Identity != nil { + propertyBag.Add("Identity", *source.Identity) + } else { + propertyBag.Remove("Identity") + } + + // Name + destination.Name = genruntime.ClonePointerToString(source.Name) + + // StorageAccountResourceId + destination.StorageAccountResourceId = genruntime.ClonePointerToString(source.StorageAccountResourceId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForDestination_STATUS interface (if implemented) to customize the conversion + var destinationAsAny any = destination + if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination_STATUS); ok { + err := augmentedDestination.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Destination_STATUS populates the provided destination Destination_STATUS from our Destination_STATUS +func (destination *Destination_STATUS) AssignProperties_To_Destination_STATUS(target *v20240101s.Destination_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(destination.PropertyBag) + + // ArchiveNameFormat + target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) + + // BlobContainer + target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) + + // DataLakeAccountName + target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) + + // DataLakeFolderPath + target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) + + // DataLakeSubscriptionId + target.DataLakeSubscriptionId = genruntime.ClonePointerToString(destination.DataLakeSubscriptionId) + + // Identity + if propertyBag.Contains("Identity") { + var identity v20240101s.CaptureIdentity_STATUS + err := propertyBag.Pull("Identity", &identity) + if err != nil { + return errors.Wrap(err, "pulling 'Identity' from propertyBag") + } + + target.Identity = &identity + } else { + target.Identity = nil + } + + // Name + target.Name = genruntime.ClonePointerToString(destination.Name) + + // StorageAccountResourceId + target.StorageAccountResourceId = genruntime.ClonePointerToString(destination.StorageAccountResourceId) + + // Update the property bag + if len(propertyBag) > 0 { + target.PropertyBag = propertyBag + } else { + target.PropertyBag = nil + } + + // Invoke the augmentConversionForDestination_STATUS interface (if implemented) to customize the conversion + var destinationAsAny any = destination + if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination_STATUS); ok { + err := augmentedDestination.AssignPropertiesTo(target) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForDestination interface { + AssignPropertiesFrom(src *v20240101s.Destination) error + AssignPropertiesTo(dst *v20240101s.Destination) error +} + +type augmentConversionForDestination_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Destination_STATUS) error + AssignPropertiesTo(dst *v20240101s.Destination_STATUS) error +} + func init() { SchemeBuilder.Register(&NamespacesEventhub{}, &NamespacesEventhubList{}) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go index 34b01957fe3..b7b32e33b13 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_NamespacesEventhub_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhub to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesEventhub, NamespacesEventhubGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesEventhub(subject NamespacesEventhub) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesEventhub + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesEventhub + 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_NamespacesEventhub_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhub to NamespacesEventhub via AssignProperties_To_NamespacesEventhub & AssignProperties_From_NamespacesEventhub returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhub, NamespacesEventhubGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhub(subject NamespacesEventhub) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhub + err := copied.AssignProperties_To_NamespacesEventhub(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhub + err = actual.AssignProperties_From_NamespacesEventhub(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesEventhub_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -78,6 +164,48 @@ func AddRelatedPropertyGeneratorsForNamespacesEventhub(gens map[string]gopter.Ge gens["Status"] = Namespaces_Eventhub_STATUSGenerator() } +func Test_Namespaces_Eventhub_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhub_Spec to Namespaces_Eventhub_Spec via AssignProperties_To_Namespaces_Eventhub_Spec & AssignProperties_From_Namespaces_Eventhub_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhub_Spec tests if a specific instance of Namespaces_Eventhub_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_Spec + err := copied.AssignProperties_To_Namespaces_Eventhub_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhub_Spec + err = actual.AssignProperties_From_Namespaces_Eventhub_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_Eventhub_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -156,6 +284,48 @@ func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gop gens["CaptureDescription"] = gen.PtrOf(CaptureDescriptionGenerator()) } +func Test_Namespaces_Eventhub_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhub_STATUS to Namespaces_Eventhub_STATUS via AssignProperties_To_Namespaces_Eventhub_STATUS & AssignProperties_From_Namespaces_Eventhub_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS tests if a specific instance of Namespaces_Eventhub_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_STATUS + err := copied.AssignProperties_To_Namespaces_Eventhub_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhub_STATUS + err = actual.AssignProperties_From_Namespaces_Eventhub_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_Eventhub_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -241,6 +411,48 @@ func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]g gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_CaptureDescription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CaptureDescription to CaptureDescription via AssignProperties_To_CaptureDescription & AssignProperties_From_CaptureDescription returns original", + prop.ForAll(RunPropertyAssignmentTestForCaptureDescription, CaptureDescriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCaptureDescription tests if a specific instance of CaptureDescription can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCaptureDescription(subject CaptureDescription) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.CaptureDescription + err := copied.AssignProperties_To_CaptureDescription(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CaptureDescription + err = actual.AssignProperties_From_CaptureDescription(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_CaptureDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -319,6 +531,48 @@ func AddRelatedPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Ge gens["Destination"] = gen.PtrOf(DestinationGenerator()) } +func Test_CaptureDescription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CaptureDescription_STATUS to CaptureDescription_STATUS via AssignProperties_To_CaptureDescription_STATUS & AssignProperties_From_CaptureDescription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCaptureDescription_STATUS tests if a specific instance of CaptureDescription_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCaptureDescription_STATUS(subject CaptureDescription_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 v20240101s.CaptureDescription_STATUS + err := copied.AssignProperties_To_CaptureDescription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CaptureDescription_STATUS + err = actual.AssignProperties_From_CaptureDescription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_CaptureDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -398,6 +652,48 @@ func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]go gens["Destination"] = gen.PtrOf(Destination_STATUSGenerator()) } +func Test_Destination_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Destination to Destination via AssignProperties_To_Destination & AssignProperties_From_Destination returns original", + prop.ForAll(RunPropertyAssignmentTestForDestination, DestinationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDestination tests if a specific instance of Destination can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDestination(subject Destination) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Destination + err := copied.AssignProperties_To_Destination(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Destination + err = actual.AssignProperties_From_Destination(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Destination_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -463,6 +759,48 @@ func AddIndependentPropertyGeneratorsForDestination(gens map[string]gopter.Gen) gens["Name"] = gen.PtrOf(gen.AlphaString()) } +func Test_Destination_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Destination_STATUS to Destination_STATUS via AssignProperties_To_Destination_STATUS & AssignProperties_From_Destination_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForDestination_STATUS, Destination_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDestination_STATUS tests if a specific instance of Destination_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDestination_STATUS(subject Destination_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 v20240101s.Destination_STATUS + err := copied.AssignProperties_To_Destination_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Destination_STATUS + err = actual.AssignProperties_From_Destination_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Destination_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go index 94f3104308f..00c0cd79cc0 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go @@ -4,19 +4,18 @@ package storage import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsauthorizationrules/status,namespaceseventhubsauthorizationrules/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" @@ -44,6 +43,28 @@ func (rule *NamespacesEventhubsAuthorizationRule) SetConditions(conditions condi rule.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesEventhubsAuthorizationRule{} + +// ConvertFrom populates our NamespacesEventhubsAuthorizationRule from the provided hub NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(source) +} + +// ConvertTo populates the provided hub NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination) +} + var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -115,8 +136,75 @@ func (rule *NamespacesEventhubsAuthorizationRule) SetStatus(status genruntime.Co return nil } -// Hub marks that this NamespacesEventhubsAuthorizationRule is the hub type for conversion -func (rule *NamespacesEventhubsAuthorizationRule) Hub() {} +// AssignProperties_From_NamespacesEventhubsAuthorizationRule populates our NamespacesEventhubsAuthorizationRule from the provided source NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_From_NamespacesEventhubsAuthorizationRule(source *v20240101s.NamespacesEventhubsAuthorizationRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Eventhubs_AuthorizationRule_Spec + err := spec.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_Eventhubs_AuthorizationRule_STATUS + err = status.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") + } + rule.Status = status + + // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRule); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRule populates the provided destination NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination *v20240101s.NamespacesEventhubsAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRule); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (rule *NamespacesEventhubsAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { @@ -138,12 +226,18 @@ type NamespacesEventhubsAuthorizationRuleList struct { Items []NamespacesEventhubsAuthorizationRule `json:"items"` } +type augmentConversionForNamespacesEventhubsAuthorizationRule interface { + AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsAuthorizationRule) error + AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsAuthorizationRule) error +} + // Storage version of v1api20211101.Namespaces_Eventhubs_AuthorizationRule_Spec type Namespaces_Eventhubs_AuthorizationRule_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"` - OriginalVersion string `json:"originalVersion,omitempty"` + AzureName string `json:"azureName,omitempty"` + OperatorSpec *NamespacesEventhubsAuthorizationRuleOperatorSpec `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 @@ -158,20 +252,158 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec{ // ConvertSpecFrom populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) } - return source.ConvertSpecTo(rule) + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_Spec func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(dst) } - return destination.ConvertSpecFrom(rule) + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} + err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(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 +} + +// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_Spec +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AzureName + rule.AzureName = source.AzureName + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesEventhubsAuthorizationRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + + // OriginalVersion + rule.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // Rights + rule.Rights = genruntime.CloneSliceOfString(source.Rights) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec populates the provided destination Namespaces_Eventhubs_AuthorizationRule_Spec from our Namespaces_Eventhubs_AuthorizationRule_Spec +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // AzureName + destination.AzureName = rule.AzureName + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Rights + destination.Rights = genruntime.CloneSliceOfString(rule.Rights) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.Namespaces_Eventhubs_AuthorizationRule_STATUS @@ -190,20 +422,384 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_AuthorizationRule_STA // ConvertStatusFrom populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(rule) + return nil } // ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_STATUS func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} + err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") } - return destination.ConvertStatusFrom(rule) + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // Rights + rule.Rights = genruntime.CloneSliceOfString(source.Rights) + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + rule.SystemData = &systemDatum + } else { + rule.SystemData = nil + } + + // Type + rule.Type = genruntime.ClonePointerToString(source.Type) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS populates the provided destination Namespaces_Eventhubs_AuthorizationRule_STATUS from our Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // Rights + destination.Rights = genruntime.CloneSliceOfString(rule.Rights) + + // SystemData + if rule.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error + AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error +} + +type augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error + AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error +} + +// Storage version of v1api20211101.NamespacesEventhubsAuthorizationRuleOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesEventhubsAuthorizationRuleOperatorSpec struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec populates our NamespacesEventhubsAuthorizationRuleOperatorSpec from the provided source NamespacesEventhubsAuthorizationRuleOperatorSpec +func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Secrets + if source.Secrets != nil { + var secret NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSpec from our NamespacesEventhubsAuthorizationRuleOperatorSpec +func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // Secrets + if operator.Secrets != nil { + var secret v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + destination.Secrets = &secret + } else { + destination.Secrets = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec interface { + AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error + AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error +} + +// Storage version of v1api20211101.NamespacesEventhubsAuthorizationRuleOperatorSecrets +type NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates our NamespacesEventhubsAuthorizationRuleOperatorSecrets from the provided source NamespacesEventhubsAuthorizationRuleOperatorSecrets +func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + secrets.PropertyBag = propertyBag + } else { + secrets.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSecrets from our NamespacesEventhubsAuthorizationRuleOperatorSecrets +func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion + var secretsAsAny any = secrets + if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets); ok { + err := augmentedSecrets.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets interface { + AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error + AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error } func init() { diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go index 4b7b16dd4f1..28adc9fafdb 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_NamespacesEventhubsAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesEventhubsAuthorizationRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesEventhubsAuthorizationRule + 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_NamespacesEventhubsAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRule to NamespacesEventhubsAuthorizationRule via AssignProperties_To_NamespacesEventhubsAuthorizationRule & AssignProperties_From_NamespacesEventhubsAuthorizationRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsAuthorizationRule + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRule + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesEventhubsAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -79,6 +165,48 @@ func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(gens ma gens["Status"] = Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() } +func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_AuthorizationRule_Spec to Namespaces_Eventhubs_AuthorizationRule_Spec via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec + err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_AuthorizationRule_Spec + err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -123,6 +251,9 @@ func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subj var namespaces_Eventhubs_AuthorizationRule_SpecGenerator gopter.Gen // Namespaces_Eventhubs_AuthorizationRule_SpecGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { if namespaces_Eventhubs_AuthorizationRule_SpecGenerator != nil { return namespaces_Eventhubs_AuthorizationRule_SpecGenerator @@ -132,6 +263,12 @@ func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + return namespaces_Eventhubs_AuthorizationRule_SpecGenerator } @@ -142,6 +279,53 @@ func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_S gens["Rights"] = gen.SliceOf(gen.AlphaString()) } +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator()) +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_AuthorizationRule_STATUS to Namespaces_Eventhubs_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS + err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_AuthorizationRule_STATUS + err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -220,3 +404,203 @@ func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_S func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSpec to NamespacesEventhubsAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(generators) + namespacesEventhubsAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSpec{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSecrets to NamespacesEventhubsAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated +// by NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go index edc32df3c0f..21b95792015 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go @@ -4,19 +4,18 @@ package storage import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsconsumergroups/status,namespaceseventhubsconsumergroups/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" @@ -44,6 +43,28 @@ func (group *NamespacesEventhubsConsumerGroup) SetConditions(conditions conditio group.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesEventhubsConsumerGroup{} + +// ConvertFrom populates our NamespacesEventhubsConsumerGroup from the provided hub NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) + } + + return group.AssignProperties_From_NamespacesEventhubsConsumerGroup(source) +} + +// ConvertTo populates the provided hub NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) + } + + return group.AssignProperties_To_NamespacesEventhubsConsumerGroup(destination) +} + var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} // AzureName returns the Azure name of the resource @@ -115,8 +136,75 @@ func (group *NamespacesEventhubsConsumerGroup) SetStatus(status genruntime.Conve return nil } -// Hub marks that this NamespacesEventhubsConsumerGroup is the hub type for conversion -func (group *NamespacesEventhubsConsumerGroup) Hub() {} +// AssignProperties_From_NamespacesEventhubsConsumerGroup populates our NamespacesEventhubsConsumerGroup from the provided source NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) AssignProperties_From_NamespacesEventhubsConsumerGroup(source *v20240101s.NamespacesEventhubsConsumerGroup) error { + + // ObjectMeta + group.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Eventhubs_Consumergroup_Spec + err := spec.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") + } + group.Spec = spec + + // Status + var status Namespaces_Eventhubs_Consumergroup_STATUS + err = status.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") + } + group.Status = status + + // Invoke the augmentConversionForNamespacesEventhubsConsumerGroup interface (if implemented) to customize the conversion + var groupAsAny any = group + if augmentedGroup, ok := groupAsAny.(augmentConversionForNamespacesEventhubsConsumerGroup); ok { + err := augmentedGroup.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsConsumerGroup populates the provided destination NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) AssignProperties_To_NamespacesEventhubsConsumerGroup(destination *v20240101s.NamespacesEventhubsConsumerGroup) error { + + // ObjectMeta + destination.ObjectMeta = *group.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_Eventhubs_Consumergroup_Spec + err := group.Spec.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS + err = group.Status.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesEventhubsConsumerGroup interface (if implemented) to customize the conversion + var groupAsAny any = group + if augmentedGroup, ok := groupAsAny.(augmentConversionForNamespacesEventhubsConsumerGroup); ok { + err := augmentedGroup.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (group *NamespacesEventhubsConsumerGroup) OriginalGVK() *schema.GroupVersionKind { @@ -138,6 +226,11 @@ type NamespacesEventhubsConsumerGroupList struct { Items []NamespacesEventhubsConsumerGroup `json:"items"` } +type augmentConversionForNamespacesEventhubsConsumerGroup interface { + AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsConsumerGroup) error + AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsConsumerGroup) error +} + // Storage version of v1api20211101.Namespaces_Eventhubs_Consumergroup_Spec type Namespaces_Eventhubs_Consumergroup_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 @@ -158,20 +251,134 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_Consumergroup_Spec{} // ConvertSpecFrom populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) + if ok { + // Populate our instance from source + return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(consumergroup) + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_Spec func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) + if ok { + // Populate destination from our instance + return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} + err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(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 +} + +// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_Spec +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(source *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AzureName + consumergroup.AzureName = source.AzureName + + // OriginalVersion + consumergroup.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + consumergroup.Owner = &owner + } else { + consumergroup.Owner = nil + } + + // UserMetadata + consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) + + // Update the property bag + if len(propertyBag) > 0 { + consumergroup.PropertyBag = propertyBag + } else { + consumergroup.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec interface (if implemented) to customize the conversion + var consumergroupAsAny any = consumergroup + if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec); ok { + err := augmentedConsumergroup.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } } - return destination.ConvertSpecFrom(consumergroup) + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec populates the provided destination Namespaces_Eventhubs_Consumergroup_Spec from our Namespaces_Eventhubs_Consumergroup_Spec +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(consumergroup.PropertyBag) + + // AzureName + destination.AzureName = consumergroup.AzureName + + // OriginalVersion + destination.OriginalVersion = consumergroup.OriginalVersion + + // Owner + if consumergroup.Owner != nil { + owner := consumergroup.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // UserMetadata + destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec interface (if implemented) to customize the conversion + var consumergroupAsAny any = consumergroup + if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec); ok { + err := augmentedConsumergroup.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.Namespaces_Eventhubs_Consumergroup_STATUS @@ -192,20 +399,182 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_Consumergroup_STATUS{ // ConvertStatusFrom populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) + if ok { + // Populate our instance from source + return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(consumergroup) + return nil } // ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_STATUS func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) + if ok { + // Populate destination from our instance + return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} + err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(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 +} + +// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Conditions + consumergroup.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedAt + consumergroup.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // Id + consumergroup.Id = genruntime.ClonePointerToString(source.Id) + + // Location + consumergroup.Location = genruntime.ClonePointerToString(source.Location) + + // Name + consumergroup.Name = genruntime.ClonePointerToString(source.Name) + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + consumergroup.SystemData = &systemDatum + } else { + consumergroup.SystemData = nil + } + + // Type + consumergroup.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + consumergroup.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // UserMetadata + consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) + + // Update the property bag + if len(propertyBag) > 0 { + consumergroup.PropertyBag = propertyBag + } else { + consumergroup.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS interface (if implemented) to customize the conversion + var consumergroupAsAny any = consumergroup + if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS); ok { + err := augmentedConsumergroup.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS populates the provided destination Namespaces_Eventhubs_Consumergroup_STATUS from our Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(consumergroup.PropertyBag) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(consumergroup.Conditions) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(consumergroup.CreatedAt) + + // Id + destination.Id = genruntime.ClonePointerToString(consumergroup.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(consumergroup.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(consumergroup.Name) + + // SystemData + if consumergroup.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := consumergroup.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(consumergroup.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(consumergroup.UpdatedAt) + + // UserMetadata + destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS interface (if implemented) to customize the conversion + var consumergroupAsAny any = consumergroup + if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS); ok { + err := augmentedConsumergroup.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } } - return destination.ConvertStatusFrom(consumergroup) + // No error + return nil +} + +type augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error + AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error +} + +type augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS interface { + AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error + AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error } func init() { diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go index bd224b18b28..90e5b2d08f9 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_NamespacesEventhubsConsumerGroup_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsConsumerGroup to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesEventhubsConsumerGroup + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesEventhubsConsumerGroup + 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_NamespacesEventhubsConsumerGroup_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsConsumerGroup to NamespacesEventhubsConsumerGroup via AssignProperties_To_NamespacesEventhubsConsumerGroup & AssignProperties_From_NamespacesEventhubsConsumerGroup returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsConsumerGroup + err := copied.AssignProperties_To_NamespacesEventhubsConsumerGroup(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsConsumerGroup + err = actual.AssignProperties_From_NamespacesEventhubsConsumerGroup(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesEventhubsConsumerGroup_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -79,6 +165,48 @@ func AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(gens map[st gens["Status"] = Namespaces_Eventhubs_Consumergroup_STATUSGenerator() } +func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_Consumergroup_Spec to Namespaces_Eventhubs_Consumergroup_Spec via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec tests if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_Spec + err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_Consumergroup_Spec + err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -142,6 +270,48 @@ func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec( gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) } +func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_Consumergroup_STATUS to Namespaces_Eventhubs_Consumergroup_STATUS via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS tests if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS + err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_Consumergroup_STATUS + err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/structure.txt b/v2/api/eventhub/v1api20211101/storage/structure.txt index d8ba202909d..1f604640e5a 100644 --- a/v2/api/eventhub/v1api20211101/storage/structure.txt +++ b/v2/api/eventhub/v1api20211101/storage/structure.txt @@ -4,7 +4,7 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage │ └── "2021-11-01" ├── Namespace: Resource │ ├── Owner: resources/v1apiv20191001.ResourceGroup -│ ├── Spec: Object (16 properties) +│ ├── Spec: Object (17 properties) │ │ ├── AlternateName: *string │ │ ├── AzureName: string │ │ ├── ClusterArmReference: *genruntime.ResourceReference @@ -31,6 +31,14 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage │ │ ├── KafkaEnabled: *bool │ │ ├── Location: *string │ │ ├── MaximumThroughputUnits: *int +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── OriginalVersion: string │ │ ├── Owner: *genruntime.KnownResourceReference │ │ ├── PropertyBag: genruntime.PropertyBag @@ -101,8 +109,16 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage │ └── ZoneRedundant: *bool ├── NamespacesAuthorizationRule: Resource │ ├── Owner: eventhub/v1api20211101.Namespace -│ ├── Spec: Object (5 properties) +│ ├── Spec: Object (6 properties) │ │ ├── AzureName: string +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── OriginalVersion: string │ │ ├── Owner: *genruntime.KnownResourceReference │ │ ├── PropertyBag: genruntime.PropertyBag @@ -187,8 +203,16 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage │ └── UpdatedAt: *string ├── NamespacesEventhubsAuthorizationRule: Resource │ ├── Owner: eventhub/v1api20211101.NamespacesEventhub -│ ├── Spec: Object (5 properties) +│ ├── Spec: Object (6 properties) │ │ ├── AzureName: string +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── OriginalVersion: string │ │ ├── Owner: *genruntime.KnownResourceReference │ │ ├── PropertyBag: genruntime.PropertyBag @@ -209,29 +233,68 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage │ │ ├── LastModifiedByType: *string │ │ └── PropertyBag: genruntime.PropertyBag │ └── Type: *string -└── NamespacesEventhubsConsumerGroup: Resource - ├── Owner: eventhub/v1api20211101.NamespacesEventhub - ├── Spec: Object (5 properties) - │ ├── AzureName: string - │ ├── OriginalVersion: string - │ ├── Owner: *genruntime.KnownResourceReference - │ ├── PropertyBag: genruntime.PropertyBag - │ └── UserMetadata: *string - └── Status: Object (10 properties) - ├── Conditions: conditions.Condition[] - ├── CreatedAt: *string - ├── Id: *string - ├── Location: *string - ├── Name: *string - ├── PropertyBag: genruntime.PropertyBag - ├── SystemData: *Object (7 properties) - │ ├── CreatedAt: *string - │ ├── CreatedBy: *string - │ ├── CreatedByType: *string - │ ├── LastModifiedAt: *string - │ ├── LastModifiedBy: *string - │ ├── LastModifiedByType: *string - │ └── PropertyBag: genruntime.PropertyBag - ├── Type: *string - ├── UpdatedAt: *string - └── UserMetadata: *string +├── NamespacesEventhubsConsumerGroup: Resource +│ ├── Owner: eventhub/v1api20211101.NamespacesEventhub +│ ├── Spec: Object (5 properties) +│ │ ├── AzureName: string +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── UserMetadata: *string +│ └── Status: Object (10 properties) +│ ├── Conditions: conditions.Condition[] +│ ├── CreatedAt: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Type: *string +│ ├── UpdatedAt: *string +│ └── UserMetadata: *string +├── augmentConversionForCaptureDescription: Interface +├── augmentConversionForCaptureDescription_STATUS: Interface +├── augmentConversionForDestination: Interface +├── augmentConversionForDestination_STATUS: Interface +├── augmentConversionForEncryption: Interface +├── augmentConversionForEncryption_STATUS: Interface +├── augmentConversionForIdentity: Interface +├── augmentConversionForIdentity_STATUS: Interface +├── augmentConversionForKeyVaultProperties: Interface +├── augmentConversionForKeyVaultProperties_STATUS: Interface +├── augmentConversionForNamespace: Interface +├── augmentConversionForNamespaceOperatorSecrets: Interface +├── augmentConversionForNamespaceOperatorSpec: Interface +├── augmentConversionForNamespace_STATUS: Interface +├── augmentConversionForNamespace_Spec: Interface +├── augmentConversionForNamespacesAuthorizationRule: Interface +├── augmentConversionForNamespacesAuthorizationRuleOperatorSecrets: Interface +├── augmentConversionForNamespacesAuthorizationRuleOperatorSpec: Interface +├── augmentConversionForNamespacesEventhub: Interface +├── augmentConversionForNamespacesEventhubsAuthorizationRule: Interface +├── augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets: Interface +├── augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec: Interface +├── augmentConversionForNamespacesEventhubsConsumerGroup: Interface +├── augmentConversionForNamespaces_AuthorizationRule_STATUS: Interface +├── augmentConversionForNamespaces_AuthorizationRule_Spec: Interface +├── augmentConversionForNamespaces_Eventhub_STATUS: Interface +├── augmentConversionForNamespaces_Eventhub_Spec: Interface +├── augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS: Interface +├── augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec: Interface +├── augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS: Interface +├── augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec: Interface +├── augmentConversionForPrivateEndpointConnection_STATUS: Interface +├── augmentConversionForSku: Interface +├── augmentConversionForSku_STATUS: Interface +├── augmentConversionForSystemData_STATUS: Interface +├── augmentConversionForUserAssignedIdentityDetails: Interface +├── augmentConversionForUserAssignedIdentityProperties: Interface +├── augmentConversionForUserAssignedIdentityProperties_STATUS: Interface +└── augmentConversionForUserAssignedIdentity_STATUS: Interface diff --git a/v2/api/eventhub/v1api20211101/storage/zz_generated.deepcopy.go b/v2/api/eventhub/v1api20211101/storage/zz_generated.deepcopy.go index be6cb28098d..a4a0257b79a 100644 --- a/v2/api/eventhub/v1api20211101/storage/zz_generated.deepcopy.go +++ b/v2/api/eventhub/v1api20211101/storage/zz_generated.deepcopy.go @@ -532,6 +532,75 @@ func (in *NamespaceList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceOperatorSecrets) DeepCopyInto(out *NamespaceOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *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.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSecrets. +func (in *NamespaceOperatorSecrets) DeepCopy() *NamespaceOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespaceOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceOperatorSpec) DeepCopyInto(out *NamespaceOperatorSpec) { + *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(NamespaceOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSpec. +func (in *NamespaceOperatorSpec) DeepCopy() *NamespaceOperatorSpec { + if in == nil { + return nil + } + out := new(NamespaceOperatorSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Namespace_STATUS) DeepCopyInto(out *Namespace_STATUS) { *out = *in @@ -728,6 +797,11 @@ func (in *Namespace_Spec) DeepCopyInto(out *Namespace_Spec) { *out = new(int) **out = **in } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespaceOperatorSpec) + (*in).DeepCopyInto(*out) + } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) @@ -828,6 +902,75 @@ func (in *NamespacesAuthorizationRuleList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *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.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSecrets. +func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSpec) { + *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(NamespacesAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSpec. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamespacesEventhub) DeepCopyInto(out *NamespacesEventhub) { *out = *in @@ -946,6 +1089,75 @@ func (in *NamespacesEventhubsAuthorizationRuleList) DeepCopyObject() runtime.Obj return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *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.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSecrets. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSpec) { + *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(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSpec. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamespacesEventhubsConsumerGroup) DeepCopyInto(out *NamespacesEventhubsConsumerGroup) { *out = *in @@ -1067,6 +1279,11 @@ func (in *Namespaces_AuthorizationRule_STATUS) DeepCopy() *Namespaces_Authorizat // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Namespaces_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec) { *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) @@ -1289,6 +1506,11 @@ func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopy() *Namespaces_ // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec) { *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) diff --git a/v2/api/eventhub/v1api20211101/structure.txt b/v2/api/eventhub/v1api20211101/structure.txt index 079b46a9134..f935addab06 100644 --- a/v2/api/eventhub/v1api20211101/structure.txt +++ b/v2/api/eventhub/v1api20211101/structure.txt @@ -4,7 +4,7 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101 │ └── "2021-11-01" ├── Namespace: Resource │ ├── Owner: resources/v1apiv20191001.ResourceGroup -│ ├── Spec: Object (14 properties) +│ ├── Spec: Object (15 properties) │ │ ├── AlternateName: *string │ │ ├── AzureName: Validated (3 rules) │ │ │ ├── Rule 0: MaxLength: 50 @@ -34,6 +34,12 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101 │ │ ├── KafkaEnabled: *bool │ │ ├── Location: *string │ │ ├── MaximumThroughputUnits: *int +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (4 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── Owner: *genruntime.KnownResourceReference │ │ ├── Sku: *Object (3 properties) │ │ │ ├── Capacity: Validated<*int> (1 rule) @@ -225,9 +231,15 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101 │ └── Tags: map[string]string ├── NamespacesAuthorizationRule: Resource │ ├── Owner: Namespace -│ ├── Spec: Object (3 properties) +│ ├── Spec: Object (4 properties) │ │ ├── AzureName: Validated (1 rule) │ │ │ └── Rule 0: MinLength: 1 +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (4 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── Owner: *genruntime.KnownResourceReference │ │ └── Rights: Enum (3 values)[] │ │ ├── "Listen" @@ -340,9 +352,15 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101 │ └── UpdatedAt: *string ├── NamespacesEventhubsAuthorizationRule: Resource │ ├── Owner: NamespacesEventhub -│ ├── Spec: Object (3 properties) +│ ├── Spec: Object (4 properties) │ │ ├── AzureName: Validated (1 rule) │ │ │ └── Rule 0: MinLength: 1 +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (4 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination │ │ ├── Owner: *genruntime.KnownResourceReference │ │ └── Rights: Enum (3 values)[] │ │ ├── "Listen" diff --git a/v2/api/eventhub/v1api20211101/zz_generated.deepcopy.go b/v2/api/eventhub/v1api20211101/zz_generated.deepcopy.go index a0e64a52540..f30f910130a 100644 --- a/v2/api/eventhub/v1api20211101/zz_generated.deepcopy.go +++ b/v2/api/eventhub/v1api20211101/zz_generated.deepcopy.go @@ -888,6 +888,61 @@ func (in *NamespaceList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceOperatorSecrets) DeepCopyInto(out *NamespaceOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSecrets. +func (in *NamespaceOperatorSecrets) DeepCopy() *NamespaceOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespaceOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceOperatorSpec) DeepCopyInto(out *NamespaceOperatorSpec) { + *out = *in + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(NamespaceOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSpec. +func (in *NamespaceOperatorSpec) DeepCopy() *NamespaceOperatorSpec { + if in == nil { + return nil + } + out := new(NamespaceOperatorSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Namespace_Properties_STATUS_ARM) DeepCopyInto(out *Namespace_Properties_STATUS_ARM) { *out = *in @@ -1286,6 +1341,11 @@ func (in *Namespace_Spec) DeepCopyInto(out *Namespace_Spec) { *out = new(int) **out = **in } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespaceOperatorSpec) + (*in).DeepCopyInto(*out) + } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) @@ -1421,6 +1481,61 @@ func (in *NamespacesAuthorizationRuleList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSecrets. +func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSpec) { + *out = *in + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(NamespacesAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSpec. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamespacesEventhub) DeepCopyInto(out *NamespacesEventhub) { *out = *in @@ -1539,6 +1654,61 @@ func (in *NamespacesEventhubsAuthorizationRuleList) DeepCopyObject() runtime.Obj return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSecrets. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSpec) { + *out = *in + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSpec. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamespacesEventhubsConsumerGroup) DeepCopyInto(out *NamespacesEventhubsConsumerGroup) { *out = *in @@ -1738,6 +1908,11 @@ func (in *Namespaces_AuthorizationRule_STATUS_ARM) DeepCopy() *Namespaces_Author // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Namespaces_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec) { *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) @@ -2182,6 +2357,11 @@ func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) DeepCopy() *Namespa // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec) { *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(genruntime.KnownResourceReference) diff --git a/v2/api/eventhub/v1api20240101/doc.go b/v2/api/eventhub/v1api20240101/doc.go new file mode 100644 index 00000000000..fb79759ff2f --- /dev/null +++ b/v2/api/eventhub/v1api20240101/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 v1api20240101 contains API Schema definitions for the eventhub v1api20240101 API group +// +groupName=eventhub.azure.com +package v1api20240101 diff --git a/v2/api/eventhub/v1api20240101/groupversion_info_gen.go b/v2/api/eventhub/v1api20240101/groupversion_info_gen.go new file mode 100644 index 00000000000..6cddaea6954 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/groupversion_info_gen.go @@ -0,0 +1,32 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20240101 contains API Schema definitions for the eventhub v1api20240101 API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=eventhub.azure.com +// +versionName=v1api20240101 +package v1api20240101 + +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: "eventhub.azure.com", Version: "v1api20240101"} + + // 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/eventhub/v1api20240101/namespace_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen.go new file mode 100644 index 00000000000..b6f30694a50 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen.go @@ -0,0 +1,154 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespace_Spec_ARM struct { + // Identity: Properties of BYOK Identity description + Identity *Identity_ARM `json:"identity,omitempty"` + + // Location: Resource location. + Location *string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + + // Properties: Namespace properties supplied for create namespace operation. + Properties *Namespace_Properties_Spec_ARM `json:"properties,omitempty"` + + // Sku: Properties of sku resource + Sku *Sku_ARM `json:"sku,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespace_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (namespace Namespace_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (namespace *Namespace_Spec_ARM) GetName() string { + return namespace.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces" +func (namespace *Namespace_Spec_ARM) GetType() string { + return "Microsoft.EventHub/namespaces" +} + +// Properties to configure Identity for Bring your Own Keys +type Identity_ARM struct { + // Type: Type of managed service identity. + Type *Identity_Type `json:"type,omitempty"` + UserAssignedIdentities map[string]UserAssignedIdentityDetails_ARM `json:"userAssignedIdentities,omitempty"` +} + +type Namespace_Properties_Spec_ARM struct { + // AlternateName: Alternate name specified when alias and namespace names are same. + AlternateName *string `json:"alternateName,omitempty"` + ClusterArmId *string `json:"clusterArmId,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_ARM `json:"encryption,omitempty"` + + // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + + // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + + // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 + // throughput units. ( '0' if AutoInflateEnabled = true) + MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + + // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_Spec `json:"minimumTlsVersion,omitempty"` + + // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_Spec `json:"publicNetworkAccess,omitempty"` + + // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// SKU parameters supplied to the create namespace operation +type Sku_ARM struct { + // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. + // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *Sku_Name `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *Sku_Tier `json:"tier,omitempty"` +} + +// Properties to configure Encryption +type Encryption_ARM struct { + // KeySource: Enumerates the possible value of keySource for Encryption + KeySource *Encryption_KeySource `json:"keySource,omitempty"` + + // KeyVaultProperties: Properties of KeyVault + KeyVaultProperties []KeyVaultProperties_ARM `json:"keyVaultProperties,omitempty"` + + // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +// +kubebuilder:validation:Enum={"None","SystemAssigned","SystemAssigned, UserAssigned","UserAssigned"} +type Identity_Type string + +const ( + Identity_Type_None = Identity_Type("None") + Identity_Type_SystemAssigned = Identity_Type("SystemAssigned") + Identity_Type_SystemAssignedUserAssigned = Identity_Type("SystemAssigned, UserAssigned") + Identity_Type_UserAssigned = Identity_Type("UserAssigned") +) + +// +kubebuilder:validation:Enum={"Basic","Premium","Standard"} +type Sku_Name string + +const ( + Sku_Name_Basic = Sku_Name("Basic") + Sku_Name_Premium = Sku_Name("Premium") + Sku_Name_Standard = Sku_Name("Standard") +) + +// +kubebuilder:validation:Enum={"Basic","Premium","Standard"} +type Sku_Tier string + +const ( + Sku_Tier_Basic = Sku_Tier("Basic") + Sku_Tier_Premium = Sku_Tier("Premium") + Sku_Tier_Standard = Sku_Tier("Standard") +) + +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails_ARM struct { +} + +// Properties to configure keyVault Properties +type KeyVaultProperties_ARM struct { + Identity *UserAssignedIdentityProperties_ARM `json:"identity,omitempty"` + + // KeyName: Name of the Key from KeyVault + KeyName *string `json:"keyName,omitempty"` + + // KeyVaultUri: Uri of KeyVault + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + + // KeyVersion: Key Version + KeyVersion *string `json:"keyVersion,omitempty"` +} + +type UserAssignedIdentityProperties_ARM struct { + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..0ac5ea8e5c8 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go @@ -0,0 +1,587 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +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_Namespace_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_Spec_ARM, Namespace_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_Spec_ARM runs a test to see if a specific instance of Namespace_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_Spec_ARM(subject Namespace_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespace_Spec_ARM instances for property testing - lazily instantiated by Namespace_Spec_ARMGenerator() +var namespace_Spec_ARMGenerator gopter.Gen + +// Namespace_Spec_ARMGenerator returns a generator of Namespace_Spec_ARM instances for property testing. +// We first initialize namespace_Spec_ARMGenerator 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 Namespace_Spec_ARMGenerator() gopter.Gen { + if namespace_Spec_ARMGenerator != nil { + return namespace_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Spec_ARM(generators) + namespace_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespace_Spec_ARM(generators) + namespace_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec_ARM{}), generators) + + return namespace_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_Spec_ARM(gens map[string]gopter.Gen) { + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.AlphaString() + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespace_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_Spec_ARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(Identity_ARMGenerator()) + gens["Properties"] = gen.PtrOf(Namespace_Properties_Spec_ARMGenerator()) + gens["Sku"] = gen.PtrOf(Sku_ARMGenerator()) +} + +func Test_Identity_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_ARM, Identity_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_ARM runs a test to see if a specific instance of Identity_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_ARM(subject Identity_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by Identity_ARMGenerator() +var identity_ARMGenerator gopter.Gen + +// Identity_ARMGenerator returns a generator of Identity_ARM instances for property testing. +// We first initialize identity_ARMGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_ARMGenerator() gopter.Gen { + if identity_ARMGenerator != nil { + return identity_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_ARM(generators) + identity_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_ARM(generators) + AddRelatedPropertyGeneratorsForIdentity_ARM(generators) + identity_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_ARM{}), generators) + + return identity_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_ARM(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf( + Identity_Type_None, + Identity_Type_SystemAssigned, + Identity_Type_SystemAssignedUserAssigned, + Identity_Type_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity_ARM(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentityDetails_ARMGenerator()) +} + +func Test_Namespace_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_Properties_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_Properties_Spec_ARM, Namespace_Properties_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_Properties_Spec_ARM runs a test to see if a specific instance of Namespace_Properties_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_Properties_Spec_ARM(subject Namespace_Properties_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_Properties_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespace_Properties_Spec_ARM instances for property testing - lazily instantiated by +// Namespace_Properties_Spec_ARMGenerator() +var namespace_Properties_Spec_ARMGenerator gopter.Gen + +// Namespace_Properties_Spec_ARMGenerator returns a generator of Namespace_Properties_Spec_ARM instances for property testing. +// We first initialize namespace_Properties_Spec_ARMGenerator 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 Namespace_Properties_Spec_ARMGenerator() gopter.Gen { + if namespace_Properties_Spec_ARMGenerator != nil { + return namespace_Properties_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM(generators) + namespace_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespace_Properties_Spec_ARM(generators) + namespace_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_Spec_ARM{}), generators) + + return namespace_Properties_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) + gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) + gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_Spec_10, Namespace_Properties_MinimumTlsVersion_Spec_11, Namespace_Properties_MinimumTlsVersion_Spec_12)) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_Spec_Disabled, Namespace_Properties_PublicNetworkAccess_Spec_Enabled, Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter)) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespace_Properties_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_Properties_Spec_ARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_ARMGenerator()) +} + +func Test_Sku_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSku_ARM, Sku_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSku_ARM runs a test to see if a specific instance of Sku_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSku_ARM(subject Sku_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Sku_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by Sku_ARMGenerator() +var sku_ARMGenerator gopter.Gen + +// Sku_ARMGenerator returns a generator of Sku_ARM instances for property testing. +func Sku_ARMGenerator() gopter.Gen { + if sku_ARMGenerator != nil { + return sku_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSku_ARM(generators) + sku_ARMGenerator = gen.Struct(reflect.TypeOf(Sku_ARM{}), generators) + + return sku_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSku_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSku_ARM(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_Basic, Sku_Name_Premium, Sku_Name_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_Basic, Sku_Tier_Premium, Sku_Tier_Standard)) +} + +func Test_Encryption_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption_ARM, Encryption_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption_ARM runs a test to see if a specific instance of Encryption_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption_ARM(subject Encryption_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Encryption_ARM instances for property testing - lazily instantiated by Encryption_ARMGenerator() +var encryption_ARMGenerator gopter.Gen + +// Encryption_ARMGenerator returns a generator of Encryption_ARM instances for property testing. +// We first initialize encryption_ARMGenerator 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 Encryption_ARMGenerator() gopter.Gen { + if encryption_ARMGenerator != nil { + return encryption_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_ARM(generators) + encryption_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_ARM(generators) + AddRelatedPropertyGeneratorsForEncryption_ARM(generators) + encryption_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_ARM{}), generators) + + return encryption_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption_ARM(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_MicrosoftKeyVault)) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption_ARM(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_ARMGenerator()) +} + +func Test_UserAssignedIdentityDetails_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityDetails_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails_ARM, UserAssignedIdentityDetails_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityDetails_ARM runs a test to see if a specific instance of UserAssignedIdentityDetails_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityDetails_ARM(subject UserAssignedIdentityDetails_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityDetails_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityDetails_ARM instances for property testing - lazily instantiated by +// UserAssignedIdentityDetails_ARMGenerator() +var userAssignedIdentityDetails_ARMGenerator gopter.Gen + +// UserAssignedIdentityDetails_ARMGenerator returns a generator of UserAssignedIdentityDetails_ARM instances for property testing. +func UserAssignedIdentityDetails_ARMGenerator() gopter.Gen { + if userAssignedIdentityDetails_ARMGenerator != nil { + return userAssignedIdentityDetails_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityDetails_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails_ARM{}), generators) + + return userAssignedIdentityDetails_ARMGenerator +} + +func Test_KeyVaultProperties_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_ARM, KeyVaultProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultProperties_ARM runs a test to see if a specific instance of KeyVaultProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultProperties_ARM(subject KeyVaultProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by +// KeyVaultProperties_ARMGenerator() +var keyVaultProperties_ARMGenerator gopter.Gen + +// KeyVaultProperties_ARMGenerator returns a generator of KeyVaultProperties_ARM instances for property testing. +// We first initialize keyVaultProperties_ARMGenerator 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 KeyVaultProperties_ARMGenerator() gopter.Gen { + if keyVaultProperties_ARMGenerator != nil { + return keyVaultProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM(generators) + keyVaultProperties_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM(generators) + AddRelatedPropertyGeneratorsForKeyVaultProperties_ARM(generators) + keyVaultProperties_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_ARM{}), generators) + + return keyVaultProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM(gens map[string]gopter.Gen) { + gens["KeyName"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForKeyVaultProperties_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForKeyVaultProperties_ARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_ARMGenerator()) +} + +func Test_UserAssignedIdentityProperties_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_ARM, UserAssignedIdentityProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityProperties_ARM runs a test to see if a specific instance of UserAssignedIdentityProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityProperties_ARM(subject UserAssignedIdentityProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityProperties_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityProperties_ARM instances for property testing - lazily instantiated by +// UserAssignedIdentityProperties_ARMGenerator() +var userAssignedIdentityProperties_ARMGenerator gopter.Gen + +// UserAssignedIdentityProperties_ARMGenerator returns a generator of UserAssignedIdentityProperties_ARM instances for property testing. +func UserAssignedIdentityProperties_ARMGenerator() gopter.Gen { + if userAssignedIdentityProperties_ARMGenerator != nil { + return userAssignedIdentityProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_ARM(generators) + userAssignedIdentityProperties_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_ARM{}), generators) + + return userAssignedIdentityProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_ARM(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go new file mode 100644 index 00000000000..9e42ee542a5 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go @@ -0,0 +1,227 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +type Namespace_STATUS_ARM struct { + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Identity: Properties of BYOK Identity description + Identity *Identity_STATUS_ARM `json:"identity,omitempty"` + + // Location: Resource location. + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: Namespace properties supplied for create namespace operation. + Properties *Namespace_Properties_STATUS_ARM `json:"properties,omitempty"` + + // Sku: Properties of sku resource + Sku *Sku_STATUS_ARM `json:"sku,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// Properties to configure Identity for Bring your Own Keys +type Identity_STATUS_ARM struct { + // PrincipalId: ObjectId from the KeyVault + PrincipalId *string `json:"principalId,omitempty"` + + // TenantId: TenantId from the KeyVault + TenantId *string `json:"tenantId,omitempty"` + + // Type: Type of managed service identity. + Type *Identity_Type_STATUS `json:"type,omitempty"` + + // UserAssignedIdentities: Properties for User Assigned Identities + UserAssignedIdentities map[string]UserAssignedIdentity_STATUS_ARM `json:"userAssignedIdentities,omitempty"` +} + +type Namespace_Properties_STATUS_ARM struct { + // AlternateName: Alternate name specified when alias and namespace names are same. + AlternateName *string `json:"alternateName,omitempty"` + + // ClusterArmId: Cluster ARM ID of the Namespace. + ClusterArmId *string `json:"clusterArmId,omitempty"` + + // CreatedAt: The time the Namespace was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_STATUS_ARM `json:"encryption,omitempty"` + + // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + + // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + + // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 + // throughput units. ( '0' if AutoInflateEnabled = true) + MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + + // MetricId: Identifier for Azure Insights metrics. + MetricId *string `json:"metricId,omitempty"` + + // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_STATUS `json:"minimumTlsVersion,omitempty"` + + // PrivateEndpointConnections: List of private endpoint connections. + PrivateEndpointConnections []PrivateEndpointConnection_STATUS_ARM `json:"privateEndpointConnections,omitempty"` + + // ProvisioningState: Provisioning state of the Namespace. + ProvisioningState *string `json:"provisioningState,omitempty"` + + // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"` + + // ServiceBusEndpoint: Endpoint you can use to perform Service Bus operations. + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + + // Status: Status of the Namespace. + Status *string `json:"status,omitempty"` + + // UpdatedAt: The time the Namespace was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` + + // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// SKU parameters supplied to the create namespace operation +type Sku_STATUS_ARM struct { + // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. + // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *Sku_Name_STATUS `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *Sku_Tier_STATUS `json:"tier,omitempty"` +} + +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS_ARM struct { + // CreatedAt: The timestamp of resource creation (UTC). + CreatedAt *string `json:"createdAt,omitempty"` + + // CreatedBy: The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // CreatedByType: The type of identity that created the resource. + CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"` + + // LastModifiedAt: The type of identity that last modified the resource. + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + + // LastModifiedBy: The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // LastModifiedByType: The type of identity that last modified the resource. + LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"` +} + +// Properties to configure Encryption +type Encryption_STATUS_ARM struct { + // KeySource: Enumerates the possible value of keySource for Encryption + KeySource *Encryption_KeySource_STATUS `json:"keySource,omitempty"` + + // KeyVaultProperties: Properties of KeyVault + KeyVaultProperties []KeyVaultProperties_STATUS_ARM `json:"keyVaultProperties,omitempty"` + + // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +type Identity_Type_STATUS string + +const ( + Identity_Type_STATUS_None = Identity_Type_STATUS("None") + Identity_Type_STATUS_SystemAssigned = Identity_Type_STATUS("SystemAssigned") + Identity_Type_STATUS_SystemAssignedUserAssigned = Identity_Type_STATUS("SystemAssigned, UserAssigned") + Identity_Type_STATUS_UserAssigned = Identity_Type_STATUS("UserAssigned") +) + +// Properties of the PrivateEndpointConnection. +type PrivateEndpointConnection_STATUS_ARM struct { + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` +} + +type Sku_Name_STATUS string + +const ( + Sku_Name_STATUS_Basic = Sku_Name_STATUS("Basic") + Sku_Name_STATUS_Premium = Sku_Name_STATUS("Premium") + Sku_Name_STATUS_Standard = Sku_Name_STATUS("Standard") +) + +type Sku_Tier_STATUS string + +const ( + Sku_Tier_STATUS_Basic = Sku_Tier_STATUS("Basic") + Sku_Tier_STATUS_Premium = Sku_Tier_STATUS("Premium") + Sku_Tier_STATUS_Standard = Sku_Tier_STATUS("Standard") +) + +type SystemData_CreatedByType_STATUS string + +const ( + SystemData_CreatedByType_STATUS_Application = SystemData_CreatedByType_STATUS("Application") + SystemData_CreatedByType_STATUS_Key = SystemData_CreatedByType_STATUS("Key") + SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity") + SystemData_CreatedByType_STATUS_User = SystemData_CreatedByType_STATUS("User") +) + +type SystemData_LastModifiedByType_STATUS string + +const ( + SystemData_LastModifiedByType_STATUS_Application = SystemData_LastModifiedByType_STATUS("Application") + SystemData_LastModifiedByType_STATUS_Key = SystemData_LastModifiedByType_STATUS("Key") + SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity") + SystemData_LastModifiedByType_STATUS_User = SystemData_LastModifiedByType_STATUS("User") +) + +// Recognized Dictionary value. +type UserAssignedIdentity_STATUS_ARM struct { + // ClientId: Client Id of user assigned identity + ClientId *string `json:"clientId,omitempty"` + + // PrincipalId: Principal Id of user assigned identity + PrincipalId *string `json:"principalId,omitempty"` +} + +// Properties to configure keyVault Properties +type KeyVaultProperties_STATUS_ARM struct { + Identity *UserAssignedIdentityProperties_STATUS_ARM `json:"identity,omitempty"` + + // KeyName: Name of the Key from KeyVault + KeyName *string `json:"keyName,omitempty"` + + // KeyVaultUri: Uri of KeyVault + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + + // KeyVersion: Key Version + KeyVersion *string `json:"keyVersion,omitempty"` +} + +type UserAssignedIdentityProperties_STATUS_ARM struct { + // UserAssignedIdentity: ARM ID of user Identity selected for encryption + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen_test.go new file mode 100644 index 00000000000..500f66d8ace --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespace_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 v1api20240101 + +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_Namespace_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_STATUS_ARM, Namespace_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_STATUS_ARM runs a test to see if a specific instance of Namespace_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_STATUS_ARM(subject Namespace_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespace_STATUS_ARM instances for property testing - lazily instantiated by +// Namespace_STATUS_ARMGenerator() +var namespace_STATUS_ARMGenerator gopter.Gen + +// Namespace_STATUS_ARMGenerator returns a generator of Namespace_STATUS_ARM instances for property testing. +// We first initialize namespace_STATUS_ARMGenerator 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 Namespace_STATUS_ARMGenerator() gopter.Gen { + if namespace_STATUS_ARMGenerator != nil { + return namespace_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM(generators) + namespace_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespace_STATUS_ARM(generators) + namespace_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS_ARM{}), generators) + + return namespace_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM(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()) +} + +// AddRelatedPropertyGeneratorsForNamespace_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(Identity_STATUS_ARMGenerator()) + gens["Properties"] = gen.PtrOf(Namespace_Properties_STATUS_ARMGenerator()) + gens["Sku"] = gen.PtrOf(Sku_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_Identity_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_STATUS_ARM, Identity_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_STATUS_ARM runs a test to see if a specific instance of Identity_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_STATUS_ARM(subject Identity_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by +// Identity_STATUS_ARMGenerator() +var identity_STATUS_ARMGenerator gopter.Gen + +// Identity_STATUS_ARMGenerator returns a generator of Identity_STATUS_ARM instances for property testing. +// We first initialize identity_STATUS_ARMGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_STATUS_ARMGenerator() gopter.Gen { + if identity_STATUS_ARMGenerator != nil { + return identity_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM(generators) + identity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForIdentity_STATUS_ARM(generators) + identity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS_ARM{}), generators) + + return identity_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.OneConstOf( + Identity_Type_STATUS_None, + Identity_Type_STATUS_SystemAssigned, + Identity_Type_STATUS_SystemAssignedUserAssigned, + Identity_Type_STATUS_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity_STATUS_ARM(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUS_ARMGenerator()) +} + +func Test_Namespace_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_Properties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_Properties_STATUS_ARM, Namespace_Properties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_Properties_STATUS_ARM runs a test to see if a specific instance of Namespace_Properties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_Properties_STATUS_ARM(subject Namespace_Properties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_Properties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespace_Properties_STATUS_ARM instances for property testing - lazily instantiated by +// Namespace_Properties_STATUS_ARMGenerator() +var namespace_Properties_STATUS_ARMGenerator gopter.Gen + +// Namespace_Properties_STATUS_ARMGenerator returns a generator of Namespace_Properties_STATUS_ARM instances for property testing. +// We first initialize namespace_Properties_STATUS_ARMGenerator 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 Namespace_Properties_STATUS_ARMGenerator() gopter.Gen { + if namespace_Properties_STATUS_ARMGenerator != nil { + return namespace_Properties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM(generators) + namespace_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespace_Properties_STATUS_ARM(generators) + namespace_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_STATUS_ARM{}), generators) + + return namespace_Properties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) + gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) + gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_STATUS_10, Namespace_Properties_MinimumTlsVersion_STATUS_11, Namespace_Properties_MinimumTlsVersion_STATUS_12)) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_STATUS_Disabled, Namespace_Properties_PublicNetworkAccess_STATUS_Enabled, Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter)) + gens["ServiceBusEndpoint"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespace_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_STATUS_ARMGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUS_ARMGenerator()) +} + +func Test_Sku_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSku_STATUS_ARM, Sku_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSku_STATUS_ARM runs a test to see if a specific instance of Sku_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSku_STATUS_ARM(subject Sku_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Sku_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by Sku_STATUS_ARMGenerator() +var sku_STATUS_ARMGenerator gopter.Gen + +// Sku_STATUS_ARMGenerator returns a generator of Sku_STATUS_ARM instances for property testing. +func Sku_STATUS_ARMGenerator() gopter.Gen { + if sku_STATUS_ARMGenerator != nil { + return sku_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSku_STATUS_ARM(generators) + sku_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Sku_STATUS_ARM{}), generators) + + return sku_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSku_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSku_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_STATUS_Basic, Sku_Name_STATUS_Premium, Sku_Name_STATUS_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_STATUS_Basic, Sku_Tier_STATUS_Premium, Sku_Tier_STATUS_Standard)) +} + +func Test_SystemData_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS_ARM, SystemData_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS_ARM runs a test to see if a specific instance of SystemData_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS_ARM(subject SystemData_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by +// SystemData_STATUS_ARMGenerator() +var systemData_STATUS_ARMGenerator gopter.Gen + +// SystemData_STATUS_ARMGenerator returns a generator of SystemData_STATUS_ARM instances for property testing. +func SystemData_STATUS_ARMGenerator() gopter.Gen { + if systemData_STATUS_ARMGenerator != nil { + return systemData_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS_ARM(generators) + systemData_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS_ARM{}), generators) + + return systemData_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_CreatedByType_STATUS_Application, + SystemData_CreatedByType_STATUS_Key, + SystemData_CreatedByType_STATUS_ManagedIdentity, + SystemData_CreatedByType_STATUS_User)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_LastModifiedByType_STATUS_Application, + SystemData_LastModifiedByType_STATUS_Key, + SystemData_LastModifiedByType_STATUS_ManagedIdentity, + SystemData_LastModifiedByType_STATUS_User)) +} + +func Test_Encryption_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption_STATUS_ARM, Encryption_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption_STATUS_ARM runs a test to see if a specific instance of Encryption_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption_STATUS_ARM(subject Encryption_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Encryption_STATUS_ARM instances for property testing - lazily instantiated by +// Encryption_STATUS_ARMGenerator() +var encryption_STATUS_ARMGenerator gopter.Gen + +// Encryption_STATUS_ARMGenerator returns a generator of Encryption_STATUS_ARM instances for property testing. +// We first initialize encryption_STATUS_ARMGenerator 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 Encryption_STATUS_ARMGenerator() gopter.Gen { + if encryption_STATUS_ARMGenerator != nil { + return encryption_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM(generators) + encryption_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForEncryption_STATUS_ARM(generators) + encryption_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS_ARM{}), generators) + + return encryption_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_STATUS_MicrosoftKeyVault)) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption_STATUS_ARM(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUS_ARMGenerator()) +} + +func Test_PrivateEndpointConnection_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PrivateEndpointConnection_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS_ARM, PrivateEndpointConnection_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateEndpointConnection_STATUS_ARM runs a test to see if a specific instance of PrivateEndpointConnection_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnection_STATUS_ARM(subject PrivateEndpointConnection_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateEndpointConnection_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by +// PrivateEndpointConnection_STATUS_ARMGenerator() +var privateEndpointConnection_STATUS_ARMGenerator gopter.Gen + +// PrivateEndpointConnection_STATUS_ARMGenerator returns a generator of PrivateEndpointConnection_STATUS_ARM instances for property testing. +func PrivateEndpointConnection_STATUS_ARMGenerator() gopter.Gen { + if privateEndpointConnection_STATUS_ARMGenerator != nil { + return privateEndpointConnection_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS_ARM(generators) + privateEndpointConnection_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS_ARM{}), generators) + + return privateEndpointConnection_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_UserAssignedIdentity_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentity_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentity_STATUS_ARM, UserAssignedIdentity_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentity_STATUS_ARM runs a test to see if a specific instance of UserAssignedIdentity_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentity_STATUS_ARM(subject UserAssignedIdentity_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentity_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by +// UserAssignedIdentity_STATUS_ARMGenerator() +var userAssignedIdentity_STATUS_ARMGenerator gopter.Gen + +// UserAssignedIdentity_STATUS_ARMGenerator returns a generator of UserAssignedIdentity_STATUS_ARM instances for property testing. +func UserAssignedIdentity_STATUS_ARMGenerator() gopter.Gen { + if userAssignedIdentity_STATUS_ARMGenerator != nil { + return userAssignedIdentity_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS_ARM(generators) + userAssignedIdentity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_STATUS_ARM{}), generators) + + return userAssignedIdentity_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultProperties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_STATUS_ARM, KeyVaultProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultProperties_STATUS_ARM runs a test to see if a specific instance of KeyVaultProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultProperties_STATUS_ARM(subject KeyVaultProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by +// KeyVaultProperties_STATUS_ARMGenerator() +var keyVaultProperties_STATUS_ARMGenerator gopter.Gen + +// KeyVaultProperties_STATUS_ARMGenerator returns a generator of KeyVaultProperties_STATUS_ARM instances for property testing. +// We first initialize keyVaultProperties_STATUS_ARMGenerator 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 KeyVaultProperties_STATUS_ARMGenerator() gopter.Gen { + if keyVaultProperties_STATUS_ARMGenerator != nil { + return keyVaultProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(generators) + keyVaultProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(generators) + keyVaultProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS_ARM{}), generators) + + return keyVaultProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["KeyName"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUS_ARMGenerator()) +} + +func Test_UserAssignedIdentityProperties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS_ARM, UserAssignedIdentityProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS_ARM runs a test to see if a specific instance of UserAssignedIdentityProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS_ARM(subject UserAssignedIdentityProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityProperties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityProperties_STATUS_ARM instances for property testing - lazily instantiated by +// UserAssignedIdentityProperties_STATUS_ARMGenerator() +var userAssignedIdentityProperties_STATUS_ARMGenerator gopter.Gen + +// UserAssignedIdentityProperties_STATUS_ARMGenerator returns a generator of UserAssignedIdentityProperties_STATUS_ARM instances for property testing. +func UserAssignedIdentityProperties_STATUS_ARMGenerator() gopter.Gen { + if userAssignedIdentityProperties_STATUS_ARMGenerator != nil { + return userAssignedIdentityProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS_ARM(generators) + userAssignedIdentityProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_STATUS_ARM{}), generators) + + return userAssignedIdentityProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/namespace_types_gen.go b/v2/api/eventhub/v1api20240101/namespace_types_gen.go new file mode 100644 index 00000000000..36801799fbd --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespace_types_gen.go @@ -0,0 +1,3811 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} +type Namespace struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespace_Spec `json:"spec,omitempty"` + Status Namespace_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &Namespace{} + +// GetConditions returns the conditions of the resource +func (namespace *Namespace) GetConditions() conditions.Conditions { + return namespace.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (namespace *Namespace) SetConditions(conditions conditions.Conditions) { + namespace.Status.Conditions = conditions +} + +var _ conversion.Convertible = &Namespace{} + +// ConvertFrom populates our Namespace from the provided hub Namespace +func (namespace *Namespace) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.Namespace) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_From_Namespace(source) +} + +// ConvertTo populates the provided hub Namespace from our Namespace +func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.Namespace) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_To_Namespace(destination) +} + +// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaces,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaces.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &Namespace{} + +// Default applies defaults to the Namespace resource +func (namespace *Namespace) Default() { + namespace.defaultImpl() + var temp any = namespace + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (namespace *Namespace) defaultAzureName() { + if namespace.Spec.AzureName == "" { + namespace.Spec.AzureName = namespace.Name + } +} + +// defaultImpl applies the code generated defaults to the Namespace resource +func (namespace *Namespace) defaultImpl() { namespace.defaultAzureName() } + +var _ genruntime.ImportableResource = &Namespace{} + +// InitializeSpec initializes the spec for this resource from the given status +func (namespace *Namespace) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespace_STATUS); ok { + return namespace.Spec.Initialize_From_Namespace_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespace_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &Namespace{} + +// AzureName returns the Azure name of the resource +func (namespace *Namespace) AzureName() string { + return namespace.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (namespace Namespace) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (namespace *Namespace) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (namespace *Namespace) GetSpec() genruntime.ConvertibleSpec { + return &namespace.Spec +} + +// GetStatus returns the status of this resource +func (namespace *Namespace) GetStatus() genruntime.ConvertibleStatus { + return &namespace.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (namespace *Namespace) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces" +func (namespace *Namespace) GetType() string { + return "Microsoft.EventHub/namespaces" +} + +// NewEmptyStatus returns a new empty (blank) status +func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespace_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (namespace *Namespace) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) + return namespace.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespace_STATUS); ok { + namespace.Status = *st + return nil + } + + // Convert status to required version + var st Namespace_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + namespace.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespace,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaces,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaces.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &Namespace{} + +// ValidateCreate validates the creation of the resource +func (namespace *Namespace) ValidateCreate() (admission.Warnings, error) { + validations := namespace.createValidations() + var temp any = namespace + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (namespace *Namespace) ValidateDelete() (admission.Warnings, error) { + validations := namespace.deleteValidations() + var temp any = namespace + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (namespace *Namespace) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := namespace.updateValidations() + var temp any = namespace + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + return genruntime.ValidateUpdate(old, validations) +} + +// createValidations validates the creation of the resource +func (namespace *Namespace) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){namespace.validateResourceReferences, namespace.validateOwnerReference, namespace.validateSecretDestinations} +} + +// deleteValidations validates the deletion of the resource +func (namespace *Namespace) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (namespace *Namespace) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateResourceReferences() + }, + namespace.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateSecretDestinations() + }, + } +} + +// validateOwnerReference validates the owner field +func (namespace *Namespace) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(namespace) +} + +// validateResourceReferences validates all resource references +func (namespace *Namespace) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&namespace.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (namespace *Namespace) validateSecretDestinations() (admission.Warnings, error) { + if namespace.Spec.OperatorSpec == nil { + return nil, nil + } + if namespace.Spec.OperatorSpec.Secrets == nil { + return nil, nil + } + toValidate := []*genruntime.SecretDestination{ + namespace.Spec.OperatorSpec.Secrets.PrimaryConnectionString, + namespace.Spec.OperatorSpec.Secrets.PrimaryKey, + namespace.Spec.OperatorSpec.Secrets.SecondaryConnectionString, + namespace.Spec.OperatorSpec.Secrets.SecondaryKey, + } + return genruntime.ValidateSecretDestinations(toValidate) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (namespace *Namespace) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*Namespace) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, namespace) +} + +// AssignProperties_From_Namespace populates our Namespace from the provided source Namespace +func (namespace *Namespace) AssignProperties_From_Namespace(source *v20240101s.Namespace) error { + + // ObjectMeta + namespace.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespace_Spec + err := spec.AssignProperties_From_Namespace_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespace_Spec() to populate field Spec") + } + namespace.Spec = spec + + // Status + var status Namespace_STATUS + err = status.AssignProperties_From_Namespace_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespace_STATUS() to populate field Status") + } + namespace.Status = status + + // No error + return nil +} + +// AssignProperties_To_Namespace populates the provided destination Namespace from our Namespace +func (namespace *Namespace) AssignProperties_To_Namespace(destination *v20240101s.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespace_Spec + err := namespace.Spec.AssignProperties_To_Namespace_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespace_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespace_STATUS + err = namespace.Status.AssignProperties_To_Namespace_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespace_STATUS() to populate field Status") + } + destination.Status = status + + // No error + return nil +} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: namespace.Spec.OriginalVersion(), + Kind: "Namespace", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} +type NamespaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Namespace `json:"items"` +} + +// +kubebuilder:validation:Enum={"2024-01-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2024-01-01") + +type Namespace_Spec struct { + // AlternateName: Alternate name specified when alias and namespace names are same. + AlternateName *string `json:"alternateName,omitempty"` + + // +kubebuilder:validation:MaxLength=50 + // +kubebuilder:validation:MinLength=6 + // +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9-]{6,50}[a-zA-Z0-9]$" + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + + // ClusterArmReference: Cluster ARM ID of the Namespace. + ClusterArmReference *genruntime.ResourceReference `armReference:"ClusterArmId" json:"clusterArmReference,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption `json:"encryption,omitempty"` + + // Identity: Properties of BYOK Identity description + Identity *Identity `json:"identity,omitempty"` + + // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + + // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + + // Location: Resource location. + Location *string `json:"location,omitempty"` + + // +kubebuilder:validation:Minimum=0 + // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 + // throughput units. ( '0' if AutoInflateEnabled = true) + MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + + // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_Spec `json:"minimumTlsVersion,omitempty"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespaceOperatorSpec `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"` + + // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_Spec `json:"publicNetworkAccess,omitempty"` + + // Sku: Properties of sku resource + Sku *Sku `json:"sku,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` + + // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespace_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (namespace *Namespace_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if namespace == nil { + return nil, nil + } + result := &Namespace_Spec_ARM{} + + // Set property "Identity": + if namespace.Identity != nil { + identity_ARM, err := (*namespace.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identity_ARM.(*Identity_ARM) + result.Identity = &identity + } + + // Set property "Location": + if namespace.Location != nil { + location := *namespace.Location + result.Location = &location + } + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if namespace.AlternateName != nil || + namespace.ClusterArmReference != nil || + namespace.DisableLocalAuth != nil || + namespace.Encryption != nil || + namespace.IsAutoInflateEnabled != nil || + namespace.KafkaEnabled != nil || + namespace.MaximumThroughputUnits != nil || + namespace.MinimumTlsVersion != nil || + namespace.PublicNetworkAccess != nil || + namespace.ZoneRedundant != nil { + result.Properties = &Namespace_Properties_Spec_ARM{} + } + if namespace.AlternateName != nil { + alternateName := *namespace.AlternateName + result.Properties.AlternateName = &alternateName + } + if namespace.ClusterArmReference != nil { + clusterArmIdARMID, err := resolved.ResolvedReferences.Lookup(*namespace.ClusterArmReference) + if err != nil { + return nil, err + } + clusterArmId := clusterArmIdARMID + result.Properties.ClusterArmId = &clusterArmId + } + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + result.Properties.DisableLocalAuth = &disableLocalAuth + } + if namespace.Encryption != nil { + encryption_ARM, err := (*namespace.Encryption).ConvertToARM(resolved) + if err != nil { + return nil, err + } + encryption := *encryption_ARM.(*Encryption_ARM) + result.Properties.Encryption = &encryption + } + if namespace.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *namespace.IsAutoInflateEnabled + result.Properties.IsAutoInflateEnabled = &isAutoInflateEnabled + } + if namespace.KafkaEnabled != nil { + kafkaEnabled := *namespace.KafkaEnabled + result.Properties.KafkaEnabled = &kafkaEnabled + } + if namespace.MaximumThroughputUnits != nil { + maximumThroughputUnits := *namespace.MaximumThroughputUnits + result.Properties.MaximumThroughputUnits = &maximumThroughputUnits + } + if namespace.MinimumTlsVersion != nil { + minimumTlsVersion := *namespace.MinimumTlsVersion + result.Properties.MinimumTlsVersion = &minimumTlsVersion + } + if namespace.PublicNetworkAccess != nil { + publicNetworkAccess := *namespace.PublicNetworkAccess + result.Properties.PublicNetworkAccess = &publicNetworkAccess + } + if namespace.ZoneRedundant != nil { + zoneRedundant := *namespace.ZoneRedundant + result.Properties.ZoneRedundant = &zoneRedundant + } + + // Set property "Sku": + if namespace.Sku != nil { + sku_ARM, err := (*namespace.Sku).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sku := *sku_ARM.(*Sku_ARM) + result.Sku = &sku + } + + // Set property "Tags": + if namespace.Tags != nil { + result.Tags = make(map[string]string, len(namespace.Tags)) + for key, value := range namespace.Tags { + result.Tags[key] = value + } + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (namespace *Namespace_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespace_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (namespace *Namespace_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespace_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespace_Spec_ARM, got %T", armInput) + } + + // Set property "AlternateName": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AlternateName != nil { + alternateName := *typedInput.Properties.AlternateName + namespace.AlternateName = &alternateName + } + } + + // Set property "AzureName": + namespace.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // no assignment for property "ClusterArmReference" + + // Set property "DisableLocalAuth": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.Properties.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } + } + + // Set property "Encryption": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Encryption != nil { + var encryption1 Encryption + err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption) + if err != nil { + return err + } + encryption := encryption1 + namespace.Encryption = &encryption + } + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 Identity + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + namespace.Identity = &identity + } + + // Set property "IsAutoInflateEnabled": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *typedInput.Properties.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } + } + + // Set property "KafkaEnabled": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.KafkaEnabled != nil { + kafkaEnabled := *typedInput.Properties.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + namespace.Location = &location + } + + // Set property "MaximumThroughputUnits": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaximumThroughputUnits != nil { + maximumThroughputUnits := *typedInput.Properties.MaximumThroughputUnits + namespace.MaximumThroughputUnits = &maximumThroughputUnits + } + } + + // Set property "MinimumTlsVersion": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MinimumTlsVersion != nil { + minimumTlsVersion := *typedInput.Properties.MinimumTlsVersion + namespace.MinimumTlsVersion = &minimumTlsVersion + } + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + namespace.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "PublicNetworkAccess": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccess != nil { + publicNetworkAccess := *typedInput.Properties.PublicNetworkAccess + namespace.PublicNetworkAccess = &publicNetworkAccess + } + } + + // Set property "Sku": + if typedInput.Sku != nil { + var sku1 Sku + err := sku1.PopulateFromARM(owner, *typedInput.Sku) + if err != nil { + return err + } + sku := sku1 + namespace.Sku = &sku + } + + // Set property "Tags": + if typedInput.Tags != nil { + namespace.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + namespace.Tags[key] = value + } + } + + // Set property "ZoneRedundant": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ZoneRedundant != nil { + zoneRedundant := *typedInput.Properties.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespace_Spec{} + +// ConvertSpecFrom populates our Namespace_Spec from the provided source +func (namespace *Namespace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20240101s.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespace_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = namespace.AssignProperties_From_Namespace_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our Namespace_Spec +func (namespace *Namespace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20240101s.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespace_Spec{} + err := namespace.AssignProperties_To_Namespace_Spec(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 +} + +// AssignProperties_From_Namespace_Spec populates our Namespace_Spec from the provided source Namespace_Spec +func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *v20240101s.Namespace_Spec) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // AzureName + namespace.AzureName = source.AzureName + + // ClusterArmReference + if source.ClusterArmReference != nil { + clusterArmReference := source.ClusterArmReference.Copy() + namespace.ClusterArmReference = &clusterArmReference + } else { + namespace.ClusterArmReference = nil + } + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } else { + namespace.DisableLocalAuth = nil + } + + // Encryption + if source.Encryption != nil { + var encryption Encryption + err := encryption.AssignProperties_From_Encryption(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Encryption() to populate field Encryption") + } + namespace.Encryption = &encryption + } else { + namespace.Encryption = nil + } + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.AssignProperties_From_Identity(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Identity() to populate field Identity") + } + namespace.Identity = &identity + } else { + namespace.Identity = nil + } + + // IsAutoInflateEnabled + if source.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *source.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + namespace.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if source.KafkaEnabled != nil { + kafkaEnabled := *source.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } else { + namespace.KafkaEnabled = nil + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MaximumThroughputUnits + if source.MaximumThroughputUnits != nil { + maximumThroughputUnit := *source.MaximumThroughputUnits + namespace.MaximumThroughputUnits = &maximumThroughputUnit + } else { + namespace.MaximumThroughputUnits = nil + } + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_Spec(*source.MinimumTlsVersion) + namespace.MinimumTlsVersion = &minimumTlsVersion + } else { + namespace.MinimumTlsVersion = nil + } + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespaceOperatorSpec + err := operatorSpec.AssignProperties_From_NamespaceOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSpec() to populate field OperatorSpec") + } + namespace.OperatorSpec = &operatorSpec + } else { + namespace.OperatorSpec = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + namespace.Owner = &owner + } else { + namespace.Owner = nil + } + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + publicNetworkAccess := Namespace_Properties_PublicNetworkAccess_Spec(*source.PublicNetworkAccess) + namespace.PublicNetworkAccess = &publicNetworkAccess + } else { + namespace.PublicNetworkAccess = nil + } + + // Sku + if source.Sku != nil { + var sku Sku + err := sku.AssignProperties_From_Sku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Sku() to populate field Sku") + } + namespace.Sku = &sku + } else { + namespace.Sku = nil + } + + // Tags + namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // ZoneRedundant + if source.ZoneRedundant != nil { + zoneRedundant := *source.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } else { + namespace.ZoneRedundant = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespace_Spec populates the provided destination Namespace_Spec from our Namespace_Spec +func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination *v20240101s.Namespace_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // AzureName + destination.AzureName = namespace.AzureName + + // ClusterArmReference + if namespace.ClusterArmReference != nil { + clusterArmReference := namespace.ClusterArmReference.Copy() + destination.ClusterArmReference = &clusterArmReference + } else { + destination.ClusterArmReference = nil + } + + // DisableLocalAuth + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20240101s.Encryption + err := namespace.Encryption.AssignProperties_To_Encryption(&encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Encryption() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // Identity + if namespace.Identity != nil { + var identity v20240101s.Identity + err := namespace.Identity.AssignProperties_To_Identity(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Identity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // IsAutoInflateEnabled + if namespace.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *namespace.IsAutoInflateEnabled + destination.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + destination.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if namespace.KafkaEnabled != nil { + kafkaEnabled := *namespace.KafkaEnabled + destination.KafkaEnabled = &kafkaEnabled + } else { + destination.KafkaEnabled = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MaximumThroughputUnits + if namespace.MaximumThroughputUnits != nil { + maximumThroughputUnit := *namespace.MaximumThroughputUnits + destination.MaximumThroughputUnits = &maximumThroughputUnit + } else { + destination.MaximumThroughputUnits = nil + } + + // MinimumTlsVersion + if namespace.MinimumTlsVersion != nil { + minimumTlsVersion := string(*namespace.MinimumTlsVersion) + destination.MinimumTlsVersion = &minimumTlsVersion + } else { + destination.MinimumTlsVersion = nil + } + + // OperatorSpec + if namespace.OperatorSpec != nil { + var operatorSpec v20240101s.NamespaceOperatorSpec + err := namespace.OperatorSpec.AssignProperties_To_NamespaceOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = namespace.OriginalVersion() + + // Owner + if namespace.Owner != nil { + owner := namespace.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // PublicNetworkAccess + if namespace.PublicNetworkAccess != nil { + publicNetworkAccess := string(*namespace.PublicNetworkAccess) + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // Sku + if namespace.Sku != nil { + var sku v20240101s.Sku + err := namespace.Sku.AssignProperties_To_Sku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Sku() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) + + // ZoneRedundant + if namespace.ZoneRedundant != nil { + zoneRedundant := *namespace.ZoneRedundant + destination.ZoneRedundant = &zoneRedundant + } else { + destination.ZoneRedundant = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespace_STATUS populates our Namespace_Spec from the provided source Namespace_STATUS +func (namespace *Namespace_Spec) Initialize_From_Namespace_STATUS(source *Namespace_STATUS) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // ClusterArmReference + if source.ClusterArmId != nil { + clusterArmReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterArmId) + namespace.ClusterArmReference = &clusterArmReference + } else { + namespace.ClusterArmReference = nil + } + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } else { + namespace.DisableLocalAuth = nil + } + + // Encryption + if source.Encryption != nil { + var encryption Encryption + err := encryption.Initialize_From_Encryption_STATUS(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Encryption_STATUS() to populate field Encryption") + } + namespace.Encryption = &encryption + } else { + namespace.Encryption = nil + } + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.Initialize_From_Identity_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Identity_STATUS() to populate field Identity") + } + namespace.Identity = &identity + } else { + namespace.Identity = nil + } + + // IsAutoInflateEnabled + if source.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *source.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + namespace.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if source.KafkaEnabled != nil { + kafkaEnabled := *source.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } else { + namespace.KafkaEnabled = nil + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MaximumThroughputUnits + if source.MaximumThroughputUnits != nil { + maximumThroughputUnit := *source.MaximumThroughputUnits + namespace.MaximumThroughputUnits = &maximumThroughputUnit + } else { + namespace.MaximumThroughputUnits = nil + } + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_Spec(*source.MinimumTlsVersion) + namespace.MinimumTlsVersion = &minimumTlsVersion + } else { + namespace.MinimumTlsVersion = nil + } + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + publicNetworkAccess := Namespace_Properties_PublicNetworkAccess_Spec(*source.PublicNetworkAccess) + namespace.PublicNetworkAccess = &publicNetworkAccess + } else { + namespace.PublicNetworkAccess = nil + } + + // Sku + if source.Sku != nil { + var sku Sku + err := sku.Initialize_From_Sku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Sku_STATUS() to populate field Sku") + } + namespace.Sku = &sku + } else { + namespace.Sku = nil + } + + // Tags + namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // ZoneRedundant + if source.ZoneRedundant != nil { + zoneRedundant := *source.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } else { + namespace.ZoneRedundant = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (namespace *Namespace_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (namespace *Namespace_Spec) SetAzureName(azureName string) { namespace.AzureName = azureName } + +type Namespace_STATUS struct { + // AlternateName: Alternate name specified when alias and namespace names are same. + AlternateName *string `json:"alternateName,omitempty"` + + // ClusterArmId: Cluster ARM ID of the Namespace. + ClusterArmId *string `json:"clusterArmId,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CreatedAt: The time the Namespace was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_STATUS `json:"encryption,omitempty"` + + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Identity: Properties of BYOK Identity description + Identity *Identity_STATUS `json:"identity,omitempty"` + + // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + + // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + + // Location: Resource location. + Location *string `json:"location,omitempty"` + + // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 + // throughput units. ( '0' if AutoInflateEnabled = true) + MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + + // MetricId: Identifier for Azure Insights metrics. + MetricId *string `json:"metricId,omitempty"` + + // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_STATUS `json:"minimumTlsVersion,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // PrivateEndpointConnections: List of private endpoint connections. + PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"` + + // ProvisioningState: Provisioning state of the Namespace. + ProvisioningState *string `json:"provisioningState,omitempty"` + + // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"` + + // ServiceBusEndpoint: Endpoint you can use to perform Service Bus operations. + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + + // Sku: Properties of sku resource + Sku *Sku_STATUS `json:"sku,omitempty"` + + // Status: Status of the Namespace. + Status *string `json:"status,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + + // Tags: Resource tags. + Tags map[string]string `json:"tags,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + + // UpdatedAt: The time the Namespace was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` + + // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespace_STATUS{} + +// ConvertStatusFrom populates our Namespace_STATUS from the provided source +func (namespace *Namespace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20240101s.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespace_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = namespace.AssignProperties_From_Namespace_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our Namespace_STATUS +func (namespace *Namespace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20240101s.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespace_STATUS{} + err := namespace.AssignProperties_To_Namespace_STATUS(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 = &Namespace_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (namespace *Namespace_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespace_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (namespace *Namespace_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespace_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespace_STATUS_ARM, got %T", armInput) + } + + // Set property "AlternateName": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AlternateName != nil { + alternateName := *typedInput.Properties.AlternateName + namespace.AlternateName = &alternateName + } + } + + // Set property "ClusterArmId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ClusterArmId != nil { + clusterArmId := *typedInput.Properties.ClusterArmId + namespace.ClusterArmId = &clusterArmId + } + } + + // no assignment for property "Conditions" + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + namespace.CreatedAt = &createdAt + } + } + + // Set property "DisableLocalAuth": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DisableLocalAuth != nil { + disableLocalAuth := *typedInput.Properties.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } + } + + // Set property "Encryption": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Encryption != nil { + var encryption1 Encryption_STATUS + err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption) + if err != nil { + return err + } + encryption := encryption1 + namespace.Encryption = &encryption + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + namespace.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 + namespace.Identity = &identity + } + + // Set property "IsAutoInflateEnabled": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *typedInput.Properties.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } + } + + // Set property "KafkaEnabled": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.KafkaEnabled != nil { + kafkaEnabled := *typedInput.Properties.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + namespace.Location = &location + } + + // Set property "MaximumThroughputUnits": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaximumThroughputUnits != nil { + maximumThroughputUnits := *typedInput.Properties.MaximumThroughputUnits + namespace.MaximumThroughputUnits = &maximumThroughputUnits + } + } + + // Set property "MetricId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MetricId != nil { + metricId := *typedInput.Properties.MetricId + namespace.MetricId = &metricId + } + } + + // Set property "MinimumTlsVersion": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MinimumTlsVersion != nil { + minimumTlsVersion := *typedInput.Properties.MinimumTlsVersion + namespace.MinimumTlsVersion = &minimumTlsVersion + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + namespace.Name = &name + } + + // Set property "PrivateEndpointConnections": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.PrivateEndpointConnections { + var item1 PrivateEndpointConnection_STATUS + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + namespace.PrivateEndpointConnections = append(namespace.PrivateEndpointConnections, item1) + } + } + + // Set property "ProvisioningState": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ProvisioningState != nil { + provisioningState := *typedInput.Properties.ProvisioningState + namespace.ProvisioningState = &provisioningState + } + } + + // Set property "PublicNetworkAccess": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PublicNetworkAccess != nil { + publicNetworkAccess := *typedInput.Properties.PublicNetworkAccess + namespace.PublicNetworkAccess = &publicNetworkAccess + } + } + + // Set property "ServiceBusEndpoint": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ServiceBusEndpoint != nil { + serviceBusEndpoint := *typedInput.Properties.ServiceBusEndpoint + namespace.ServiceBusEndpoint = &serviceBusEndpoint + } + } + + // Set property "Sku": + if typedInput.Sku != nil { + var sku1 Sku_STATUS + err := sku1.PopulateFromARM(owner, *typedInput.Sku) + if err != nil { + return err + } + sku := sku1 + namespace.Sku = &sku + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + namespace.Status = &status + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + namespace.SystemData = &systemData + } + + // Set property "Tags": + if typedInput.Tags != nil { + namespace.Tags = make(map[string]string, len(typedInput.Tags)) + for key, value := range typedInput.Tags { + namespace.Tags[key] = value + } + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + namespace.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + namespace.UpdatedAt = &updatedAt + } + } + + // Set property "ZoneRedundant": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ZoneRedundant != nil { + zoneRedundant := *typedInput.Properties.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS +func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *v20240101s.Namespace_STATUS) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // ClusterArmId + namespace.ClusterArmId = genruntime.ClonePointerToString(source.ClusterArmId) + + // Conditions + namespace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedAt + namespace.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } else { + namespace.DisableLocalAuth = nil + } + + // Encryption + if source.Encryption != nil { + var encryption Encryption_STATUS + err := encryption.AssignProperties_From_Encryption_STATUS(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Encryption_STATUS() to populate field Encryption") + } + namespace.Encryption = &encryption + } else { + namespace.Encryption = nil + } + + // Id + namespace.Id = genruntime.ClonePointerToString(source.Id) + + // Identity + if source.Identity != nil { + var identity Identity_STATUS + err := identity.AssignProperties_From_Identity_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Identity_STATUS() to populate field Identity") + } + namespace.Identity = &identity + } else { + namespace.Identity = nil + } + + // IsAutoInflateEnabled + if source.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *source.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + namespace.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if source.KafkaEnabled != nil { + kafkaEnabled := *source.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } else { + namespace.KafkaEnabled = nil + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MaximumThroughputUnits + namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) + + // MetricId + namespace.MetricId = genruntime.ClonePointerToString(source.MetricId) + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_STATUS(*source.MinimumTlsVersion) + namespace.MinimumTlsVersion = &minimumTlsVersion + } else { + namespace.MinimumTlsVersion = nil + } + + // Name + namespace.Name = genruntime.ClonePointerToString(source.Name) + + // PrivateEndpointConnections + if source.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]PrivateEndpointConnection_STATUS, len(source.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range source.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection PrivateEndpointConnection_STATUS + err := privateEndpointConnection.AssignProperties_From_PrivateEndpointConnection_STATUS(&privateEndpointConnectionItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + namespace.PrivateEndpointConnections = privateEndpointConnectionList + } else { + namespace.PrivateEndpointConnections = nil + } + + // ProvisioningState + namespace.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState) + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + publicNetworkAccess := Namespace_Properties_PublicNetworkAccess_STATUS(*source.PublicNetworkAccess) + namespace.PublicNetworkAccess = &publicNetworkAccess + } else { + namespace.PublicNetworkAccess = nil + } + + // ServiceBusEndpoint + namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) + + // Sku + if source.Sku != nil { + var sku Sku_STATUS + err := sku.AssignProperties_From_Sku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Sku_STATUS() to populate field Sku") + } + namespace.Sku = &sku + } else { + namespace.Sku = nil + } + + // Status + namespace.Status = genruntime.ClonePointerToString(source.Status) + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + namespace.SystemData = &systemDatum + } else { + namespace.SystemData = nil + } + + // Tags + namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // Type + namespace.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + namespace.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // ZoneRedundant + if source.ZoneRedundant != nil { + zoneRedundant := *source.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } else { + namespace.ZoneRedundant = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespace_STATUS populates the provided destination Namespace_STATUS from our Namespace_STATUS +func (namespace *Namespace_STATUS) AssignProperties_To_Namespace_STATUS(destination *v20240101s.Namespace_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // ClusterArmId + destination.ClusterArmId = genruntime.ClonePointerToString(namespace.ClusterArmId) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(namespace.Conditions) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(namespace.CreatedAt) + + // DisableLocalAuth + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20240101s.Encryption_STATUS + err := namespace.Encryption.AssignProperties_To_Encryption_STATUS(&encryption) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Encryption_STATUS() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(namespace.Id) + + // Identity + if namespace.Identity != nil { + var identity v20240101s.Identity_STATUS + err := namespace.Identity.AssignProperties_To_Identity_STATUS(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Identity_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // IsAutoInflateEnabled + if namespace.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *namespace.IsAutoInflateEnabled + destination.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + destination.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if namespace.KafkaEnabled != nil { + kafkaEnabled := *namespace.KafkaEnabled + destination.KafkaEnabled = &kafkaEnabled + } else { + destination.KafkaEnabled = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MaximumThroughputUnits + destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits) + + // MetricId + destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) + + // MinimumTlsVersion + if namespace.MinimumTlsVersion != nil { + minimumTlsVersion := string(*namespace.MinimumTlsVersion) + destination.MinimumTlsVersion = &minimumTlsVersion + } else { + destination.MinimumTlsVersion = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(namespace.Name) + + // PrivateEndpointConnections + if namespace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]v20240101s.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection v20240101s.PrivateEndpointConnection_STATUS + err := privateEndpointConnectionItem.AssignProperties_To_PrivateEndpointConnection_STATUS(&privateEndpointConnection) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + destination.PrivateEndpointConnections = privateEndpointConnectionList + } else { + destination.PrivateEndpointConnections = nil + } + + // ProvisioningState + destination.ProvisioningState = genruntime.ClonePointerToString(namespace.ProvisioningState) + + // PublicNetworkAccess + if namespace.PublicNetworkAccess != nil { + publicNetworkAccess := string(*namespace.PublicNetworkAccess) + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // ServiceBusEndpoint + destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) + + // Sku + if namespace.Sku != nil { + var sku v20240101s.Sku_STATUS + err := namespace.Sku.AssignProperties_To_Sku_STATUS(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Sku_STATUS() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil + } + + // Status + destination.Status = genruntime.ClonePointerToString(namespace.Status) + + // SystemData + if namespace.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := namespace.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) + + // Type + destination.Type = genruntime.ClonePointerToString(namespace.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(namespace.UpdatedAt) + + // ZoneRedundant + if namespace.ZoneRedundant != nil { + zoneRedundant := *namespace.ZoneRedundant + destination.ZoneRedundant = &zoneRedundant + } else { + destination.ZoneRedundant = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Properties to configure Encryption +type Encryption struct { + // KeySource: Enumerates the possible value of keySource for Encryption + KeySource *Encryption_KeySource `json:"keySource,omitempty"` + + // KeyVaultProperties: Properties of KeyVault + KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` + + // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +var _ genruntime.ARMTransformer = &Encryption{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (encryption *Encryption) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if encryption == nil { + return nil, nil + } + result := &Encryption_ARM{} + + // Set property "KeySource": + if encryption.KeySource != nil { + keySource := *encryption.KeySource + result.KeySource = &keySource + } + + // Set property "KeyVaultProperties": + for _, item := range encryption.KeyVaultProperties { + item_ARM, err := item.ConvertToARM(resolved) + if err != nil { + return nil, err + } + result.KeyVaultProperties = append(result.KeyVaultProperties, *item_ARM.(*KeyVaultProperties_ARM)) + } + + // Set property "RequireInfrastructureEncryption": + if encryption.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption + result.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (encryption *Encryption) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Encryption_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (encryption *Encryption) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Encryption_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Encryption_ARM, got %T", armInput) + } + + // Set property "KeySource": + if typedInput.KeySource != nil { + keySource := *typedInput.KeySource + encryption.KeySource = &keySource + } + + // Set property "KeyVaultProperties": + for _, item := range typedInput.KeyVaultProperties { + var item1 KeyVaultProperties + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + encryption.KeyVaultProperties = append(encryption.KeyVaultProperties, item1) + } + + // Set property "RequireInfrastructureEncryption": + if typedInput.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *typedInput.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } + + // No error + return nil +} + +// AssignProperties_From_Encryption populates our Encryption from the provided source Encryption +func (encryption *Encryption) AssignProperties_From_Encryption(source *v20240101s.Encryption) error { + + // KeySource + if source.KeySource != nil { + keySource := Encryption_KeySource(*source.KeySource) + encryption.KeySource = &keySource + } else { + encryption.KeySource = nil + } + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty KeyVaultProperties + err := keyVaultProperty.AssignProperties_From_KeyVaultProperties(&keyVaultPropertyItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + encryption.KeyVaultProperties = keyVaultPropertyList + } else { + encryption.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if source.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *source.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + encryption.RequireInfrastructureEncryption = nil + } + + // No error + return nil +} + +// AssignProperties_To_Encryption populates the provided destination Encryption from our Encryption +func (encryption *Encryption) AssignProperties_To_Encryption(destination *v20240101s.Encryption) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // KeySource + if encryption.KeySource != nil { + keySource := string(*encryption.KeySource) + destination.KeySource = &keySource + } else { + destination.KeySource = nil + } + + // KeyVaultProperties + if encryption.KeyVaultProperties != nil { + keyVaultPropertyList := make([]v20240101s.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20240101s.KeyVaultProperties + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties(&keyVaultProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + destination.KeyVaultProperties = keyVaultPropertyList + } else { + destination.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if encryption.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption + destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + destination.RequireInfrastructureEncryption = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Encryption_STATUS populates our Encryption from the provided source Encryption_STATUS +func (encryption *Encryption) Initialize_From_Encryption_STATUS(source *Encryption_STATUS) error { + + // KeySource + if source.KeySource != nil { + keySource := Encryption_KeySource(*source.KeySource) + encryption.KeySource = &keySource + } else { + encryption.KeySource = nil + } + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty KeyVaultProperties + err := keyVaultProperty.Initialize_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + encryption.KeyVaultProperties = keyVaultPropertyList + } else { + encryption.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if source.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *source.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + encryption.RequireInfrastructureEncryption = nil + } + + // No error + return nil +} + +// Properties to configure Encryption +type Encryption_STATUS struct { + // KeySource: Enumerates the possible value of keySource for Encryption + KeySource *Encryption_KeySource_STATUS `json:"keySource,omitempty"` + + // KeyVaultProperties: Properties of KeyVault + KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` + + // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +var _ genruntime.FromARMConverter = &Encryption_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (encryption *Encryption_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Encryption_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (encryption *Encryption_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Encryption_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Encryption_STATUS_ARM, got %T", armInput) + } + + // Set property "KeySource": + if typedInput.KeySource != nil { + keySource := *typedInput.KeySource + encryption.KeySource = &keySource + } + + // Set property "KeyVaultProperties": + for _, item := range typedInput.KeyVaultProperties { + var item1 KeyVaultProperties_STATUS + err := item1.PopulateFromARM(owner, item) + if err != nil { + return err + } + encryption.KeyVaultProperties = append(encryption.KeyVaultProperties, item1) + } + + // Set property "RequireInfrastructureEncryption": + if typedInput.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *typedInput.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } + + // No error + return nil +} + +// AssignProperties_From_Encryption_STATUS populates our Encryption_STATUS from the provided source Encryption_STATUS +func (encryption *Encryption_STATUS) AssignProperties_From_Encryption_STATUS(source *v20240101s.Encryption_STATUS) error { + + // KeySource + if source.KeySource != nil { + keySource := Encryption_KeySource_STATUS(*source.KeySource) + encryption.KeySource = &keySource + } else { + encryption.KeySource = nil + } + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + keyVaultPropertyList := make([]KeyVaultProperties_STATUS, len(source.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty KeyVaultProperties_STATUS + err := keyVaultProperty.AssignProperties_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + encryption.KeyVaultProperties = keyVaultPropertyList + } else { + encryption.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if source.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *source.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + encryption.RequireInfrastructureEncryption = nil + } + + // No error + return nil +} + +// AssignProperties_To_Encryption_STATUS populates the provided destination Encryption_STATUS from our Encryption_STATUS +func (encryption *Encryption_STATUS) AssignProperties_To_Encryption_STATUS(destination *v20240101s.Encryption_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // KeySource + if encryption.KeySource != nil { + keySource := string(*encryption.KeySource) + destination.KeySource = &keySource + } else { + destination.KeySource = nil + } + + // KeyVaultProperties + if encryption.KeyVaultProperties != nil { + keyVaultPropertyList := make([]v20240101s.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20240101s.KeyVaultProperties_STATUS + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + destination.KeyVaultProperties = keyVaultPropertyList + } else { + destination.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if encryption.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption + destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + destination.RequireInfrastructureEncryption = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Properties to configure Identity for Bring your Own Keys +type Identity struct { + // Type: Type of managed service identity. + Type *Identity_Type `json:"type,omitempty"` + + // UserAssignedIdentities: Properties for User Assigned Identities + UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} + +var _ genruntime.ARMTransformer = &Identity{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (identity *Identity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if identity == nil { + return nil, nil + } + result := &Identity_ARM{} + + // Set property "Type": + if identity.Type != nil { + typeVar := *identity.Type + result.Type = &typeVar + } + + // Set property "UserAssignedIdentities": + result.UserAssignedIdentities = make(map[string]UserAssignedIdentityDetails_ARM, len(identity.UserAssignedIdentities)) + for _, ident := range identity.UserAssignedIdentities { + identARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference) + if err != nil { + return nil, err + } + key := identARMID + result.UserAssignedIdentities[key] = UserAssignedIdentityDetails_ARM{} + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Identity_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *Identity) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Identity_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Identity_ARM, got %T", armInput) + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + identity.Type = &typeVar + } + + // no assignment for property "UserAssignedIdentities" + + // No error + return nil +} + +// AssignProperties_From_Identity populates our Identity from the provided source Identity +func (identity *Identity) AssignProperties_From_Identity(source *v20240101s.Identity) error { + + // Type + if source.Type != nil { + typeVar := Identity_Type(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity UserAssignedIdentityDetails + err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// AssignProperties_To_Identity populates the provided destination Identity from our Identity +func (identity *Identity) AssignProperties_To_Identity(destination *v20240101s.Identity) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Type + if identity.Type != nil { + typeVar := string(*identity.Type) + destination.Type = &typeVar + } else { + destination.Type = nil + } + + // UserAssignedIdentities + if identity.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]v20240101s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity v20240101s.UserAssignedIdentityDetails + err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityList + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Identity_STATUS populates our Identity from the provided source Identity_STATUS +func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error { + + // Type + if source.Type != nil { + typeVar := Identity_Type(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities)) + for userAssignedIdentitiesKey := range source.UserAssignedIdentities { + userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey) + userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef}) + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// Properties to configure Identity for Bring your Own Keys +type Identity_STATUS struct { + // PrincipalId: ObjectId from the KeyVault + PrincipalId *string `json:"principalId,omitempty"` + + // TenantId: TenantId from the KeyVault + TenantId *string `json:"tenantId,omitempty"` + + // Type: Type of managed service identity. + Type *Identity_Type_STATUS `json:"type,omitempty"` + + // UserAssignedIdentities: Properties for User Assigned Identities + 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_STATUS_ARM{} +} + +// 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_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Identity_STATUS_ARM, 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 +} + +// AssignProperties_From_Identity_STATUS populates our Identity_STATUS from the provided source Identity_STATUS +func (identity *Identity_STATUS) AssignProperties_From_Identity_STATUS(source *v20240101s.Identity_STATUS) error { + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // TenantId + identity.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // Type + if source.Type != nil { + typeVar := Identity_Type_STATUS(*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.AssignProperties_From_UserAssignedIdentity_STATUS(&userAssignedIdentityValue) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") + } + userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityMap + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// AssignProperties_To_Identity_STATUS populates the provided destination Identity_STATUS from our Identity_STATUS +func (identity *Identity_STATUS) AssignProperties_To_Identity_STATUS(destination *v20240101s.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]v20240101s.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity v20240101s.UserAssignedIdentity_STATUS + err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") + } + userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityMap + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"1.0","1.1","1.2"} +type Namespace_Properties_MinimumTlsVersion_Spec string + +const ( + Namespace_Properties_MinimumTlsVersion_Spec_10 = Namespace_Properties_MinimumTlsVersion_Spec("1.0") + Namespace_Properties_MinimumTlsVersion_Spec_11 = Namespace_Properties_MinimumTlsVersion_Spec("1.1") + Namespace_Properties_MinimumTlsVersion_Spec_12 = Namespace_Properties_MinimumTlsVersion_Spec("1.2") +) + +type Namespace_Properties_MinimumTlsVersion_STATUS string + +const ( + Namespace_Properties_MinimumTlsVersion_STATUS_10 = Namespace_Properties_MinimumTlsVersion_STATUS("1.0") + Namespace_Properties_MinimumTlsVersion_STATUS_11 = Namespace_Properties_MinimumTlsVersion_STATUS("1.1") + Namespace_Properties_MinimumTlsVersion_STATUS_12 = Namespace_Properties_MinimumTlsVersion_STATUS("1.2") +) + +// +kubebuilder:validation:Enum={"Disabled","Enabled","SecuredByPerimeter"} +type Namespace_Properties_PublicNetworkAccess_Spec string + +const ( + Namespace_Properties_PublicNetworkAccess_Spec_Disabled = Namespace_Properties_PublicNetworkAccess_Spec("Disabled") + Namespace_Properties_PublicNetworkAccess_Spec_Enabled = Namespace_Properties_PublicNetworkAccess_Spec("Enabled") + Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter = Namespace_Properties_PublicNetworkAccess_Spec("SecuredByPerimeter") +) + +type Namespace_Properties_PublicNetworkAccess_STATUS string + +const ( + Namespace_Properties_PublicNetworkAccess_STATUS_Disabled = Namespace_Properties_PublicNetworkAccess_STATUS("Disabled") + Namespace_Properties_PublicNetworkAccess_STATUS_Enabled = Namespace_Properties_PublicNetworkAccess_STATUS("Enabled") + Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter = Namespace_Properties_PublicNetworkAccess_STATUS("SecuredByPerimeter") +) + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespaceOperatorSpec struct { + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespaceOperatorSpec populates our NamespaceOperatorSpec from the provided source NamespaceOperatorSpec +func (operator *NamespaceOperatorSpec) AssignProperties_From_NamespaceOperatorSpec(source *v20240101s.NamespaceOperatorSpec) error { + + // Secrets + if source.Secrets != nil { + var secret NamespaceOperatorSecrets + err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespaceOperatorSpec populates the provided destination NamespaceOperatorSpec from our NamespaceOperatorSpec +func (operator *NamespaceOperatorSpec) AssignProperties_To_NamespaceOperatorSpec(destination *v20240101s.NamespaceOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20240101s.NamespaceOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSecrets() 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 +} + +// Properties of the PrivateEndpointConnection. +type PrivateEndpointConnection_STATUS struct { + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` +} + +var _ genruntime.FromARMConverter = &PrivateEndpointConnection_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (connection *PrivateEndpointConnection_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &PrivateEndpointConnection_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (connection *PrivateEndpointConnection_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(PrivateEndpointConnection_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected PrivateEndpointConnection_STATUS_ARM, got %T", armInput) + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + connection.Id = &id + } + + // No error + return nil +} + +// AssignProperties_From_PrivateEndpointConnection_STATUS populates our PrivateEndpointConnection_STATUS from the provided source PrivateEndpointConnection_STATUS +func (connection *PrivateEndpointConnection_STATUS) AssignProperties_From_PrivateEndpointConnection_STATUS(source *v20240101s.PrivateEndpointConnection_STATUS) error { + + // Id + connection.Id = genruntime.ClonePointerToString(source.Id) + + // No error + return nil +} + +// AssignProperties_To_PrivateEndpointConnection_STATUS populates the provided destination PrivateEndpointConnection_STATUS from our PrivateEndpointConnection_STATUS +func (connection *PrivateEndpointConnection_STATUS) AssignProperties_To_PrivateEndpointConnection_STATUS(destination *v20240101s.PrivateEndpointConnection_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Id + destination.Id = genruntime.ClonePointerToString(connection.Id) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// SKU parameters supplied to the create namespace operation +type Sku struct { + // +kubebuilder:validation:Minimum=0 + // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. + // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. + Capacity *int `json:"capacity,omitempty"` + + // +kubebuilder:validation:Required + // Name: Name of this SKU. + Name *Sku_Name `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *Sku_Tier `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 := &Sku_ARM{} + + // Set property "Capacity": + if sku.Capacity != nil { + capacity := *sku.Capacity + result.Capacity = &capacity + } + + // 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 &Sku_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sku *Sku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Sku_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Sku_ARM, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sku.Capacity = &capacity + } + + // 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 +} + +// AssignProperties_From_Sku populates our Sku from the provided source Sku +func (sku *Sku) AssignProperties_From_Sku(source *v20240101s.Sku) error { + + // Capacity + if source.Capacity != nil { + capacity := *source.Capacity + sku.Capacity = &capacity + } else { + sku.Capacity = nil + } + + // Name + if source.Name != nil { + name := Sku_Name(*source.Name) + sku.Name = &name + } else { + sku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := Sku_Tier(*source.Tier) + sku.Tier = &tier + } else { + sku.Tier = nil + } + + // No error + return nil +} + +// AssignProperties_To_Sku populates the provided destination Sku from our Sku +func (sku *Sku) AssignProperties_To_Sku(destination *v20240101s.Sku) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Capacity + if sku.Capacity != nil { + capacity := *sku.Capacity + destination.Capacity = &capacity + } else { + destination.Capacity = nil + } + + // Name + if sku.Name != nil { + name := string(*sku.Name) + destination.Name = &name + } else { + destination.Name = nil + } + + // Tier + if sku.Tier != nil { + tier := string(*sku.Tier) + destination.Tier = &tier + } else { + destination.Tier = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Sku_STATUS populates our Sku from the provided source Sku_STATUS +func (sku *Sku) Initialize_From_Sku_STATUS(source *Sku_STATUS) error { + + // Capacity + if source.Capacity != nil { + capacity := *source.Capacity + sku.Capacity = &capacity + } else { + sku.Capacity = nil + } + + // Name + if source.Name != nil { + name := Sku_Name(*source.Name) + sku.Name = &name + } else { + sku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := Sku_Tier(*source.Tier) + sku.Tier = &tier + } else { + sku.Tier = nil + } + + // No error + return nil +} + +// SKU parameters supplied to the create namespace operation +type Sku_STATUS struct { + // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. + // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *Sku_Name_STATUS `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *Sku_Tier_STATUS `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_STATUS_ARM{} +} + +// 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_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Sku_STATUS_ARM, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sku.Capacity = &capacity + } + + // 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 +} + +// AssignProperties_From_Sku_STATUS populates our Sku_STATUS from the provided source Sku_STATUS +func (sku *Sku_STATUS) AssignProperties_From_Sku_STATUS(source *v20240101s.Sku_STATUS) error { + + // Capacity + sku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := Sku_Name_STATUS(*source.Name) + sku.Name = &name + } else { + sku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := Sku_Tier_STATUS(*source.Tier) + sku.Tier = &tier + } else { + sku.Tier = nil + } + + // No error + return nil +} + +// AssignProperties_To_Sku_STATUS populates the provided destination Sku_STATUS from our Sku_STATUS +func (sku *Sku_STATUS) AssignProperties_To_Sku_STATUS(destination *v20240101s.Sku_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity) + + // Name + if sku.Name != nil { + name := string(*sku.Name) + destination.Name = &name + } else { + destination.Name = nil + } + + // Tier + if sku.Tier != nil { + tier := string(*sku.Tier) + destination.Tier = &tier + } else { + destination.Tier = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + // CreatedAt: The timestamp of resource creation (UTC). + CreatedAt *string `json:"createdAt,omitempty"` + + // CreatedBy: The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // CreatedByType: The type of identity that created the resource. + CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"` + + // LastModifiedAt: The type of identity that last modified the resource. + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + + // LastModifiedBy: The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // LastModifiedByType: The type of identity that last modified the resource. + LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"` +} + +var _ genruntime.FromARMConverter = &SystemData_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (data *SystemData_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SystemData_STATUS_ARM{} +} + +// 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_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SystemData_STATUS_ARM, 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 +} + +// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *v20240101s.SystemData_STATUS) error { + + // CreatedAt + data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + if source.CreatedByType != nil { + createdByType := SystemData_CreatedByType_STATUS(*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 := SystemData_LastModifiedByType_STATUS(*source.LastModifiedByType) + data.LastModifiedByType = &lastModifiedByType + } else { + data.LastModifiedByType = nil + } + + // No error + return nil +} + +// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *v20240101s.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 +} + +// +kubebuilder:validation:Enum={"Microsoft.KeyVault"} +type Encryption_KeySource string + +const Encryption_KeySource_MicrosoftKeyVault = Encryption_KeySource("Microsoft.KeyVault") + +type Encryption_KeySource_STATUS string + +const Encryption_KeySource_STATUS_MicrosoftKeyVault = Encryption_KeySource_STATUS("Microsoft.KeyVault") + +// Properties to configure keyVault Properties +type KeyVaultProperties struct { + Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` + + // KeyName: Name of the Key from KeyVault + KeyName *string `json:"keyName,omitempty"` + + // KeyVaultUri: Uri of KeyVault + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + + // KeyVersion: Key Version + KeyVersion *string `json:"keyVersion,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 := &KeyVaultProperties_ARM{} + + // Set property "Identity": + if properties.Identity != nil { + identity_ARM, err := (*properties.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identity_ARM.(*UserAssignedIdentityProperties_ARM) + result.Identity = &identity + } + + // Set property "KeyName": + if properties.KeyName != nil { + keyName := *properties.KeyName + result.KeyName = &keyName + } + + // Set property "KeyVaultUri": + if properties.KeyVaultUri != nil { + keyVaultUri := *properties.KeyVaultUri + result.KeyVaultUri = &keyVaultUri + } + + // Set property "KeyVersion": + if properties.KeyVersion != nil { + keyVersion := *properties.KeyVersion + result.KeyVersion = &keyVersion + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *KeyVaultProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &KeyVaultProperties_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *KeyVaultProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(KeyVaultProperties_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected KeyVaultProperties_ARM, got %T", armInput) + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 UserAssignedIdentityProperties + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + properties.Identity = &identity + } + + // Set property "KeyName": + if typedInput.KeyName != nil { + keyName := *typedInput.KeyName + properties.KeyName = &keyName + } + + // Set property "KeyVaultUri": + if typedInput.KeyVaultUri != nil { + keyVaultUri := *typedInput.KeyVaultUri + properties.KeyVaultUri = &keyVaultUri + } + + // Set property "KeyVersion": + if typedInput.KeyVersion != nil { + keyVersion := *typedInput.KeyVersion + properties.KeyVersion = &keyVersion + } + + // No error + return nil +} + +// AssignProperties_From_KeyVaultProperties populates our KeyVaultProperties from the provided source KeyVaultProperties +func (properties *KeyVaultProperties) AssignProperties_From_KeyVaultProperties(source *v20240101s.KeyVaultProperties) error { + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties + err := identity.AssignProperties_From_UserAssignedIdentityProperties(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties() to populate field Identity") + } + properties.Identity = &identity + } else { + properties.Identity = nil + } + + // KeyName + properties.KeyName = genruntime.ClonePointerToString(source.KeyName) + + // KeyVaultUri + properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) + + // KeyVersion + properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) + + // No error + return nil +} + +// AssignProperties_To_KeyVaultProperties populates the provided destination KeyVaultProperties from our KeyVaultProperties +func (properties *KeyVaultProperties) AssignProperties_To_KeyVaultProperties(destination *v20240101s.KeyVaultProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity v20240101s.UserAssignedIdentityProperties + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // KeyName + destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) + + // KeyVaultUri + destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) + + // KeyVersion + destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_KeyVaultProperties_STATUS populates our KeyVaultProperties from the provided source KeyVaultProperties_STATUS +func (properties *KeyVaultProperties) Initialize_From_KeyVaultProperties_STATUS(source *KeyVaultProperties_STATUS) error { + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties + err := identity.Initialize_From_UserAssignedIdentityProperties_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") + } + properties.Identity = &identity + } else { + properties.Identity = nil + } + + // KeyName + properties.KeyName = genruntime.ClonePointerToString(source.KeyName) + + // KeyVaultUri + properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) + + // KeyVersion + properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) + + // No error + return nil +} + +// Properties to configure keyVault Properties +type KeyVaultProperties_STATUS struct { + Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` + + // KeyName: Name of the Key from KeyVault + KeyName *string `json:"keyName,omitempty"` + + // KeyVaultUri: Uri of KeyVault + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + + // KeyVersion: Key Version + KeyVersion *string `json:"keyVersion,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_STATUS_ARM{} +} + +// 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_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected KeyVaultProperties_STATUS_ARM, got %T", armInput) + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 UserAssignedIdentityProperties_STATUS + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + properties.Identity = &identity + } + + // Set property "KeyName": + if typedInput.KeyName != nil { + keyName := *typedInput.KeyName + properties.KeyName = &keyName + } + + // Set property "KeyVaultUri": + if typedInput.KeyVaultUri != nil { + keyVaultUri := *typedInput.KeyVaultUri + properties.KeyVaultUri = &keyVaultUri + } + + // Set property "KeyVersion": + if typedInput.KeyVersion != nil { + keyVersion := *typedInput.KeyVersion + properties.KeyVersion = &keyVersion + } + + // No error + return nil +} + +// AssignProperties_From_KeyVaultProperties_STATUS populates our KeyVaultProperties_STATUS from the provided source KeyVaultProperties_STATUS +func (properties *KeyVaultProperties_STATUS) AssignProperties_From_KeyVaultProperties_STATUS(source *v20240101s.KeyVaultProperties_STATUS) error { + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties_STATUS + err := identity.AssignProperties_From_UserAssignedIdentityProperties_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") + } + properties.Identity = &identity + } else { + properties.Identity = nil + } + + // KeyName + properties.KeyName = genruntime.ClonePointerToString(source.KeyName) + + // KeyVaultUri + properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) + + // KeyVersion + properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) + + // No error + return nil +} + +// AssignProperties_To_KeyVaultProperties_STATUS populates the provided destination KeyVaultProperties_STATUS from our KeyVaultProperties_STATUS +func (properties *KeyVaultProperties_STATUS) AssignProperties_To_KeyVaultProperties_STATUS(destination *v20240101s.KeyVaultProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity v20240101s.UserAssignedIdentityProperties_STATUS + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // KeyName + destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) + + // KeyVaultUri + destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) + + // KeyVersion + destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type NamespaceOperatorSecrets struct { + // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + + // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from + // Azure. + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + + // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + + // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved + // from Azure. + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespaceOperatorSecrets populates our NamespaceOperatorSecrets from the provided source NamespaceOperatorSecrets +func (secrets *NamespaceOperatorSecrets) AssignProperties_From_NamespaceOperatorSecrets(source *v20240101s.NamespaceOperatorSecrets) error { + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespaceOperatorSecrets populates the provided destination NamespaceOperatorSecrets from our NamespaceOperatorSecrets +func (secrets *NamespaceOperatorSecrets) AssignProperties_To_NamespaceOperatorSecrets(destination *v20240101s.NamespaceOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Recognized Dictionary value. +type UserAssignedIdentity_STATUS struct { + // ClientId: Client Id of user assigned identity + ClientId *string `json:"clientId,omitempty"` + + // PrincipalId: Principal Id of user assigned identity + PrincipalId *string `json:"principalId,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_STATUS_ARM{} +} + +// 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_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAssignedIdentity_STATUS_ARM, 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 + } + + // No error + return nil +} + +// AssignProperties_From_UserAssignedIdentity_STATUS populates our UserAssignedIdentity_STATUS from the provided source UserAssignedIdentity_STATUS +func (identity *UserAssignedIdentity_STATUS) AssignProperties_From_UserAssignedIdentity_STATUS(source *v20240101s.UserAssignedIdentity_STATUS) error { + + // ClientId + identity.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentity_STATUS populates the provided destination UserAssignedIdentity_STATUS from our UserAssignedIdentity_STATUS +func (identity *UserAssignedIdentity_STATUS) AssignProperties_To_UserAssignedIdentity_STATUS(destination *v20240101s.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) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { + Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` +} + +// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails +func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *v20240101s.UserAssignedIdentityDetails) error { + + // Reference + details.Reference = source.Reference.Copy() + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityDetails populates the provided destination UserAssignedIdentityDetails from our UserAssignedIdentityDetails +func (details *UserAssignedIdentityDetails) AssignProperties_To_UserAssignedIdentityDetails(destination *v20240101s.UserAssignedIdentityDetails) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Reference + destination.Reference = details.Reference.Copy() + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type UserAssignedIdentityProperties struct { + // UserAssignedIdentityReference: ARM ID of user Identity selected for encryption + UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &UserAssignedIdentityProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *UserAssignedIdentityProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &UserAssignedIdentityProperties_ARM{} + + // Set property "UserAssignedIdentity": + if properties.UserAssignedIdentityReference != nil { + userAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*properties.UserAssignedIdentityReference) + if err != nil { + return nil, err + } + userAssignedIdentityReference := userAssignedIdentityReferenceARMID + result.UserAssignedIdentity = &userAssignedIdentityReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *UserAssignedIdentityProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &UserAssignedIdentityProperties_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *UserAssignedIdentityProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + _, ok := armInput.(UserAssignedIdentityProperties_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAssignedIdentityProperties_ARM, got %T", armInput) + } + + // no assignment for property "UserAssignedIdentityReference" + + // No error + return nil +} + +// AssignProperties_From_UserAssignedIdentityProperties populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties +func (properties *UserAssignedIdentityProperties) AssignProperties_From_UserAssignedIdentityProperties(source *v20240101s.UserAssignedIdentityProperties) error { + + // UserAssignedIdentityReference + if source.UserAssignedIdentityReference != nil { + userAssignedIdentityReference := source.UserAssignedIdentityReference.Copy() + properties.UserAssignedIdentityReference = &userAssignedIdentityReference + } else { + properties.UserAssignedIdentityReference = nil + } + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityProperties populates the provided destination UserAssignedIdentityProperties from our UserAssignedIdentityProperties +func (properties *UserAssignedIdentityProperties) AssignProperties_To_UserAssignedIdentityProperties(destination *v20240101s.UserAssignedIdentityProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // UserAssignedIdentityReference + if properties.UserAssignedIdentityReference != nil { + userAssignedIdentityReference := properties.UserAssignedIdentityReference.Copy() + destination.UserAssignedIdentityReference = &userAssignedIdentityReference + } else { + destination.UserAssignedIdentityReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties_STATUS +func (properties *UserAssignedIdentityProperties) Initialize_From_UserAssignedIdentityProperties_STATUS(source *UserAssignedIdentityProperties_STATUS) error { + + // No error + return nil +} + +type UserAssignedIdentityProperties_STATUS struct { + // UserAssignedIdentity: ARM ID of user Identity selected for encryption + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +var _ genruntime.FromARMConverter = &UserAssignedIdentityProperties_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *UserAssignedIdentityProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &UserAssignedIdentityProperties_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *UserAssignedIdentityProperties_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(UserAssignedIdentityProperties_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAssignedIdentityProperties_STATUS_ARM, got %T", armInput) + } + + // Set property "UserAssignedIdentity": + if typedInput.UserAssignedIdentity != nil { + userAssignedIdentity := *typedInput.UserAssignedIdentity + properties.UserAssignedIdentity = &userAssignedIdentity + } + + // No error + return nil +} + +// AssignProperties_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties_STATUS from the provided source UserAssignedIdentityProperties_STATUS +func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_From_UserAssignedIdentityProperties_STATUS(source *v20240101s.UserAssignedIdentityProperties_STATUS) error { + + // UserAssignedIdentity + properties.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityProperties_STATUS populates the provided destination UserAssignedIdentityProperties_STATUS from our UserAssignedIdentityProperties_STATUS +func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_To_UserAssignedIdentityProperties_STATUS(destination *v20240101s.UserAssignedIdentityProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // UserAssignedIdentity + destination.UserAssignedIdentity = genruntime.ClonePointerToString(properties.UserAssignedIdentity) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) +} diff --git a/v2/api/eventhub/v1api20240101/namespace_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespace_types_gen_test.go new file mode 100644 index 00000000000..cd9a7b7e6e5 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespace_types_gen_test.go @@ -0,0 +1,2173 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_Namespace_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespace tests if a specific instance of Namespace round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespace(subject Namespace) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.Namespace + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual Namespace + 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_Namespace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace to Namespace via AssignProperties_To_Namespace & AssignProperties_From_Namespace returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace tests if a specific instance of Namespace can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace(subject Namespace) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Namespace + err := copied.AssignProperties_To_Namespace(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespace + err = actual.AssignProperties_From_Namespace(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace runs a test to see if a specific instance of Namespace round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace(subject Namespace) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespace instances for property testing - lazily instantiated by NamespaceGenerator() +var namespaceGenerator gopter.Gen + +// NamespaceGenerator returns a generator of Namespace instances for property testing. +func NamespaceGenerator() gopter.Gen { + if namespaceGenerator != nil { + return namespaceGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespace(generators) + namespaceGenerator = gen.Struct(reflect.TypeOf(Namespace{}), generators) + + return namespaceGenerator +} + +// AddRelatedPropertyGeneratorsForNamespace is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace(gens map[string]gopter.Gen) { + gens["Spec"] = Namespace_SpecGenerator() + gens["Status"] = Namespace_STATUSGenerator() +} + +func Test_Namespace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_Spec to Namespace_Spec via AssignProperties_To_Namespace_Spec & AssignProperties_From_Namespace_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_Spec, Namespace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_Spec tests if a specific instance of Namespace_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_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 v20240101s.Namespace_Spec + err := copied.AssignProperties_To_Namespace_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespace_Spec + err = actual.AssignProperties_From_Namespace_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespace_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_Spec, Namespace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_Spec runs a test to see if a specific instance of Namespace_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_Spec(subject Namespace_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_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 Namespace_Spec instances for property testing - lazily instantiated by Namespace_SpecGenerator() +var namespace_SpecGenerator gopter.Gen + +// Namespace_SpecGenerator returns a generator of Namespace_Spec instances for property testing. +// We first initialize namespace_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespace_SpecGenerator() gopter.Gen { + if namespace_SpecGenerator != nil { + return namespace_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Spec(generators) + namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Spec(generators) + AddRelatedPropertyGeneratorsForNamespace_Spec(generators) + namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) + + return namespace_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) + gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_Spec_10, Namespace_Properties_MinimumTlsVersion_Spec_11, Namespace_Properties_MinimumTlsVersion_Spec_12)) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_Spec_Disabled, Namespace_Properties_PublicNetworkAccess_Spec_Enabled, Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter)) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespaceOperatorSpecGenerator()) + gens["Sku"] = gen.PtrOf(SkuGenerator()) +} + +func Test_Namespace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_STATUS to Namespace_STATUS via AssignProperties_To_Namespace_STATUS & AssignProperties_From_Namespace_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_STATUS, Namespace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_STATUS tests if a specific instance of Namespace_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_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 v20240101s.Namespace_STATUS + err := copied.AssignProperties_To_Namespace_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespace_STATUS + err = actual.AssignProperties_From_Namespace_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_STATUS, Namespace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_STATUS runs a test to see if a specific instance of Namespace_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_STATUS(subject Namespace_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_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 Namespace_STATUS instances for property testing - lazily instantiated by Namespace_STATUSGenerator() +var namespace_STATUSGenerator gopter.Gen + +// Namespace_STATUSGenerator returns a generator of Namespace_STATUS instances for property testing. +// We first initialize namespace_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespace_STATUSGenerator() gopter.Gen { + if namespace_STATUSGenerator != nil { + return namespace_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) + namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespace_STATUS(generators) + namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) + + return namespace_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) + gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_STATUS_10, Namespace_Properties_MinimumTlsVersion_STATUS_11, Namespace_Properties_MinimumTlsVersion_STATUS_12)) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_STATUS_Disabled, Namespace_Properties_PublicNetworkAccess_STATUS_Enabled, Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter)) + gens["ServiceBusEndpoint"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_STATUSGenerator()) + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUSGenerator()) + gens["Sku"] = gen.PtrOf(Sku_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Encryption_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption to Encryption via AssignProperties_To_Encryption & AssignProperties_From_Encryption returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption, EncryptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption tests if a specific instance of Encryption can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption(subject Encryption) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Encryption + err := copied.AssignProperties_To_Encryption(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Encryption + err = actual.AssignProperties_From_Encryption(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Encryption_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption, EncryptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption runs a test to see if a specific instance of Encryption round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption(subject Encryption) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Encryption instances for property testing - lazily instantiated by EncryptionGenerator() +var encryptionGenerator gopter.Gen + +// EncryptionGenerator returns a generator of Encryption instances for property testing. +// We first initialize encryptionGenerator 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 EncryptionGenerator() gopter.Gen { + if encryptionGenerator != nil { + return encryptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption(generators) + encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption(generators) + AddRelatedPropertyGeneratorsForEncryption(generators) + encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) + + return encryptionGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_MicrosoftKeyVault)) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) +} + +func Test_Encryption_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption_STATUS to Encryption_STATUS via AssignProperties_To_Encryption_STATUS & AssignProperties_From_Encryption_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption_STATUS, Encryption_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption_STATUS tests if a specific instance of Encryption_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_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 v20240101s.Encryption_STATUS + err := copied.AssignProperties_To_Encryption_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Encryption_STATUS + err = actual.AssignProperties_From_Encryption_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Encryption_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption_STATUS, Encryption_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption_STATUS runs a test to see if a specific instance of Encryption_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption_STATUS(subject Encryption_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption_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 Encryption_STATUS instances for property testing - lazily instantiated by Encryption_STATUSGenerator() +var encryption_STATUSGenerator gopter.Gen + +// Encryption_STATUSGenerator returns a generator of Encryption_STATUS instances for property testing. +// We first initialize encryption_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Encryption_STATUSGenerator() gopter.Gen { + if encryption_STATUSGenerator != nil { + return encryption_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) + encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) + AddRelatedPropertyGeneratorsForEncryption_STATUS(generators) + encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) + + return encryption_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_STATUS_MicrosoftKeyVault)) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) +} + +func Test_Identity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity to Identity via AssignProperties_To_Identity & AssignProperties_From_Identity returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity tests if a specific instance of Identity can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity(subject Identity) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Identity + err := copied.AssignProperties_To_Identity(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity + err = actual.AssignProperties_From_Identity(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity(subject Identity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() +var identityGenerator gopter.Gen + +// IdentityGenerator returns a generator of Identity instances for property testing. +// We first initialize identityGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + AddRelatedPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + return identityGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf( + Identity_Type_None, + Identity_Type_SystemAssigned, + Identity_Type_SystemAssignedUserAssigned, + Identity_Type_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) +} + +func Test_Identity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity_STATUS to Identity_STATUS via AssignProperties_To_Identity_STATUS & AssignProperties_From_Identity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity_STATUS tests if a specific instance of Identity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Identity_STATUS + err := copied.AssignProperties_To_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity_STATUS + err = actual.AssignProperties_From_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() +var identity_STATUSGenerator gopter.Gen + +// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. +// We first initialize identity_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_STATUSGenerator() gopter.Gen { + if identity_STATUSGenerator != nil { + return identity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + return identity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.OneConstOf( + Identity_Type_STATUS_None, + Identity_Type_STATUS_SystemAssigned, + Identity_Type_STATUS_SystemAssignedUserAssigned, + Identity_Type_STATUS_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUSGenerator()) +} + +func Test_NamespaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSpec to NamespaceOperatorSpec via AssignProperties_To_NamespaceOperatorSpec & AssignProperties_From_NamespaceOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSpec tests if a specific instance of NamespaceOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespaceOperatorSpec + err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespaceOperatorSpec + err = actual.AssignProperties_From_NamespaceOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespaceOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSpec runs a test to see if a specific instance of NamespaceOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSpec instances for property testing - lazily instantiated by +// NamespaceOperatorSpecGenerator() +var namespaceOperatorSpecGenerator gopter.Gen + +// NamespaceOperatorSpecGenerator returns a generator of NamespaceOperatorSpec instances for property testing. +func NamespaceOperatorSpecGenerator() gopter.Gen { + if namespaceOperatorSpecGenerator != nil { + return namespaceOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(generators) + namespaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSpec{}), generators) + + return namespaceOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespaceOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) +} + +func Test_PrivateEndpointConnection_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PrivateEndpointConnection_STATUS to PrivateEndpointConnection_STATUS via AssignProperties_To_PrivateEndpointConnection_STATUS & AssignProperties_From_PrivateEndpointConnection_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS tests if a specific instance of PrivateEndpointConnection_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_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 v20240101s.PrivateEndpointConnection_STATUS + err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual PrivateEndpointConnection_STATUS + err = actual.AssignProperties_From_PrivateEndpointConnection_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateEndpointConnection_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 PrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by +// PrivateEndpointConnection_STATUSGenerator() +var privateEndpointConnection_STATUSGenerator gopter.Gen + +// PrivateEndpointConnection_STATUSGenerator returns a generator of PrivateEndpointConnection_STATUS instances for property testing. +func PrivateEndpointConnection_STATUSGenerator() gopter.Gen { + if privateEndpointConnection_STATUSGenerator != nil { + return privateEndpointConnection_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(generators) + privateEndpointConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS{}), generators) + + return privateEndpointConnection_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +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 AssignProperties_To_Sku & AssignProperties_From_Sku 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 storage 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 v20240101s.Sku + err := copied.AssignProperties_To_Sku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Sku + err = actual.AssignProperties_From_Sku(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of 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["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_Basic, Sku_Name_Premium, Sku_Name_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_Basic, Sku_Tier_Premium, Sku_Tier_Standard)) +} + +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 AssignProperties_To_Sku_STATUS & AssignProperties_From_Sku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSku_STATUS, Sku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSku_STATUS tests if a specific instance of Sku_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForSku_STATUS(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 v20240101s.Sku_STATUS + err := copied.AssignProperties_To_Sku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Sku_STATUS + err = actual.AssignProperties_From_Sku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Sku_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSku_STATUS, Sku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSku_STATUS runs a test to see if a specific instance of Sku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSku_STATUS(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 Sku_STATUSGenerator() +var sku_STATUSGenerator gopter.Gen + +// Sku_STATUSGenerator returns a generator of Sku_STATUS instances for property testing. +func Sku_STATUSGenerator() gopter.Gen { + if sku_STATUSGenerator != nil { + return sku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSku_STATUS(generators) + sku_STATUSGenerator = gen.Struct(reflect.TypeOf(Sku_STATUS{}), generators) + + return sku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSku_STATUS(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_STATUS_Basic, Sku_Name_STATUS_Premium, Sku_Name_STATUS_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_STATUS_Basic, Sku_Tier_STATUS_Premium, Sku_Tier_STATUS_Standard)) +} + +func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.SystemData_STATUS + err := copied.AssignProperties_To_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_STATUS + err = actual.AssignProperties_From_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() +var systemData_STATUSGenerator gopter.Gen + +// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. +func SystemData_STATUSGenerator() gopter.Gen { + if systemData_STATUSGenerator != nil { + return systemData_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) + systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) + + return systemData_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_CreatedByType_STATUS_Application, + SystemData_CreatedByType_STATUS_Key, + SystemData_CreatedByType_STATUS_ManagedIdentity, + SystemData_CreatedByType_STATUS_User)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_LastModifiedByType_STATUS_Application, + SystemData_LastModifiedByType_STATUS_Key, + SystemData_LastModifiedByType_STATUS_ManagedIdentity, + SystemData_LastModifiedByType_STATUS_User)) +} + +func Test_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 AssignProperties_To_KeyVaultProperties & AssignProperties_From_KeyVaultProperties 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 storage 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 v20240101s.KeyVaultProperties + err := copied.AssignProperties_To_KeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual KeyVaultProperties + err = actual.AssignProperties_From_KeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of 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. +// We first initialize keyVaultPropertiesGenerator 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 KeyVaultPropertiesGenerator() gopter.Gen { + if keyVaultPropertiesGenerator != nil { + return keyVaultPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + AddRelatedPropertyGeneratorsForKeyVaultProperties(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["KeyName"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) +} + +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 AssignProperties_To_KeyVaultProperties_STATUS & AssignProperties_From_KeyVaultProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultProperties_STATUS tests if a specific instance of KeyVaultProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(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 v20240101s.KeyVaultProperties_STATUS + err := copied.AssignProperties_To_KeyVaultProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual KeyVaultProperties_STATUS + err = actual.AssignProperties_From_KeyVaultProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_KeyVaultProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultProperties_STATUS runs a test to see if a specific instance of KeyVaultProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultProperties_STATUS(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 +// KeyVaultProperties_STATUSGenerator() +var keyVaultProperties_STATUSGenerator gopter.Gen + +// KeyVaultProperties_STATUSGenerator returns a generator of KeyVaultProperties_STATUS instances for property testing. +// We first initialize keyVaultProperties_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func KeyVaultProperties_STATUSGenerator() gopter.Gen { + if keyVaultProperties_STATUSGenerator != nil { + return keyVaultProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) + keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(generators) + keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) + + return keyVaultProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { + gens["KeyName"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) +} + +func Test_NamespaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSecrets to NamespaceOperatorSecrets via AssignProperties_To_NamespaceOperatorSecrets & AssignProperties_From_NamespaceOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSecrets tests if a specific instance of NamespaceOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespaceOperatorSecrets + err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespaceOperatorSecrets + err = actual.AssignProperties_From_NamespaceOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespaceOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSecrets runs a test to see if a specific instance of NamespaceOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSecrets instances for property testing - lazily instantiated by +// NamespaceOperatorSecretsGenerator() +var namespaceOperatorSecretsGenerator gopter.Gen + +// NamespaceOperatorSecretsGenerator returns a generator of NamespaceOperatorSecrets instances for property testing. +func NamespaceOperatorSecretsGenerator() gopter.Gen { + if namespaceOperatorSecretsGenerator != nil { + return namespaceOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSecrets{}), generators) + + return namespaceOperatorSecretsGenerator +} + +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 AssignProperties_To_UserAssignedIdentity_STATUS & AssignProperties_From_UserAssignedIdentity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentity_STATUS tests if a specific instance of UserAssignedIdentity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(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 v20240101s.UserAssignedIdentity_STATUS + err := copied.AssignProperties_To_UserAssignedIdentity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentity_STATUS + err = actual.AssignProperties_From_UserAssignedIdentity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentity_STATUS runs a test to see if a specific instance of UserAssignedIdentity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentity_STATUS(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 +// UserAssignedIdentity_STATUSGenerator() +var userAssignedIdentity_STATUSGenerator gopter.Gen + +// UserAssignedIdentity_STATUSGenerator returns a generator of UserAssignedIdentity_STATUS instances for property testing. +func UserAssignedIdentity_STATUSGenerator() gopter.Gen { + if userAssignedIdentity_STATUSGenerator != nil { + return userAssignedIdentity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(generators) + userAssignedIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_STATUS{}), generators) + + return userAssignedIdentity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_UserAssignedIdentityDetails_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityDetails to UserAssignedIdentityDetails via AssignProperties_To_UserAssignedIdentityDetails & AssignProperties_From_UserAssignedIdentityDetails returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityDetails tests if a specific instance of UserAssignedIdentityDetails can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.UserAssignedIdentityDetails + err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityDetails + err = actual.AssignProperties_From_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityDetails via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityDetails + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by +// UserAssignedIdentityDetailsGenerator() +var userAssignedIdentityDetailsGenerator gopter.Gen + +// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. +func UserAssignedIdentityDetailsGenerator() gopter.Gen { + if userAssignedIdentityDetailsGenerator != nil { + return userAssignedIdentityDetailsGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) + + return userAssignedIdentityDetailsGenerator +} + +func Test_UserAssignedIdentityProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties to UserAssignedIdentityProperties via AssignProperties_To_UserAssignedIdentityProperties & AssignProperties_From_UserAssignedIdentityProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties tests if a specific instance of UserAssignedIdentityProperties can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.UserAssignedIdentityProperties + err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityProperties + err = actual.AssignProperties_From_UserAssignedIdentityProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentityProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityProperties runs a test to see if a specific instance of UserAssignedIdentityProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityProperties instances for property testing - lazily instantiated by +// UserAssignedIdentityPropertiesGenerator() +var userAssignedIdentityPropertiesGenerator gopter.Gen + +// UserAssignedIdentityPropertiesGenerator returns a generator of UserAssignedIdentityProperties instances for property testing. +func UserAssignedIdentityPropertiesGenerator() gopter.Gen { + if userAssignedIdentityPropertiesGenerator != nil { + return userAssignedIdentityPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityPropertiesGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties{}), generators) + + return userAssignedIdentityPropertiesGenerator +} + +func Test_UserAssignedIdentityProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties_STATUS to UserAssignedIdentityProperties_STATUS via AssignProperties_To_UserAssignedIdentityProperties_STATUS & AssignProperties_From_UserAssignedIdentityProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS tests if a specific instance of UserAssignedIdentityProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_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 v20240101s.UserAssignedIdentityProperties_STATUS + err := copied.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityProperties_STATUS + err = actual.AssignProperties_From_UserAssignedIdentityProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS runs a test to see if a specific instance of UserAssignedIdentityProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS instances for property testing - lazily instantiated by +// UserAssignedIdentityProperties_STATUSGenerator() +var userAssignedIdentityProperties_STATUSGenerator gopter.Gen + +// UserAssignedIdentityProperties_STATUSGenerator returns a generator of UserAssignedIdentityProperties_STATUS instances for property testing. +func UserAssignedIdentityProperties_STATUSGenerator() gopter.Gen { + if userAssignedIdentityProperties_STATUSGenerator != nil { + return userAssignedIdentityProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(generators) + userAssignedIdentityProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_STATUS{}), generators) + + return userAssignedIdentityProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go new file mode 100644 index 00000000000..c1e985d2a59 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go @@ -0,0 +1,35 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_AuthorizationRule_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties supplied to create or update AuthorizationRule + Properties *Namespaces_AuthorizationRule_Properties_Spec_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_AuthorizationRule_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule Namespaces_AuthorizationRule_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (rule *Namespaces_AuthorizationRule_Spec_ARM) GetName() string { + return rule.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/authorizationRules" +func (rule *Namespaces_AuthorizationRule_Spec_ARM) GetType() string { + return "Microsoft.EventHub/namespaces/authorizationRules" +} + +type Namespaces_AuthorizationRule_Properties_Spec_ARM struct { + // Rights: The rights associated with the rule. + Rights []Namespaces_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..84823317954 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go @@ -0,0 +1,154 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +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_Namespaces_AuthorizationRule_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec_ARM, Namespaces_AuthorizationRule_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec_ARM(subject Namespaces_AuthorizationRule_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_AuthorizationRule_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_Spec_ARMGenerator() +var namespaces_AuthorizationRule_Spec_ARMGenerator gopter.Gen + +// Namespaces_AuthorizationRule_Spec_ARMGenerator returns a generator of Namespaces_AuthorizationRule_Spec_ARM instances for property testing. +// We first initialize namespaces_AuthorizationRule_Spec_ARMGenerator 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 Namespaces_AuthorizationRule_Spec_ARMGenerator() gopter.Gen { + if namespaces_AuthorizationRule_Spec_ARMGenerator != nil { + return namespaces_AuthorizationRule_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(generators) + namespaces_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(generators) + namespaces_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec_ARM{}), generators) + + return namespaces_AuthorizationRule_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator()) +} + +func Test_Namespaces_AuthorizationRule_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_Properties_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec_ARM, Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_Properties_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec_ARM(subject Namespaces_AuthorizationRule_Properties_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_Properties_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_AuthorizationRule_Properties_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator() +var namespaces_AuthorizationRule_Properties_Spec_ARMGenerator gopter.Gen + +// Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator returns a generator of Namespaces_AuthorizationRule_Properties_Spec_ARM instances for property testing. +func Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator() gopter.Gen { + if namespaces_AuthorizationRule_Properties_Spec_ARMGenerator != nil { + return namespaces_AuthorizationRule_Properties_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec_ARM(generators) + namespaces_AuthorizationRule_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Properties_Spec_ARM{}), generators) + + return namespaces_AuthorizationRule_Properties_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec_ARM(gens map[string]gopter.Gen) { + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_AuthorizationRule_Properties_Rights_Spec_Send)) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go new file mode 100644 index 00000000000..72dba2b4b75 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go @@ -0,0 +1,30 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +type Namespaces_AuthorizationRule_STATUS_ARM struct { + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: Properties supplied to create or update AuthorizationRule + Properties *Namespaces_AuthorizationRule_Properties_STATUS_ARM `json:"properties,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` +} + +type Namespaces_AuthorizationRule_Properties_STATUS_ARM struct { + // Rights: The rights associated with the rule. + Rights []Namespaces_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen_test.go new file mode 100644 index 00000000000..fc6dfe73c95 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_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 v1api20240101 + +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_Namespaces_AuthorizationRule_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS_ARM, Namespaces_AuthorizationRule_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS_ARM(subject Namespaces_AuthorizationRule_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_AuthorizationRule_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_STATUS_ARMGenerator() +var namespaces_AuthorizationRule_STATUS_ARMGenerator gopter.Gen + +// Namespaces_AuthorizationRule_STATUS_ARMGenerator returns a generator of Namespaces_AuthorizationRule_STATUS_ARM instances for property testing. +// We first initialize namespaces_AuthorizationRule_STATUS_ARMGenerator 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 Namespaces_AuthorizationRule_STATUS_ARMGenerator() gopter.Gen { + if namespaces_AuthorizationRule_STATUS_ARMGenerator != nil { + return namespaces_AuthorizationRule_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(generators) + namespaces_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(generators) + namespaces_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS_ARM{}), generators) + + return namespaces_AuthorizationRule_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_Namespaces_AuthorizationRule_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_Properties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS_ARM, Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_Properties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS_ARM(subject Namespaces_AuthorizationRule_Properties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_Properties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_AuthorizationRule_Properties_STATUS_ARM instances for property testing - lazily instantiated +// by Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator() +var namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator gopter.Gen + +// Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator returns a generator of Namespaces_AuthorizationRule_Properties_STATUS_ARM instances for property testing. +func Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator() gopter.Gen { + if namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator != nil { + return namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS_ARM(generators) + namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Properties_STATUS_ARM{}), generators) + + return namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send)) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..62577ba485d --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go @@ -0,0 +1,1021 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} +type NamespacesAuthorizationRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_AuthorizationRule_Spec `json:"spec,omitempty"` + Status Namespaces_AuthorizationRule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesAuthorizationRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesAuthorizationRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesAuthorizationRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesAuthorizationRule{} + +// ConvertFrom populates our NamespacesAuthorizationRule from the provided hub NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesAuthorizationRule(source) +} + +// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) +} + +// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespacesauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesAuthorizationRule{} + +// Default applies defaults to the NamespacesAuthorizationRule resource +func (rule *NamespacesAuthorizationRule) Default() { + rule.defaultImpl() + var temp any = rule + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (rule *NamespacesAuthorizationRule) defaultAzureName() { + if rule.Spec.AzureName == "" { + rule.Spec.AzureName = rule.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesAuthorizationRule resource +func (rule *NamespacesAuthorizationRule) defaultImpl() { rule.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesAuthorizationRule{} + +// InitializeSpec initializes the spec for this resource from the given status +func (rule *NamespacesAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { + return rule.Spec.Initialize_From_Namespaces_AuthorizationRule_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_AuthorizationRule_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesAuthorizationRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesAuthorizationRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesAuthorizationRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/authorizationRules" +func (rule *NamespacesAuthorizationRule) GetType() string { + return "Microsoft.EventHub/namespaces/authorizationRules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_AuthorizationRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_AuthorizationRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespacesauthorizationrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespacesauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesAuthorizationRule{} + +// ValidateCreate validates the creation of the resource +func (rule *NamespacesAuthorizationRule) ValidateCreate() (admission.Warnings, error) { + validations := rule.createValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (rule *NamespacesAuthorizationRule) ValidateDelete() (admission.Warnings, error) { + validations := rule.deleteValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (rule *NamespacesAuthorizationRule) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := rule.updateValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + return genruntime.ValidateUpdate(old, validations) +} + +// createValidations validates the creation of the resource +func (rule *NamespacesAuthorizationRule) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference, rule.validateSecretDestinations} +} + +// deleteValidations validates the deletion of the resource +func (rule *NamespacesAuthorizationRule) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (rule *NamespacesAuthorizationRule) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateResourceReferences() + }, + rule.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateSecretDestinations() + }, + } +} + +// validateOwnerReference validates the owner field +func (rule *NamespacesAuthorizationRule) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(rule) +} + +// validateResourceReferences validates all resource references +func (rule *NamespacesAuthorizationRule) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (rule *NamespacesAuthorizationRule) validateSecretDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + if rule.Spec.OperatorSpec.Secrets == nil { + return nil, nil + } + toValidate := []*genruntime.SecretDestination{ + rule.Spec.OperatorSpec.Secrets.PrimaryConnectionString, + rule.Spec.OperatorSpec.Secrets.PrimaryKey, + rule.Spec.OperatorSpec.Secrets.SecondaryConnectionString, + rule.Spec.OperatorSpec.Secrets.SecondaryKey, + } + return genruntime.ValidateSecretDestinations(toValidate) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (rule *NamespacesAuthorizationRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesAuthorizationRule) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, rule) +} + +// AssignProperties_From_NamespacesAuthorizationRule populates our NamespacesAuthorizationRule from the provided source NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) AssignProperties_From_NamespacesAuthorizationRule(source *v20240101s.NamespacesAuthorizationRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_AuthorizationRule_Spec + err := spec.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_AuthorizationRule_STATUS + err = status.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_STATUS() to populate field Status") + } + rule.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRule populates the provided destination NamespacesAuthorizationRule from our NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) AssignProperties_To_NamespacesAuthorizationRule(destination *v20240101s.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_AuthorizationRule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_AuthorizationRule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_STATUS() to populate field Status") + } + destination.Status = status + + // No error + return nil +} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion(), + Kind: "NamespacesAuthorizationRule", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} +type NamespacesAuthorizationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesAuthorizationRule `json:"items"` +} + +type Namespaces_AuthorizationRule_Spec struct { + // +kubebuilder:validation:MinLength=1 + // 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"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `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 eventhub.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` + + // +kubebuilder:validation:Required + // Rights: The rights associated with the rule. + Rights []Namespaces_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_AuthorizationRule_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (rule *Namespaces_AuthorizationRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if rule == nil { + return nil, nil + } + result := &Namespaces_AuthorizationRule_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if rule.Rights != nil { + result.Properties = &Namespaces_AuthorizationRule_Properties_Spec_ARM{} + } + for _, item := range rule.Rights { + result.Properties.Rights = append(result.Properties.Rights, item) + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_AuthorizationRule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_AuthorizationRule_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_AuthorizationRule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_AuthorizationRule_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_AuthorizationRule_Spec_ARM, got %T", armInput) + } + + // Set property "AzureName": + rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + rule.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "Rights": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.Rights { + rule.Rights = append(rule.Rights, item) + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_AuthorizationRule_Spec{} + +// ConvertSpecFrom populates our Namespaces_AuthorizationRule_Spec from the provided source +func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_AuthorizationRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our Namespaces_AuthorizationRule_Spec +func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_AuthorizationRule_Spec{} + err := rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(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 +} + +// AssignProperties_From_Namespaces_AuthorizationRule_Spec populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_Spec +func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_From_Namespaces_AuthorizationRule_Spec(source *v20240101s.Namespaces_AuthorizationRule_Spec) error { + + // AzureName + rule.AzureName = source.AzureName + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesAuthorizationRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = Namespaces_AuthorizationRule_Properties_Rights_Spec(rightItem) + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_AuthorizationRule_Spec populates the provided destination Namespaces_AuthorizationRule_Spec from our Namespaces_AuthorizationRule_Spec +func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_AuthorizationRule_Spec(destination *v20240101s.Namespaces_AuthorizationRule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = rule.AzureName + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20240101s.NamespacesAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion() + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Rights + if rule.Rights != nil { + rightList := make([]string, len(rule.Rights)) + for rightIndex, rightItem := range rule.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = string(rightItem) + } + destination.Rights = rightList + } else { + destination.Rights = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_Spec) Initialize_From_Namespaces_AuthorizationRule_STATUS(source *Namespaces_AuthorizationRule_STATUS) error { + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + right := Namespaces_AuthorizationRule_Properties_Rights_Spec(rightItem) + rightList[rightIndex] = right + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (rule *Namespaces_AuthorizationRule_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (rule *Namespaces_AuthorizationRule_Spec) SetAzureName(azureName string) { + rule.AzureName = azureName +} + +type Namespaces_AuthorizationRule_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"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Rights: The rights associated with the rule. + Rights []Namespaces_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_AuthorizationRule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_AuthorizationRule_STATUS from the provided source +func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_AuthorizationRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_AuthorizationRule_STATUS{} + err := rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(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 = &Namespaces_AuthorizationRule_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_AuthorizationRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_AuthorizationRule_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_AuthorizationRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_AuthorizationRule_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_AuthorizationRule_STATUS_ARM, got %T", armInput) + } + + // no assignment for property "Conditions" + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + rule.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + rule.Location = &location + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + rule.Name = &name + } + + // Set property "Rights": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.Rights { + rule.Rights = append(rule.Rights, item) + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + rule.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + rule.Type = &typeVar + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_STATUS from the provided source Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_AuthorizationRule_STATUS(source *v20240101s.Namespaces_AuthorizationRule_STATUS) error { + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_STATUS, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = Namespaces_AuthorizationRule_Properties_Rights_STATUS(rightItem) + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + rule.SystemData = &systemDatum + } else { + rule.SystemData = nil + } + + // Type + rule.Type = genruntime.ClonePointerToString(source.Type) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_AuthorizationRule_STATUS populates the provided destination Namespaces_AuthorizationRule_STATUS from our Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_AuthorizationRule_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // Rights + if rule.Rights != nil { + rightList := make([]string, len(rule.Rights)) + for rightIndex, rightItem := range rule.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = string(rightItem) + } + destination.Rights = rightList + } else { + destination.Rights = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Listen","Manage","Send"} +type Namespaces_AuthorizationRule_Properties_Rights_Spec string + +const ( + Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen = Namespaces_AuthorizationRule_Properties_Rights_Spec("Listen") + Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage = Namespaces_AuthorizationRule_Properties_Rights_Spec("Manage") + Namespaces_AuthorizationRule_Properties_Rights_Spec_Send = Namespaces_AuthorizationRule_Properties_Rights_Spec("Send") +) + +type Namespaces_AuthorizationRule_Properties_Rights_STATUS string + +const ( + Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen = Namespaces_AuthorizationRule_Properties_Rights_STATUS("Listen") + Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage = Namespaces_AuthorizationRule_Properties_Rights_STATUS("Manage") + Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send = Namespaces_AuthorizationRule_Properties_Rights_STATUS("Send") +) + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesAuthorizationRuleOperatorSpec struct { + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec populates our NamespacesAuthorizationRuleOperatorSpec from the provided source NamespacesAuthorizationRuleOperatorSpec +func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { + + // Secrets + if source.Secrets != nil { + var secret NamespacesAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec populates the provided destination NamespacesAuthorizationRuleOperatorSpec from our NamespacesAuthorizationRuleOperatorSpec +func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20240101s.NamespacesAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets() 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 NamespacesAuthorizationRuleOperatorSecrets struct { + // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + + // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from + // Azure. + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + + // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + + // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved + // from Azure. + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets populates our NamespacesAuthorizationRuleOperatorSecrets from the provided source NamespacesAuthorizationRuleOperatorSecrets +func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets populates the provided destination NamespacesAuthorizationRuleOperatorSecrets from our NamespacesAuthorizationRuleOperatorSecrets +func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..f20ce5c3c2d --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go @@ -0,0 +1,605 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesAuthorizationRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesAuthorizationRule + 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_NamespacesAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to NamespacesAuthorizationRule via AssignProperties_To_NamespacesAuthorizationRule & AssignProperties_From_NamespacesAuthorizationRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesAuthorizationRule + err := copied.AssignProperties_To_NamespacesAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRule + err = actual.AssignProperties_From_NamespacesAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule runs a test to see if a specific instance of NamespacesAuthorizationRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRule instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleGenerator() +var namespacesAuthorizationRuleGenerator gopter.Gen + +// NamespacesAuthorizationRuleGenerator returns a generator of NamespacesAuthorizationRule instances for property testing. +func NamespacesAuthorizationRuleGenerator() gopter.Gen { + if namespacesAuthorizationRuleGenerator != nil { + return namespacesAuthorizationRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(generators) + namespacesAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule{}), generators) + + return namespacesAuthorizationRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_AuthorizationRule_SpecGenerator() + gens["Status"] = Namespaces_AuthorizationRule_STATUSGenerator() +} + +func Test_Namespaces_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_AuthorizationRule_Spec to Namespaces_AuthorizationRule_Spec via AssignProperties_To_Namespaces_AuthorizationRule_Spec & AssignProperties_From_Namespaces_AuthorizationRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec tests if a specific instance of Namespaces_AuthorizationRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_Spec + err := copied.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_AuthorizationRule_Spec + err = actual.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_AuthorizationRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_Spec instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_SpecGenerator() +var namespaces_AuthorizationRule_SpecGenerator gopter.Gen + +// Namespaces_AuthorizationRule_SpecGenerator returns a generator of Namespaces_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { + if namespaces_AuthorizationRule_SpecGenerator != nil { + return namespaces_AuthorizationRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + + return namespaces_AuthorizationRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_AuthorizationRule_Properties_Rights_Spec_Send)) +} + +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) +} + +func Test_Namespaces_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_AuthorizationRule_STATUS to Namespaces_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_AuthorizationRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS tests if a specific instance of Namespaces_AuthorizationRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_STATUS + err := copied.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_AuthorizationRule_STATUS + err = actual.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_AuthorizationRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_STATUS instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_STATUSGenerator() +var namespaces_AuthorizationRule_STATUSGenerator gopter.Gen + +// Namespaces_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_AuthorizationRule_STATUS instances for property testing. +// We first initialize namespaces_AuthorizationRule_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_AuthorizationRule_STATUSGenerator() gopter.Gen { + if namespaces_AuthorizationRule_STATUSGenerator != nil { + return namespaces_AuthorizationRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) + namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) + namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) + + return namespaces_AuthorizationRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send)) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSpec to NamespacesAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesAuthorizationRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSpecGenerator() +var namespacesAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(generators) + namespacesAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSpec{}), generators) + + return namespacesAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSecrets to NamespacesAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesAuthorizationRuleOperatorSecrets + err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRuleOperatorSecrets + err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSecretsGenerator() +var namespacesAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go new file mode 100644 index 00000000000..3d27846eefe --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go @@ -0,0 +1,123 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Eventhub_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties supplied to the Create Or Update Event Hub operation. + Properties *Namespaces_Eventhub_Properties_Spec_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Eventhub_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (eventhub Namespaces_Eventhub_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (eventhub *Namespaces_Eventhub_Spec_ARM) GetName() string { + return eventhub.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs" +func (eventhub *Namespaces_Eventhub_Spec_ARM) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs" +} + +type Namespaces_Eventhub_Properties_Spec_ARM struct { + // CaptureDescription: Properties of capture description + CaptureDescription *CaptureDescription_ARM `json:"captureDescription,omitempty"` + + // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days + MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` + + // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + PartitionCount *int `json:"partitionCount,omitempty"` + + // RetentionDescription: Event Hub retention settings + RetentionDescription *RetentionDescription_ARM `json:"retentionDescription,omitempty"` +} + +// Properties to configure capture description for eventhub +type CaptureDescription_ARM struct { + // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) + Destination *Destination_ARM `json:"destination,omitempty"` + + // Enabled: A value that indicates whether capture description is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be + // deprecated in New API Version + Encoding *CaptureDescription_Encoding `json:"encoding,omitempty"` + + // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, + // value should between 60 to 900 seconds + IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` + + // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, + // value should be between 10485760 to 524288000 bytes + SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` + + // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives + SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` +} + +// Properties to configure retention settings for the eventhub +type RetentionDescription_ARM struct { + // CleanupPolicy: Enumerates the possible values for cleanup policy + CleanupPolicy *RetentionDescription_CleanupPolicy `json:"cleanupPolicy,omitempty"` + + // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when + // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue + RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` + + // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is + // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified + // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key + // described by the tombstone marker within the compacted Event Hub + TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` +} + +// Capture storage details for capture description +type Destination_ARM struct { + // Identity: A value that indicates whether capture description is enabled. + Identity *CaptureIdentity_ARM `json:"identity,omitempty"` + + // Name: Name for capture destination + Name *string `json:"name,omitempty"` + + // Properties: Properties describing the storage account, blob container and archive name format for capture destination + Properties *Destination_Properties_ARM `json:"properties,omitempty"` +} + +// A value that indicates whether capture description is enabled. +type CaptureIdentity_ARM struct { + // Type: Type of Azure Active Directory Managed Identity. + Type *CaptureIdentity_Type `json:"type,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +type Destination_Properties_ARM struct { + // ArchiveNameFormat: Blob naming convention for archive, e.g. + // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters + // (Namespace,EventHub .. etc) are mandatory irrespective of order + ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` + + // BlobContainer: Blob container Name + BlobContainer *string `json:"blobContainer,omitempty"` + + // DataLakeAccountName: The Azure Data Lake Store name for the captured events + DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` + + // DataLakeFolderPath: The destination folder path for the captured events + DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` + + // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store + DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` + StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..9010e7d4a7d --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go @@ -0,0 +1,515 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +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_Namespaces_Eventhub_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Spec_ARM, Namespaces_Eventhub_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhub_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_Spec_ARM(subject Namespaces_Eventhub_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhub_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Eventhub_Spec_ARMGenerator() +var namespaces_Eventhub_Spec_ARMGenerator gopter.Gen + +// Namespaces_Eventhub_Spec_ARMGenerator returns a generator of Namespaces_Eventhub_Spec_ARM instances for property testing. +// We first initialize namespaces_Eventhub_Spec_ARMGenerator 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 Namespaces_Eventhub_Spec_ARMGenerator() gopter.Gen { + if namespaces_Eventhub_Spec_ARMGenerator != nil { + return namespaces_Eventhub_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(generators) + namespaces_Eventhub_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(generators) + namespaces_Eventhub_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec_ARM{}), generators) + + return namespaces_Eventhub_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_Eventhub_Properties_Spec_ARMGenerator()) +} + +func Test_Namespaces_Eventhub_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_Properties_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Properties_Spec_ARM, Namespaces_Eventhub_Properties_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhub_Properties_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_Properties_Spec_ARM(subject Namespaces_Eventhub_Properties_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_Properties_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhub_Properties_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Eventhub_Properties_Spec_ARMGenerator() +var namespaces_Eventhub_Properties_Spec_ARMGenerator gopter.Gen + +// Namespaces_Eventhub_Properties_Spec_ARMGenerator returns a generator of Namespaces_Eventhub_Properties_Spec_ARM instances for property testing. +// We first initialize namespaces_Eventhub_Properties_Spec_ARMGenerator 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 Namespaces_Eventhub_Properties_Spec_ARMGenerator() gopter.Gen { + if namespaces_Eventhub_Properties_Spec_ARMGenerator != nil { + return namespaces_Eventhub_Properties_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(generators) + namespaces_Eventhub_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(generators) + namespaces_Eventhub_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_Spec_ARM{}), generators) + + return namespaces_Eventhub_Properties_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(gens map[string]gopter.Gen) { + gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) + gens["PartitionCount"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(gens map[string]gopter.Gen) { + gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_ARMGenerator()) + gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_ARMGenerator()) +} + +func Test_CaptureDescription_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureDescription_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureDescription_ARM, CaptureDescription_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureDescription_ARM runs a test to see if a specific instance of CaptureDescription_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureDescription_ARM(subject CaptureDescription_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureDescription_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureDescription_ARM instances for property testing - lazily instantiated by +// CaptureDescription_ARMGenerator() +var captureDescription_ARMGenerator gopter.Gen + +// CaptureDescription_ARMGenerator returns a generator of CaptureDescription_ARM instances for property testing. +// We first initialize captureDescription_ARMGenerator 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 CaptureDescription_ARMGenerator() gopter.Gen { + if captureDescription_ARMGenerator != nil { + return captureDescription_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_ARM(generators) + captureDescription_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_ARM(generators) + AddRelatedPropertyGeneratorsForCaptureDescription_ARM(generators) + captureDescription_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_ARM{}), generators) + + return captureDescription_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureDescription_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureDescription_ARM(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_Avro, CaptureDescription_Encoding_AvroDeflate)) + gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) + gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) + gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForCaptureDescription_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCaptureDescription_ARM(gens map[string]gopter.Gen) { + gens["Destination"] = gen.PtrOf(Destination_ARMGenerator()) +} + +func Test_RetentionDescription_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RetentionDescription_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRetentionDescription_ARM, RetentionDescription_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRetentionDescription_ARM runs a test to see if a specific instance of RetentionDescription_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForRetentionDescription_ARM(subject RetentionDescription_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RetentionDescription_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RetentionDescription_ARM instances for property testing - lazily instantiated by +// RetentionDescription_ARMGenerator() +var retentionDescription_ARMGenerator gopter.Gen + +// RetentionDescription_ARMGenerator returns a generator of RetentionDescription_ARM instances for property testing. +func RetentionDescription_ARMGenerator() gopter.Gen { + if retentionDescription_ARMGenerator != nil { + return retentionDescription_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRetentionDescription_ARM(generators) + retentionDescription_ARMGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_ARM{}), generators) + + return retentionDescription_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForRetentionDescription_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRetentionDescription_ARM(gens map[string]gopter.Gen) { + gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_Compact, RetentionDescription_CleanupPolicy_Delete)) + gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) + gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) +} + +func Test_Destination_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination_ARM, Destination_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination_ARM runs a test to see if a specific instance of Destination_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination_ARM(subject Destination_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Destination_ARM instances for property testing - lazily instantiated by Destination_ARMGenerator() +var destination_ARMGenerator gopter.Gen + +// Destination_ARMGenerator returns a generator of Destination_ARM instances for property testing. +// We first initialize destination_ARMGenerator 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 Destination_ARMGenerator() gopter.Gen { + if destination_ARMGenerator != nil { + return destination_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_ARM(generators) + destination_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_ARM(generators) + AddRelatedPropertyGeneratorsForDestination_ARM(generators) + destination_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_ARM{}), generators) + + return destination_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForDestination_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForDestination_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForDestination_ARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(CaptureIdentity_ARMGenerator()) + gens["Properties"] = gen.PtrOf(Destination_Properties_ARMGenerator()) +} + +func Test_CaptureIdentity_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureIdentity_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureIdentity_ARM, CaptureIdentity_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureIdentity_ARM runs a test to see if a specific instance of CaptureIdentity_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureIdentity_ARM(subject CaptureIdentity_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureIdentity_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureIdentity_ARM instances for property testing - lazily instantiated by +// CaptureIdentity_ARMGenerator() +var captureIdentity_ARMGenerator gopter.Gen + +// CaptureIdentity_ARMGenerator returns a generator of CaptureIdentity_ARM instances for property testing. +func CaptureIdentity_ARMGenerator() gopter.Gen { + if captureIdentity_ARMGenerator != nil { + return captureIdentity_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureIdentity_ARM(generators) + captureIdentity_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_ARM{}), generators) + + return captureIdentity_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureIdentity_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureIdentity_ARM(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_SystemAssigned, CaptureIdentity_Type_UserAssigned)) + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Destination_Properties_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination_Properties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination_Properties_ARM, Destination_Properties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination_Properties_ARM runs a test to see if a specific instance of Destination_Properties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination_Properties_ARM(subject Destination_Properties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination_Properties_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Destination_Properties_ARM instances for property testing - lazily instantiated by +// Destination_Properties_ARMGenerator() +var destination_Properties_ARMGenerator gopter.Gen + +// Destination_Properties_ARMGenerator returns a generator of Destination_Properties_ARM instances for property testing. +func Destination_Properties_ARMGenerator() gopter.Gen { + if destination_Properties_ARMGenerator != nil { + return destination_Properties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_Properties_ARM(generators) + destination_Properties_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_Properties_ARM{}), generators) + + return destination_Properties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForDestination_Properties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination_Properties_ARM(gens map[string]gopter.Gen) { + gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) + gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go new file mode 100644 index 00000000000..9ec1c4d8921 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go @@ -0,0 +1,135 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +type Namespaces_Eventhub_STATUS_ARM struct { + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: Properties supplied to the Create Or Update Event Hub operation. + Properties *Namespaces_Eventhub_Properties_STATUS_ARM `json:"properties,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` +} + +type Namespaces_Eventhub_Properties_STATUS_ARM struct { + // CaptureDescription: Properties of capture description + CaptureDescription *CaptureDescription_STATUS_ARM `json:"captureDescription,omitempty"` + + // CreatedAt: Exact time the Event Hub was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days + MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` + + // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + PartitionCount *int `json:"partitionCount,omitempty"` + + // PartitionIds: Current number of shards on the Event Hub. + PartitionIds []string `json:"partitionIds,omitempty"` + + // RetentionDescription: Event Hub retention settings + RetentionDescription *RetentionDescription_STATUS_ARM `json:"retentionDescription,omitempty"` + + // Status: Enumerates the possible values for the status of the Event Hub. + Status *Namespaces_Eventhub_Properties_Status_STATUS `json:"status,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +// Properties to configure capture description for eventhub +type CaptureDescription_STATUS_ARM struct { + // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) + Destination *Destination_STATUS_ARM `json:"destination,omitempty"` + + // Enabled: A value that indicates whether capture description is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be + // deprecated in New API Version + Encoding *CaptureDescription_Encoding_STATUS `json:"encoding,omitempty"` + + // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, + // value should between 60 to 900 seconds + IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` + + // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, + // value should be between 10485760 to 524288000 bytes + SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` + + // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives + SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` +} + +// Properties to configure retention settings for the eventhub +type RetentionDescription_STATUS_ARM struct { + // CleanupPolicy: Enumerates the possible values for cleanup policy + CleanupPolicy *RetentionDescription_CleanupPolicy_STATUS `json:"cleanupPolicy,omitempty"` + + // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when + // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue + RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` + + // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is + // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified + // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key + // described by the tombstone marker within the compacted Event Hub + TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` +} + +// Capture storage details for capture description +type Destination_STATUS_ARM struct { + // Identity: A value that indicates whether capture description is enabled. + Identity *CaptureIdentity_STATUS_ARM `json:"identity,omitempty"` + + // Name: Name for capture destination + Name *string `json:"name,omitempty"` + + // Properties: Properties describing the storage account, blob container and archive name format for capture destination + Properties *Destination_Properties_STATUS_ARM `json:"properties,omitempty"` +} + +// A value that indicates whether capture description is enabled. +type CaptureIdentity_STATUS_ARM struct { + // Type: Type of Azure Active Directory Managed Identity. + Type *CaptureIdentity_Type_STATUS `json:"type,omitempty"` + + // UserAssignedIdentity: ARM ID of Managed User Identity. This property is required is the type is UserAssignedIdentity. If + // type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be used. + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +type Destination_Properties_STATUS_ARM struct { + // ArchiveNameFormat: Blob naming convention for archive, e.g. + // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters + // (Namespace,EventHub .. etc) are mandatory irrespective of order + ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` + + // BlobContainer: Blob container Name + BlobContainer *string `json:"blobContainer,omitempty"` + + // DataLakeAccountName: The Azure Data Lake Store name for the captured events + DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` + + // DataLakeFolderPath: The destination folder path for the captured events + DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` + + // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store + DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` + + // StorageAccountResourceId: Resource id of the storage account to be used to create the blobs + StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go new file mode 100644 index 00000000000..3c24ebd5b45 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go @@ -0,0 +1,533 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +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_Namespaces_Eventhub_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_STATUS_ARM, Namespaces_Eventhub_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhub_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_STATUS_ARM(subject Namespaces_Eventhub_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhub_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Eventhub_STATUS_ARMGenerator() +var namespaces_Eventhub_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Eventhub_STATUS_ARMGenerator returns a generator of Namespaces_Eventhub_STATUS_ARM instances for property testing. +// We first initialize namespaces_Eventhub_STATUS_ARMGenerator 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 Namespaces_Eventhub_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Eventhub_STATUS_ARMGenerator != nil { + return namespaces_Eventhub_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(generators) + namespaces_Eventhub_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(generators) + namespaces_Eventhub_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS_ARM{}), generators) + + return namespaces_Eventhub_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_Eventhub_Properties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_Namespaces_Eventhub_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_Properties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Properties_STATUS_ARM, Namespaces_Eventhub_Properties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhub_Properties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_Properties_STATUS_ARM(subject Namespaces_Eventhub_Properties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_Properties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhub_Properties_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Eventhub_Properties_STATUS_ARMGenerator() +var namespaces_Eventhub_Properties_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Eventhub_Properties_STATUS_ARMGenerator returns a generator of Namespaces_Eventhub_Properties_STATUS_ARM instances for property testing. +// We first initialize namespaces_Eventhub_Properties_STATUS_ARMGenerator 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 Namespaces_Eventhub_Properties_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Eventhub_Properties_STATUS_ARMGenerator != nil { + return namespaces_Eventhub_Properties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(generators) + namespaces_Eventhub_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(generators) + namespaces_Eventhub_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_STATUS_ARM{}), generators) + + return namespaces_Eventhub_Properties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) + gens["PartitionCount"] = gen.PtrOf(gen.Int()) + gens["PartitionIds"] = gen.SliceOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + Namespaces_Eventhub_Properties_Status_STATUS_Active, + Namespaces_Eventhub_Properties_Status_STATUS_Creating, + Namespaces_Eventhub_Properties_Status_STATUS_Deleting, + Namespaces_Eventhub_Properties_Status_STATUS_Disabled, + Namespaces_Eventhub_Properties_Status_STATUS_ReceiveDisabled, + Namespaces_Eventhub_Properties_Status_STATUS_Renaming, + Namespaces_Eventhub_Properties_Status_STATUS_Restoring, + Namespaces_Eventhub_Properties_Status_STATUS_SendDisabled, + Namespaces_Eventhub_Properties_Status_STATUS_Unknown)) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_STATUS_ARMGenerator()) + gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_STATUS_ARMGenerator()) +} + +func Test_CaptureDescription_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureDescription_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureDescription_STATUS_ARM, CaptureDescription_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureDescription_STATUS_ARM runs a test to see if a specific instance of CaptureDescription_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureDescription_STATUS_ARM(subject CaptureDescription_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureDescription_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureDescription_STATUS_ARM instances for property testing - lazily instantiated by +// CaptureDescription_STATUS_ARMGenerator() +var captureDescription_STATUS_ARMGenerator gopter.Gen + +// CaptureDescription_STATUS_ARMGenerator returns a generator of CaptureDescription_STATUS_ARM instances for property testing. +// We first initialize captureDescription_STATUS_ARMGenerator 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 CaptureDescription_STATUS_ARMGenerator() gopter.Gen { + if captureDescription_STATUS_ARMGenerator != nil { + return captureDescription_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM(generators) + captureDescription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForCaptureDescription_STATUS_ARM(generators) + captureDescription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS_ARM{}), generators) + + return captureDescription_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_STATUS_Avro, CaptureDescription_Encoding_STATUS_AvroDeflate)) + gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) + gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) + gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForCaptureDescription_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Destination"] = gen.PtrOf(Destination_STATUS_ARMGenerator()) +} + +func Test_RetentionDescription_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RetentionDescription_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRetentionDescription_STATUS_ARM, RetentionDescription_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRetentionDescription_STATUS_ARM runs a test to see if a specific instance of RetentionDescription_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForRetentionDescription_STATUS_ARM(subject RetentionDescription_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RetentionDescription_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RetentionDescription_STATUS_ARM instances for property testing - lazily instantiated by +// RetentionDescription_STATUS_ARMGenerator() +var retentionDescription_STATUS_ARMGenerator gopter.Gen + +// RetentionDescription_STATUS_ARMGenerator returns a generator of RetentionDescription_STATUS_ARM instances for property testing. +func RetentionDescription_STATUS_ARMGenerator() gopter.Gen { + if retentionDescription_STATUS_ARMGenerator != nil { + return retentionDescription_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRetentionDescription_STATUS_ARM(generators) + retentionDescription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_STATUS_ARM{}), generators) + + return retentionDescription_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForRetentionDescription_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRetentionDescription_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_STATUS_Compact, RetentionDescription_CleanupPolicy_STATUS_Delete)) + gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) + gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) +} + +func Test_Destination_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination_STATUS_ARM, Destination_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination_STATUS_ARM runs a test to see if a specific instance of Destination_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination_STATUS_ARM(subject Destination_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Destination_STATUS_ARM instances for property testing - lazily instantiated by +// Destination_STATUS_ARMGenerator() +var destination_STATUS_ARMGenerator gopter.Gen + +// Destination_STATUS_ARMGenerator returns a generator of Destination_STATUS_ARM instances for property testing. +// We first initialize destination_STATUS_ARMGenerator 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 Destination_STATUS_ARMGenerator() gopter.Gen { + if destination_STATUS_ARMGenerator != nil { + return destination_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_STATUS_ARM(generators) + destination_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForDestination_STATUS_ARM(generators) + destination_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS_ARM{}), generators) + + return destination_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForDestination_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForDestination_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForDestination_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(CaptureIdentity_STATUS_ARMGenerator()) + gens["Properties"] = gen.PtrOf(Destination_Properties_STATUS_ARMGenerator()) +} + +func Test_CaptureIdentity_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureIdentity_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureIdentity_STATUS_ARM, CaptureIdentity_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureIdentity_STATUS_ARM runs a test to see if a specific instance of CaptureIdentity_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureIdentity_STATUS_ARM(subject CaptureIdentity_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureIdentity_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureIdentity_STATUS_ARM instances for property testing - lazily instantiated by +// CaptureIdentity_STATUS_ARMGenerator() +var captureIdentity_STATUS_ARMGenerator gopter.Gen + +// CaptureIdentity_STATUS_ARMGenerator returns a generator of CaptureIdentity_STATUS_ARM instances for property testing. +func CaptureIdentity_STATUS_ARMGenerator() gopter.Gen { + if captureIdentity_STATUS_ARMGenerator != nil { + return captureIdentity_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS_ARM(generators) + captureIdentity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_STATUS_ARM{}), generators) + + return captureIdentity_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_STATUS_SystemAssigned, CaptureIdentity_Type_STATUS_UserAssigned)) + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Destination_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination_Properties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination_Properties_STATUS_ARM, Destination_Properties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination_Properties_STATUS_ARM runs a test to see if a specific instance of Destination_Properties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination_Properties_STATUS_ARM(subject Destination_Properties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination_Properties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Destination_Properties_STATUS_ARM instances for property testing - lazily instantiated by +// Destination_Properties_STATUS_ARMGenerator() +var destination_Properties_STATUS_ARMGenerator gopter.Gen + +// Destination_Properties_STATUS_ARMGenerator returns a generator of Destination_Properties_STATUS_ARM instances for property testing. +func Destination_Properties_STATUS_ARMGenerator() gopter.Gen { + if destination_Properties_STATUS_ARMGenerator != nil { + return destination_Properties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_Properties_STATUS_ARM(generators) + destination_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_Properties_STATUS_ARM{}), generators) + + return destination_Properties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForDestination_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) + gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go new file mode 100644 index 00000000000..79d730e9a85 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go @@ -0,0 +1,2660 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} +type NamespacesEventhub struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Eventhub_Spec `json:"spec,omitempty"` + Status Namespaces_Eventhub_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesEventhub{} + +// GetConditions returns the conditions of the resource +func (eventhub *NamespacesEventhub) GetConditions() conditions.Conditions { + return eventhub.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (eventhub *NamespacesEventhub) SetConditions(conditions conditions.Conditions) { + eventhub.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesEventhub{} + +// ConvertFrom populates our NamespacesEventhub from the provided hub NamespacesEventhub +func (eventhub *NamespacesEventhub) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesEventhub) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) + } + + return eventhub.AssignProperties_From_NamespacesEventhub(source) +} + +// ConvertTo populates the provided hub NamespacesEventhub from our NamespacesEventhub +func (eventhub *NamespacesEventhub) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesEventhub) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) + } + + return eventhub.AssignProperties_To_NamespacesEventhub(destination) +} + +// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespaceseventhub,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaceseventhubs.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesEventhub{} + +// Default applies defaults to the NamespacesEventhub resource +func (eventhub *NamespacesEventhub) Default() { + eventhub.defaultImpl() + var temp any = eventhub + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (eventhub *NamespacesEventhub) defaultAzureName() { + if eventhub.Spec.AzureName == "" { + eventhub.Spec.AzureName = eventhub.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesEventhub resource +func (eventhub *NamespacesEventhub) defaultImpl() { eventhub.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesEventhub{} + +// InitializeSpec initializes the spec for this resource from the given status +func (eventhub *NamespacesEventhub) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Eventhub_STATUS); ok { + return eventhub.Spec.Initialize_From_Namespaces_Eventhub_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Eventhub_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesEventhub{} + +// AzureName returns the Azure name of the resource +func (eventhub *NamespacesEventhub) AzureName() string { + return eventhub.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (eventhub NamespacesEventhub) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (eventhub *NamespacesEventhub) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (eventhub *NamespacesEventhub) GetSpec() genruntime.ConvertibleSpec { + return &eventhub.Spec +} + +// GetStatus returns the status of this resource +func (eventhub *NamespacesEventhub) GetStatus() genruntime.ConvertibleStatus { + return &eventhub.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (eventhub *NamespacesEventhub) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs" +func (eventhub *NamespacesEventhub) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs" +} + +// NewEmptyStatus returns a new empty (blank) status +func (eventhub *NamespacesEventhub) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Eventhub_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (eventhub *NamespacesEventhub) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(eventhub.Spec) + return eventhub.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (eventhub *NamespacesEventhub) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Eventhub_STATUS); ok { + eventhub.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Eventhub_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + eventhub.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespaceseventhub,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaceseventhubs.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesEventhub{} + +// ValidateCreate validates the creation of the resource +func (eventhub *NamespacesEventhub) ValidateCreate() (admission.Warnings, error) { + validations := eventhub.createValidations() + var temp any = eventhub + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (eventhub *NamespacesEventhub) ValidateDelete() (admission.Warnings, error) { + validations := eventhub.deleteValidations() + var temp any = eventhub + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (eventhub *NamespacesEventhub) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := eventhub.updateValidations() + var temp any = eventhub + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + return genruntime.ValidateUpdate(old, validations) +} + +// createValidations validates the creation of the resource +func (eventhub *NamespacesEventhub) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){eventhub.validateResourceReferences, eventhub.validateOwnerReference} +} + +// deleteValidations validates the deletion of the resource +func (eventhub *NamespacesEventhub) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (eventhub *NamespacesEventhub) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return eventhub.validateResourceReferences() + }, + eventhub.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return eventhub.validateOwnerReference() + }, + } +} + +// validateOwnerReference validates the owner field +func (eventhub *NamespacesEventhub) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(eventhub) +} + +// validateResourceReferences validates all resource references +func (eventhub *NamespacesEventhub) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&eventhub.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (eventhub *NamespacesEventhub) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesEventhub) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, eventhub) +} + +// AssignProperties_From_NamespacesEventhub populates our NamespacesEventhub from the provided source NamespacesEventhub +func (eventhub *NamespacesEventhub) AssignProperties_From_NamespacesEventhub(source *v20240101s.NamespacesEventhub) error { + + // ObjectMeta + eventhub.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Eventhub_Spec + err := spec.AssignProperties_From_Namespaces_Eventhub_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_Spec() to populate field Spec") + } + eventhub.Spec = spec + + // Status + var status Namespaces_Eventhub_STATUS + err = status.AssignProperties_From_Namespaces_Eventhub_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_STATUS() to populate field Status") + } + eventhub.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhub populates the provided destination NamespacesEventhub from our NamespacesEventhub +func (eventhub *NamespacesEventhub) AssignProperties_To_NamespacesEventhub(destination *v20240101s.NamespacesEventhub) error { + + // ObjectMeta + destination.ObjectMeta = *eventhub.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_Eventhub_Spec + err := eventhub.Spec.AssignProperties_To_Namespaces_Eventhub_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_Eventhub_STATUS + err = eventhub.Status.AssignProperties_To_Namespaces_Eventhub_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_STATUS() to populate field Status") + } + destination.Status = status + + // No error + return nil +} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (eventhub *NamespacesEventhub) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: eventhub.Spec.OriginalVersion(), + Kind: "NamespacesEventhub", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} +type NamespacesEventhubList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesEventhub `json:"items"` +} + +type Namespaces_Eventhub_Spec struct { + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:MinLength=1 + // 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"` + + // CaptureDescription: Properties of capture description + CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"` + + // +kubebuilder:validation:Minimum=1 + // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days + MessageRetentionInDays *int `json:"messageRetentionInDays,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 eventhub.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` + + // +kubebuilder:validation:Minimum=1 + // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + PartitionCount *int `json:"partitionCount,omitempty"` + + // RetentionDescription: Event Hub retention settings + RetentionDescription *RetentionDescription `json:"retentionDescription,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Eventhub_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (eventhub *Namespaces_Eventhub_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if eventhub == nil { + return nil, nil + } + result := &Namespaces_Eventhub_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if eventhub.CaptureDescription != nil || + eventhub.MessageRetentionInDays != nil || + eventhub.PartitionCount != nil || + eventhub.RetentionDescription != nil { + result.Properties = &Namespaces_Eventhub_Properties_Spec_ARM{} + } + if eventhub.CaptureDescription != nil { + captureDescription_ARM, err := (*eventhub.CaptureDescription).ConvertToARM(resolved) + if err != nil { + return nil, err + } + captureDescription := *captureDescription_ARM.(*CaptureDescription_ARM) + result.Properties.CaptureDescription = &captureDescription + } + if eventhub.MessageRetentionInDays != nil { + messageRetentionInDays := *eventhub.MessageRetentionInDays + result.Properties.MessageRetentionInDays = &messageRetentionInDays + } + if eventhub.PartitionCount != nil { + partitionCount := *eventhub.PartitionCount + result.Properties.PartitionCount = &partitionCount + } + if eventhub.RetentionDescription != nil { + retentionDescription_ARM, err := (*eventhub.RetentionDescription).ConvertToARM(resolved) + if err != nil { + return nil, err + } + retentionDescription := *retentionDescription_ARM.(*RetentionDescription_ARM) + result.Properties.RetentionDescription = &retentionDescription + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (eventhub *Namespaces_Eventhub_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Eventhub_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (eventhub *Namespaces_Eventhub_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Eventhub_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhub_Spec_ARM, got %T", armInput) + } + + // Set property "AzureName": + eventhub.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "CaptureDescription": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CaptureDescription != nil { + var captureDescription1 CaptureDescription + err := captureDescription1.PopulateFromARM(owner, *typedInput.Properties.CaptureDescription) + if err != nil { + return err + } + captureDescription := captureDescription1 + eventhub.CaptureDescription = &captureDescription + } + } + + // Set property "MessageRetentionInDays": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MessageRetentionInDays != nil { + messageRetentionInDays := *typedInput.Properties.MessageRetentionInDays + eventhub.MessageRetentionInDays = &messageRetentionInDays + } + } + + // Set property "Owner": + eventhub.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "PartitionCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PartitionCount != nil { + partitionCount := *typedInput.Properties.PartitionCount + eventhub.PartitionCount = &partitionCount + } + } + + // Set property "RetentionDescription": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RetentionDescription != nil { + var retentionDescription1 RetentionDescription + err := retentionDescription1.PopulateFromARM(owner, *typedInput.Properties.RetentionDescription) + if err != nil { + return err + } + retentionDescription := retentionDescription1 + eventhub.RetentionDescription = &retentionDescription + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Eventhub_Spec{} + +// ConvertSpecFrom populates our Namespaces_Eventhub_Spec from the provided source +func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20240101s.Namespaces_Eventhub_Spec) + if ok { + // Populate our instance from source + return eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhub_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Eventhub_Spec +func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20240101s.Namespaces_Eventhub_Spec) + if ok { + // Populate destination from our instance + return eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhub_Spec{} + err := eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(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 +} + +// AssignProperties_From_Namespaces_Eventhub_Spec populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_Spec +func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_From_Namespaces_Eventhub_Spec(source *v20240101s.Namespaces_Eventhub_Spec) error { + + // AzureName + eventhub.AzureName = source.AzureName + + // CaptureDescription + if source.CaptureDescription != nil { + var captureDescription CaptureDescription + err := captureDescription.AssignProperties_From_CaptureDescription(source.CaptureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription() to populate field CaptureDescription") + } + eventhub.CaptureDescription = &captureDescription + } else { + eventhub.CaptureDescription = nil + } + + // MessageRetentionInDays + if source.MessageRetentionInDays != nil { + messageRetentionInDay := *source.MessageRetentionInDays + eventhub.MessageRetentionInDays = &messageRetentionInDay + } else { + eventhub.MessageRetentionInDays = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + eventhub.Owner = &owner + } else { + eventhub.Owner = nil + } + + // PartitionCount + if source.PartitionCount != nil { + partitionCount := *source.PartitionCount + eventhub.PartitionCount = &partitionCount + } else { + eventhub.PartitionCount = nil + } + + // RetentionDescription + if source.RetentionDescription != nil { + var retentionDescription RetentionDescription + err := retentionDescription.AssignProperties_From_RetentionDescription(source.RetentionDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_RetentionDescription() to populate field RetentionDescription") + } + eventhub.RetentionDescription = &retentionDescription + } else { + eventhub.RetentionDescription = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhub_Spec populates the provided destination Namespaces_Eventhub_Spec from our Namespaces_Eventhub_Spec +func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_To_Namespaces_Eventhub_Spec(destination *v20240101s.Namespaces_Eventhub_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = eventhub.AzureName + + // CaptureDescription + if eventhub.CaptureDescription != nil { + var captureDescription v20240101s.CaptureDescription + err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription(&captureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription() to populate field CaptureDescription") + } + destination.CaptureDescription = &captureDescription + } else { + destination.CaptureDescription = nil + } + + // MessageRetentionInDays + if eventhub.MessageRetentionInDays != nil { + messageRetentionInDay := *eventhub.MessageRetentionInDays + destination.MessageRetentionInDays = &messageRetentionInDay + } else { + destination.MessageRetentionInDays = nil + } + + // OriginalVersion + destination.OriginalVersion = eventhub.OriginalVersion() + + // Owner + if eventhub.Owner != nil { + owner := eventhub.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // PartitionCount + if eventhub.PartitionCount != nil { + partitionCount := *eventhub.PartitionCount + destination.PartitionCount = &partitionCount + } else { + destination.PartitionCount = nil + } + + // RetentionDescription + if eventhub.RetentionDescription != nil { + var retentionDescription v20240101s.RetentionDescription + err := eventhub.RetentionDescription.AssignProperties_To_RetentionDescription(&retentionDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_RetentionDescription() to populate field RetentionDescription") + } + destination.RetentionDescription = &retentionDescription + } else { + destination.RetentionDescription = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_Spec) Initialize_From_Namespaces_Eventhub_STATUS(source *Namespaces_Eventhub_STATUS) error { + + // CaptureDescription + if source.CaptureDescription != nil { + var captureDescription CaptureDescription + err := captureDescription.Initialize_From_CaptureDescription_STATUS(source.CaptureDescription) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_CaptureDescription_STATUS() to populate field CaptureDescription") + } + eventhub.CaptureDescription = &captureDescription + } else { + eventhub.CaptureDescription = nil + } + + // MessageRetentionInDays + if source.MessageRetentionInDays != nil { + messageRetentionInDay := *source.MessageRetentionInDays + eventhub.MessageRetentionInDays = &messageRetentionInDay + } else { + eventhub.MessageRetentionInDays = nil + } + + // PartitionCount + if source.PartitionCount != nil { + partitionCount := *source.PartitionCount + eventhub.PartitionCount = &partitionCount + } else { + eventhub.PartitionCount = nil + } + + // RetentionDescription + if source.RetentionDescription != nil { + var retentionDescription RetentionDescription + err := retentionDescription.Initialize_From_RetentionDescription_STATUS(source.RetentionDescription) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_RetentionDescription_STATUS() to populate field RetentionDescription") + } + eventhub.RetentionDescription = &retentionDescription + } else { + eventhub.RetentionDescription = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (eventhub *Namespaces_Eventhub_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (eventhub *Namespaces_Eventhub_Spec) SetAzureName(azureName string) { + eventhub.AzureName = azureName +} + +type Namespaces_Eventhub_STATUS struct { + // CaptureDescription: Properties of capture description + CaptureDescription *CaptureDescription_STATUS `json:"captureDescription,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CreatedAt: Exact time the Event Hub was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days + MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + PartitionCount *int `json:"partitionCount,omitempty"` + + // PartitionIds: Current number of shards on the Event Hub. + PartitionIds []string `json:"partitionIds,omitempty"` + + // RetentionDescription: Event Hub retention settings + RetentionDescription *RetentionDescription_STATUS `json:"retentionDescription,omitempty"` + + // Status: Enumerates the possible values for the status of the Event Hub. + Status *Namespaces_Eventhub_Properties_Status_STATUS `json:"status,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Eventhub_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Eventhub_STATUS from the provided source +func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20240101s.Namespaces_Eventhub_STATUS) + if ok { + // Populate our instance from source + return eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhub_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20240101s.Namespaces_Eventhub_STATUS) + if ok { + // Populate destination from our instance + return eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhub_STATUS{} + err := eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(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 = &Namespaces_Eventhub_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (eventhub *Namespaces_Eventhub_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Eventhub_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (eventhub *Namespaces_Eventhub_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Eventhub_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhub_STATUS_ARM, got %T", armInput) + } + + // Set property "CaptureDescription": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CaptureDescription != nil { + var captureDescription1 CaptureDescription_STATUS + err := captureDescription1.PopulateFromARM(owner, *typedInput.Properties.CaptureDescription) + if err != nil { + return err + } + captureDescription := captureDescription1 + eventhub.CaptureDescription = &captureDescription + } + } + + // no assignment for property "Conditions" + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + eventhub.CreatedAt = &createdAt + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + eventhub.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + eventhub.Location = &location + } + + // Set property "MessageRetentionInDays": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MessageRetentionInDays != nil { + messageRetentionInDays := *typedInput.Properties.MessageRetentionInDays + eventhub.MessageRetentionInDays = &messageRetentionInDays + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + eventhub.Name = &name + } + + // Set property "PartitionCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PartitionCount != nil { + partitionCount := *typedInput.Properties.PartitionCount + eventhub.PartitionCount = &partitionCount + } + } + + // Set property "PartitionIds": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.PartitionIds { + eventhub.PartitionIds = append(eventhub.PartitionIds, item) + } + } + + // Set property "RetentionDescription": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RetentionDescription != nil { + var retentionDescription1 RetentionDescription_STATUS + err := retentionDescription1.PopulateFromARM(owner, *typedInput.Properties.RetentionDescription) + if err != nil { + return err + } + retentionDescription := retentionDescription1 + eventhub.RetentionDescription = &retentionDescription + } + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + eventhub.Status = &status + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + eventhub.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + eventhub.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + eventhub.UpdatedAt = &updatedAt + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_STATUS from the provided source Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_From_Namespaces_Eventhub_STATUS(source *v20240101s.Namespaces_Eventhub_STATUS) error { + + // CaptureDescription + if source.CaptureDescription != nil { + var captureDescription CaptureDescription_STATUS + err := captureDescription.AssignProperties_From_CaptureDescription_STATUS(source.CaptureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription_STATUS() to populate field CaptureDescription") + } + eventhub.CaptureDescription = &captureDescription + } else { + eventhub.CaptureDescription = nil + } + + // Conditions + eventhub.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedAt + eventhub.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // Id + eventhub.Id = genruntime.ClonePointerToString(source.Id) + + // Location + eventhub.Location = genruntime.ClonePointerToString(source.Location) + + // MessageRetentionInDays + eventhub.MessageRetentionInDays = genruntime.ClonePointerToInt(source.MessageRetentionInDays) + + // Name + eventhub.Name = genruntime.ClonePointerToString(source.Name) + + // PartitionCount + eventhub.PartitionCount = genruntime.ClonePointerToInt(source.PartitionCount) + + // PartitionIds + eventhub.PartitionIds = genruntime.CloneSliceOfString(source.PartitionIds) + + // RetentionDescription + if source.RetentionDescription != nil { + var retentionDescription RetentionDescription_STATUS + err := retentionDescription.AssignProperties_From_RetentionDescription_STATUS(source.RetentionDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_RetentionDescription_STATUS() to populate field RetentionDescription") + } + eventhub.RetentionDescription = &retentionDescription + } else { + eventhub.RetentionDescription = nil + } + + // Status + if source.Status != nil { + status := Namespaces_Eventhub_Properties_Status_STATUS(*source.Status) + eventhub.Status = &status + } else { + eventhub.Status = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + eventhub.SystemData = &systemDatum + } else { + eventhub.SystemData = nil + } + + // Type + eventhub.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + eventhub.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhub_STATUS populates the provided destination Namespaces_Eventhub_STATUS from our Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_To_Namespaces_Eventhub_STATUS(destination *v20240101s.Namespaces_Eventhub_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CaptureDescription + if eventhub.CaptureDescription != nil { + var captureDescription v20240101s.CaptureDescription_STATUS + err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription_STATUS(&captureDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription_STATUS() to populate field CaptureDescription") + } + destination.CaptureDescription = &captureDescription + } else { + destination.CaptureDescription = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(eventhub.Conditions) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(eventhub.CreatedAt) + + // Id + destination.Id = genruntime.ClonePointerToString(eventhub.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(eventhub.Location) + + // MessageRetentionInDays + destination.MessageRetentionInDays = genruntime.ClonePointerToInt(eventhub.MessageRetentionInDays) + + // Name + destination.Name = genruntime.ClonePointerToString(eventhub.Name) + + // PartitionCount + destination.PartitionCount = genruntime.ClonePointerToInt(eventhub.PartitionCount) + + // PartitionIds + destination.PartitionIds = genruntime.CloneSliceOfString(eventhub.PartitionIds) + + // RetentionDescription + if eventhub.RetentionDescription != nil { + var retentionDescription v20240101s.RetentionDescription_STATUS + err := eventhub.RetentionDescription.AssignProperties_To_RetentionDescription_STATUS(&retentionDescription) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_RetentionDescription_STATUS() to populate field RetentionDescription") + } + destination.RetentionDescription = &retentionDescription + } else { + destination.RetentionDescription = nil + } + + // Status + if eventhub.Status != nil { + status := string(*eventhub.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // SystemData + if eventhub.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := eventhub.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(eventhub.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(eventhub.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Properties to configure capture description for eventhub +type CaptureDescription struct { + // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) + Destination *Destination `json:"destination,omitempty"` + + // Enabled: A value that indicates whether capture description is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be + // deprecated in New API Version + Encoding *CaptureDescription_Encoding `json:"encoding,omitempty"` + + // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, + // value should between 60 to 900 seconds + IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` + + // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, + // value should be between 10485760 to 524288000 bytes + SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` + + // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives + SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` +} + +var _ genruntime.ARMTransformer = &CaptureDescription{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (description *CaptureDescription) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if description == nil { + return nil, nil + } + result := &CaptureDescription_ARM{} + + // Set property "Destination": + if description.Destination != nil { + destination_ARM, err := (*description.Destination).ConvertToARM(resolved) + if err != nil { + return nil, err + } + destination := *destination_ARM.(*Destination_ARM) + result.Destination = &destination + } + + // Set property "Enabled": + if description.Enabled != nil { + enabled := *description.Enabled + result.Enabled = &enabled + } + + // Set property "Encoding": + if description.Encoding != nil { + encoding := *description.Encoding + result.Encoding = &encoding + } + + // Set property "IntervalInSeconds": + if description.IntervalInSeconds != nil { + intervalInSeconds := *description.IntervalInSeconds + result.IntervalInSeconds = &intervalInSeconds + } + + // Set property "SizeLimitInBytes": + if description.SizeLimitInBytes != nil { + sizeLimitInBytes := *description.SizeLimitInBytes + result.SizeLimitInBytes = &sizeLimitInBytes + } + + // Set property "SkipEmptyArchives": + if description.SkipEmptyArchives != nil { + skipEmptyArchives := *description.SkipEmptyArchives + result.SkipEmptyArchives = &skipEmptyArchives + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (description *CaptureDescription) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CaptureDescription_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (description *CaptureDescription) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CaptureDescription_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureDescription_ARM, got %T", armInput) + } + + // Set property "Destination": + if typedInput.Destination != nil { + var destination1 Destination + err := destination1.PopulateFromARM(owner, *typedInput.Destination) + if err != nil { + return err + } + destination := destination1 + description.Destination = &destination + } + + // Set property "Enabled": + if typedInput.Enabled != nil { + enabled := *typedInput.Enabled + description.Enabled = &enabled + } + + // Set property "Encoding": + if typedInput.Encoding != nil { + encoding := *typedInput.Encoding + description.Encoding = &encoding + } + + // Set property "IntervalInSeconds": + if typedInput.IntervalInSeconds != nil { + intervalInSeconds := *typedInput.IntervalInSeconds + description.IntervalInSeconds = &intervalInSeconds + } + + // Set property "SizeLimitInBytes": + if typedInput.SizeLimitInBytes != nil { + sizeLimitInBytes := *typedInput.SizeLimitInBytes + description.SizeLimitInBytes = &sizeLimitInBytes + } + + // Set property "SkipEmptyArchives": + if typedInput.SkipEmptyArchives != nil { + skipEmptyArchives := *typedInput.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchives + } + + // No error + return nil +} + +// AssignProperties_From_CaptureDescription populates our CaptureDescription from the provided source CaptureDescription +func (description *CaptureDescription) AssignProperties_From_CaptureDescription(source *v20240101s.CaptureDescription) error { + + // Destination + if source.Destination != nil { + var destination Destination + err := destination.AssignProperties_From_Destination(source.Destination) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Destination() to populate field Destination") + } + description.Destination = &destination + } else { + description.Destination = nil + } + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + description.Enabled = &enabled + } else { + description.Enabled = nil + } + + // Encoding + if source.Encoding != nil { + encoding := CaptureDescription_Encoding(*source.Encoding) + description.Encoding = &encoding + } else { + description.Encoding = nil + } + + // IntervalInSeconds + description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) + + // SizeLimitInBytes + description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) + + // SkipEmptyArchives + if source.SkipEmptyArchives != nil { + skipEmptyArchive := *source.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchive + } else { + description.SkipEmptyArchives = nil + } + + // No error + return nil +} + +// AssignProperties_To_CaptureDescription populates the provided destination CaptureDescription from our CaptureDescription +func (description *CaptureDescription) AssignProperties_To_CaptureDescription(destination *v20240101s.CaptureDescription) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Destination + if description.Destination != nil { + var destinationLocal v20240101s.Destination + err := description.Destination.AssignProperties_To_Destination(&destinationLocal) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Destination() to populate field Destination") + } + destination.Destination = &destinationLocal + } else { + destination.Destination = nil + } + + // Enabled + if description.Enabled != nil { + enabled := *description.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Encoding + if description.Encoding != nil { + encoding := string(*description.Encoding) + destination.Encoding = &encoding + } else { + destination.Encoding = nil + } + + // IntervalInSeconds + destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) + + // SizeLimitInBytes + destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) + + // SkipEmptyArchives + if description.SkipEmptyArchives != nil { + skipEmptyArchive := *description.SkipEmptyArchives + destination.SkipEmptyArchives = &skipEmptyArchive + } else { + destination.SkipEmptyArchives = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_CaptureDescription_STATUS populates our CaptureDescription from the provided source CaptureDescription_STATUS +func (description *CaptureDescription) Initialize_From_CaptureDescription_STATUS(source *CaptureDescription_STATUS) error { + + // Destination + if source.Destination != nil { + var destination Destination + err := destination.Initialize_From_Destination_STATUS(source.Destination) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Destination_STATUS() to populate field Destination") + } + description.Destination = &destination + } else { + description.Destination = nil + } + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + description.Enabled = &enabled + } else { + description.Enabled = nil + } + + // Encoding + if source.Encoding != nil { + encoding := CaptureDescription_Encoding(*source.Encoding) + description.Encoding = &encoding + } else { + description.Encoding = nil + } + + // IntervalInSeconds + description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) + + // SizeLimitInBytes + description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) + + // SkipEmptyArchives + if source.SkipEmptyArchives != nil { + skipEmptyArchive := *source.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchive + } else { + description.SkipEmptyArchives = nil + } + + // No error + return nil +} + +// Properties to configure capture description for eventhub +type CaptureDescription_STATUS struct { + // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) + Destination *Destination_STATUS `json:"destination,omitempty"` + + // Enabled: A value that indicates whether capture description is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be + // deprecated in New API Version + Encoding *CaptureDescription_Encoding_STATUS `json:"encoding,omitempty"` + + // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, + // value should between 60 to 900 seconds + IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` + + // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, + // value should be between 10485760 to 524288000 bytes + SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` + + // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives + SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` +} + +var _ genruntime.FromARMConverter = &CaptureDescription_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (description *CaptureDescription_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CaptureDescription_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (description *CaptureDescription_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CaptureDescription_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureDescription_STATUS_ARM, got %T", armInput) + } + + // Set property "Destination": + if typedInput.Destination != nil { + var destination1 Destination_STATUS + err := destination1.PopulateFromARM(owner, *typedInput.Destination) + if err != nil { + return err + } + destination := destination1 + description.Destination = &destination + } + + // Set property "Enabled": + if typedInput.Enabled != nil { + enabled := *typedInput.Enabled + description.Enabled = &enabled + } + + // Set property "Encoding": + if typedInput.Encoding != nil { + encoding := *typedInput.Encoding + description.Encoding = &encoding + } + + // Set property "IntervalInSeconds": + if typedInput.IntervalInSeconds != nil { + intervalInSeconds := *typedInput.IntervalInSeconds + description.IntervalInSeconds = &intervalInSeconds + } + + // Set property "SizeLimitInBytes": + if typedInput.SizeLimitInBytes != nil { + sizeLimitInBytes := *typedInput.SizeLimitInBytes + description.SizeLimitInBytes = &sizeLimitInBytes + } + + // Set property "SkipEmptyArchives": + if typedInput.SkipEmptyArchives != nil { + skipEmptyArchives := *typedInput.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchives + } + + // No error + return nil +} + +// AssignProperties_From_CaptureDescription_STATUS populates our CaptureDescription_STATUS from the provided source CaptureDescription_STATUS +func (description *CaptureDescription_STATUS) AssignProperties_From_CaptureDescription_STATUS(source *v20240101s.CaptureDescription_STATUS) error { + + // Destination + if source.Destination != nil { + var destination Destination_STATUS + err := destination.AssignProperties_From_Destination_STATUS(source.Destination) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Destination_STATUS() to populate field Destination") + } + description.Destination = &destination + } else { + description.Destination = nil + } + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + description.Enabled = &enabled + } else { + description.Enabled = nil + } + + // Encoding + if source.Encoding != nil { + encoding := CaptureDescription_Encoding_STATUS(*source.Encoding) + description.Encoding = &encoding + } else { + description.Encoding = nil + } + + // IntervalInSeconds + description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) + + // SizeLimitInBytes + description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) + + // SkipEmptyArchives + if source.SkipEmptyArchives != nil { + skipEmptyArchive := *source.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchive + } else { + description.SkipEmptyArchives = nil + } + + // No error + return nil +} + +// AssignProperties_To_CaptureDescription_STATUS populates the provided destination CaptureDescription_STATUS from our CaptureDescription_STATUS +func (description *CaptureDescription_STATUS) AssignProperties_To_CaptureDescription_STATUS(destination *v20240101s.CaptureDescription_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Destination + if description.Destination != nil { + var destinationLocal v20240101s.Destination_STATUS + err := description.Destination.AssignProperties_To_Destination_STATUS(&destinationLocal) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Destination_STATUS() to populate field Destination") + } + destination.Destination = &destinationLocal + } else { + destination.Destination = nil + } + + // Enabled + if description.Enabled != nil { + enabled := *description.Enabled + destination.Enabled = &enabled + } else { + destination.Enabled = nil + } + + // Encoding + if description.Encoding != nil { + encoding := string(*description.Encoding) + destination.Encoding = &encoding + } else { + destination.Encoding = nil + } + + // IntervalInSeconds + destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) + + // SizeLimitInBytes + destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) + + // SkipEmptyArchives + if description.SkipEmptyArchives != nil { + skipEmptyArchive := *description.SkipEmptyArchives + destination.SkipEmptyArchives = &skipEmptyArchive + } else { + destination.SkipEmptyArchives = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +type Namespaces_Eventhub_Properties_Status_STATUS string + +const ( + Namespaces_Eventhub_Properties_Status_STATUS_Active = Namespaces_Eventhub_Properties_Status_STATUS("Active") + Namespaces_Eventhub_Properties_Status_STATUS_Creating = Namespaces_Eventhub_Properties_Status_STATUS("Creating") + Namespaces_Eventhub_Properties_Status_STATUS_Deleting = Namespaces_Eventhub_Properties_Status_STATUS("Deleting") + Namespaces_Eventhub_Properties_Status_STATUS_Disabled = Namespaces_Eventhub_Properties_Status_STATUS("Disabled") + Namespaces_Eventhub_Properties_Status_STATUS_ReceiveDisabled = Namespaces_Eventhub_Properties_Status_STATUS("ReceiveDisabled") + Namespaces_Eventhub_Properties_Status_STATUS_Renaming = Namespaces_Eventhub_Properties_Status_STATUS("Renaming") + Namespaces_Eventhub_Properties_Status_STATUS_Restoring = Namespaces_Eventhub_Properties_Status_STATUS("Restoring") + Namespaces_Eventhub_Properties_Status_STATUS_SendDisabled = Namespaces_Eventhub_Properties_Status_STATUS("SendDisabled") + Namespaces_Eventhub_Properties_Status_STATUS_Unknown = Namespaces_Eventhub_Properties_Status_STATUS("Unknown") +) + +// Properties to configure retention settings for the eventhub +type RetentionDescription struct { + // CleanupPolicy: Enumerates the possible values for cleanup policy + CleanupPolicy *RetentionDescription_CleanupPolicy `json:"cleanupPolicy,omitempty"` + + // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when + // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue + RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` + + // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is + // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified + // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key + // described by the tombstone marker within the compacted Event Hub + TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` +} + +var _ genruntime.ARMTransformer = &RetentionDescription{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (description *RetentionDescription) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if description == nil { + return nil, nil + } + result := &RetentionDescription_ARM{} + + // Set property "CleanupPolicy": + if description.CleanupPolicy != nil { + cleanupPolicy := *description.CleanupPolicy + result.CleanupPolicy = &cleanupPolicy + } + + // Set property "RetentionTimeInHours": + if description.RetentionTimeInHours != nil { + retentionTimeInHours := *description.RetentionTimeInHours + result.RetentionTimeInHours = &retentionTimeInHours + } + + // Set property "TombstoneRetentionTimeInHours": + if description.TombstoneRetentionTimeInHours != nil { + tombstoneRetentionTimeInHours := *description.TombstoneRetentionTimeInHours + result.TombstoneRetentionTimeInHours = &tombstoneRetentionTimeInHours + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (description *RetentionDescription) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &RetentionDescription_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (description *RetentionDescription) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(RetentionDescription_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected RetentionDescription_ARM, got %T", armInput) + } + + // Set property "CleanupPolicy": + if typedInput.CleanupPolicy != nil { + cleanupPolicy := *typedInput.CleanupPolicy + description.CleanupPolicy = &cleanupPolicy + } + + // Set property "RetentionTimeInHours": + if typedInput.RetentionTimeInHours != nil { + retentionTimeInHours := *typedInput.RetentionTimeInHours + description.RetentionTimeInHours = &retentionTimeInHours + } + + // Set property "TombstoneRetentionTimeInHours": + if typedInput.TombstoneRetentionTimeInHours != nil { + tombstoneRetentionTimeInHours := *typedInput.TombstoneRetentionTimeInHours + description.TombstoneRetentionTimeInHours = &tombstoneRetentionTimeInHours + } + + // No error + return nil +} + +// AssignProperties_From_RetentionDescription populates our RetentionDescription from the provided source RetentionDescription +func (description *RetentionDescription) AssignProperties_From_RetentionDescription(source *v20240101s.RetentionDescription) error { + + // CleanupPolicy + if source.CleanupPolicy != nil { + cleanupPolicy := RetentionDescription_CleanupPolicy(*source.CleanupPolicy) + description.CleanupPolicy = &cleanupPolicy + } else { + description.CleanupPolicy = nil + } + + // RetentionTimeInHours + description.RetentionTimeInHours = genruntime.ClonePointerToInt(source.RetentionTimeInHours) + + // TombstoneRetentionTimeInHours + description.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(source.TombstoneRetentionTimeInHours) + + // No error + return nil +} + +// AssignProperties_To_RetentionDescription populates the provided destination RetentionDescription from our RetentionDescription +func (description *RetentionDescription) AssignProperties_To_RetentionDescription(destination *v20240101s.RetentionDescription) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CleanupPolicy + if description.CleanupPolicy != nil { + cleanupPolicy := string(*description.CleanupPolicy) + destination.CleanupPolicy = &cleanupPolicy + } else { + destination.CleanupPolicy = nil + } + + // RetentionTimeInHours + destination.RetentionTimeInHours = genruntime.ClonePointerToInt(description.RetentionTimeInHours) + + // TombstoneRetentionTimeInHours + destination.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(description.TombstoneRetentionTimeInHours) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_RetentionDescription_STATUS populates our RetentionDescription from the provided source RetentionDescription_STATUS +func (description *RetentionDescription) Initialize_From_RetentionDescription_STATUS(source *RetentionDescription_STATUS) error { + + // CleanupPolicy + if source.CleanupPolicy != nil { + cleanupPolicy := RetentionDescription_CleanupPolicy(*source.CleanupPolicy) + description.CleanupPolicy = &cleanupPolicy + } else { + description.CleanupPolicy = nil + } + + // RetentionTimeInHours + description.RetentionTimeInHours = genruntime.ClonePointerToInt(source.RetentionTimeInHours) + + // TombstoneRetentionTimeInHours + description.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(source.TombstoneRetentionTimeInHours) + + // No error + return nil +} + +// Properties to configure retention settings for the eventhub +type RetentionDescription_STATUS struct { + // CleanupPolicy: Enumerates the possible values for cleanup policy + CleanupPolicy *RetentionDescription_CleanupPolicy_STATUS `json:"cleanupPolicy,omitempty"` + + // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when + // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue + RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` + + // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is + // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified + // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key + // described by the tombstone marker within the compacted Event Hub + TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` +} + +var _ genruntime.FromARMConverter = &RetentionDescription_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (description *RetentionDescription_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &RetentionDescription_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (description *RetentionDescription_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(RetentionDescription_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected RetentionDescription_STATUS_ARM, got %T", armInput) + } + + // Set property "CleanupPolicy": + if typedInput.CleanupPolicy != nil { + cleanupPolicy := *typedInput.CleanupPolicy + description.CleanupPolicy = &cleanupPolicy + } + + // Set property "RetentionTimeInHours": + if typedInput.RetentionTimeInHours != nil { + retentionTimeInHours := *typedInput.RetentionTimeInHours + description.RetentionTimeInHours = &retentionTimeInHours + } + + // Set property "TombstoneRetentionTimeInHours": + if typedInput.TombstoneRetentionTimeInHours != nil { + tombstoneRetentionTimeInHours := *typedInput.TombstoneRetentionTimeInHours + description.TombstoneRetentionTimeInHours = &tombstoneRetentionTimeInHours + } + + // No error + return nil +} + +// AssignProperties_From_RetentionDescription_STATUS populates our RetentionDescription_STATUS from the provided source RetentionDescription_STATUS +func (description *RetentionDescription_STATUS) AssignProperties_From_RetentionDescription_STATUS(source *v20240101s.RetentionDescription_STATUS) error { + + // CleanupPolicy + if source.CleanupPolicy != nil { + cleanupPolicy := RetentionDescription_CleanupPolicy_STATUS(*source.CleanupPolicy) + description.CleanupPolicy = &cleanupPolicy + } else { + description.CleanupPolicy = nil + } + + // RetentionTimeInHours + description.RetentionTimeInHours = genruntime.ClonePointerToInt(source.RetentionTimeInHours) + + // TombstoneRetentionTimeInHours + description.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(source.TombstoneRetentionTimeInHours) + + // No error + return nil +} + +// AssignProperties_To_RetentionDescription_STATUS populates the provided destination RetentionDescription_STATUS from our RetentionDescription_STATUS +func (description *RetentionDescription_STATUS) AssignProperties_To_RetentionDescription_STATUS(destination *v20240101s.RetentionDescription_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CleanupPolicy + if description.CleanupPolicy != nil { + cleanupPolicy := string(*description.CleanupPolicy) + destination.CleanupPolicy = &cleanupPolicy + } else { + destination.CleanupPolicy = nil + } + + // RetentionTimeInHours + destination.RetentionTimeInHours = genruntime.ClonePointerToInt(description.RetentionTimeInHours) + + // TombstoneRetentionTimeInHours + destination.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(description.TombstoneRetentionTimeInHours) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Avro","AvroDeflate"} +type CaptureDescription_Encoding string + +const ( + CaptureDescription_Encoding_Avro = CaptureDescription_Encoding("Avro") + CaptureDescription_Encoding_AvroDeflate = CaptureDescription_Encoding("AvroDeflate") +) + +type CaptureDescription_Encoding_STATUS string + +const ( + CaptureDescription_Encoding_STATUS_Avro = CaptureDescription_Encoding_STATUS("Avro") + CaptureDescription_Encoding_STATUS_AvroDeflate = CaptureDescription_Encoding_STATUS("AvroDeflate") +) + +// Capture storage details for capture description +type Destination struct { + // ArchiveNameFormat: Blob naming convention for archive, e.g. + // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters + // (Namespace,EventHub .. etc) are mandatory irrespective of order + ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` + + // BlobContainer: Blob container Name + BlobContainer *string `json:"blobContainer,omitempty"` + + // DataLakeAccountName: The Azure Data Lake Store name for the captured events + DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` + + // DataLakeFolderPath: The destination folder path for the captured events + DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` + + // +kubebuilder:validation:Pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$" + // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store + DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` + + // Identity: A value that indicates whether capture description is enabled. + Identity *CaptureIdentity `json:"identity,omitempty"` + + // Name: Name for capture destination + Name *string `json:"name,omitempty"` + + // StorageAccountResourceReference: Resource id of the storage account to be used to create the blobs + StorageAccountResourceReference *genruntime.ResourceReference `armReference:"StorageAccountResourceId" json:"storageAccountResourceReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &Destination{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (destination *Destination) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if destination == nil { + return nil, nil + } + result := &Destination_ARM{} + + // Set property "Identity": + if destination.Identity != nil { + identity_ARM, err := (*destination.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identity_ARM.(*CaptureIdentity_ARM) + result.Identity = &identity + } + + // Set property "Name": + if destination.Name != nil { + name := *destination.Name + result.Name = &name + } + + // Set property "Properties": + if destination.ArchiveNameFormat != nil || + destination.BlobContainer != nil || + destination.DataLakeAccountName != nil || + destination.DataLakeFolderPath != nil || + destination.DataLakeSubscriptionId != nil || + destination.StorageAccountResourceReference != nil { + result.Properties = &Destination_Properties_ARM{} + } + if destination.ArchiveNameFormat != nil { + archiveNameFormat := *destination.ArchiveNameFormat + result.Properties.ArchiveNameFormat = &archiveNameFormat + } + if destination.BlobContainer != nil { + blobContainer := *destination.BlobContainer + result.Properties.BlobContainer = &blobContainer + } + if destination.DataLakeAccountName != nil { + dataLakeAccountName := *destination.DataLakeAccountName + result.Properties.DataLakeAccountName = &dataLakeAccountName + } + if destination.DataLakeFolderPath != nil { + dataLakeFolderPath := *destination.DataLakeFolderPath + result.Properties.DataLakeFolderPath = &dataLakeFolderPath + } + if destination.DataLakeSubscriptionId != nil { + dataLakeSubscriptionId := *destination.DataLakeSubscriptionId + result.Properties.DataLakeSubscriptionId = &dataLakeSubscriptionId + } + if destination.StorageAccountResourceReference != nil { + storageAccountResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*destination.StorageAccountResourceReference) + if err != nil { + return nil, err + } + storageAccountResourceId := storageAccountResourceIdARMID + result.Properties.StorageAccountResourceId = &storageAccountResourceId + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (destination *Destination) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Destination_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (destination *Destination) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Destination_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Destination_ARM, got %T", armInput) + } + + // Set property "ArchiveNameFormat": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ArchiveNameFormat != nil { + archiveNameFormat := *typedInput.Properties.ArchiveNameFormat + destination.ArchiveNameFormat = &archiveNameFormat + } + } + + // Set property "BlobContainer": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.BlobContainer != nil { + blobContainer := *typedInput.Properties.BlobContainer + destination.BlobContainer = &blobContainer + } + } + + // Set property "DataLakeAccountName": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DataLakeAccountName != nil { + dataLakeAccountName := *typedInput.Properties.DataLakeAccountName + destination.DataLakeAccountName = &dataLakeAccountName + } + } + + // Set property "DataLakeFolderPath": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DataLakeFolderPath != nil { + dataLakeFolderPath := *typedInput.Properties.DataLakeFolderPath + destination.DataLakeFolderPath = &dataLakeFolderPath + } + } + + // Set property "DataLakeSubscriptionId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DataLakeSubscriptionId != nil { + dataLakeSubscriptionId := *typedInput.Properties.DataLakeSubscriptionId + destination.DataLakeSubscriptionId = &dataLakeSubscriptionId + } + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 CaptureIdentity + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + destination.Identity = &identity + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + destination.Name = &name + } + + // no assignment for property "StorageAccountResourceReference" + + // No error + return nil +} + +// AssignProperties_From_Destination populates our Destination from the provided source Destination +func (destination *Destination) AssignProperties_From_Destination(source *v20240101s.Destination) error { + + // ArchiveNameFormat + destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) + + // BlobContainer + destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) + + // DataLakeAccountName + destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) + + // DataLakeFolderPath + destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) + + // DataLakeSubscriptionId + if source.DataLakeSubscriptionId != nil { + dataLakeSubscriptionId := *source.DataLakeSubscriptionId + destination.DataLakeSubscriptionId = &dataLakeSubscriptionId + } else { + destination.DataLakeSubscriptionId = nil + } + + // Identity + if source.Identity != nil { + var identity CaptureIdentity + err := identity.AssignProperties_From_CaptureIdentity(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CaptureIdentity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(source.Name) + + // StorageAccountResourceReference + if source.StorageAccountResourceReference != nil { + storageAccountResourceReference := source.StorageAccountResourceReference.Copy() + destination.StorageAccountResourceReference = &storageAccountResourceReference + } else { + destination.StorageAccountResourceReference = nil + } + + // No error + return nil +} + +// AssignProperties_To_Destination populates the provided destination Destination from our Destination +func (destination *Destination) AssignProperties_To_Destination(target *v20240101s.Destination) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ArchiveNameFormat + target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) + + // BlobContainer + target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) + + // DataLakeAccountName + target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) + + // DataLakeFolderPath + target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) + + // DataLakeSubscriptionId + if destination.DataLakeSubscriptionId != nil { + dataLakeSubscriptionId := *destination.DataLakeSubscriptionId + target.DataLakeSubscriptionId = &dataLakeSubscriptionId + } else { + target.DataLakeSubscriptionId = nil + } + + // Identity + if destination.Identity != nil { + var identity v20240101s.CaptureIdentity + err := destination.Identity.AssignProperties_To_CaptureIdentity(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CaptureIdentity() to populate field Identity") + } + target.Identity = &identity + } else { + target.Identity = nil + } + + // Name + target.Name = genruntime.ClonePointerToString(destination.Name) + + // StorageAccountResourceReference + if destination.StorageAccountResourceReference != nil { + storageAccountResourceReference := destination.StorageAccountResourceReference.Copy() + target.StorageAccountResourceReference = &storageAccountResourceReference + } else { + target.StorageAccountResourceReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + target.PropertyBag = propertyBag + } else { + target.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Destination_STATUS populates our Destination from the provided source Destination_STATUS +func (destination *Destination) Initialize_From_Destination_STATUS(source *Destination_STATUS) error { + + // ArchiveNameFormat + destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) + + // BlobContainer + destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) + + // DataLakeAccountName + destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) + + // DataLakeFolderPath + destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) + + // DataLakeSubscriptionId + if source.DataLakeSubscriptionId != nil { + dataLakeSubscriptionId := *source.DataLakeSubscriptionId + destination.DataLakeSubscriptionId = &dataLakeSubscriptionId + } else { + destination.DataLakeSubscriptionId = nil + } + + // Identity + if source.Identity != nil { + var identity CaptureIdentity + err := identity.Initialize_From_CaptureIdentity_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_CaptureIdentity_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(source.Name) + + // StorageAccountResourceReference + if source.StorageAccountResourceId != nil { + storageAccountResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.StorageAccountResourceId) + destination.StorageAccountResourceReference = &storageAccountResourceReference + } else { + destination.StorageAccountResourceReference = nil + } + + // No error + return nil +} + +// Capture storage details for capture description +type Destination_STATUS struct { + // ArchiveNameFormat: Blob naming convention for archive, e.g. + // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters + // (Namespace,EventHub .. etc) are mandatory irrespective of order + ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` + + // BlobContainer: Blob container Name + BlobContainer *string `json:"blobContainer,omitempty"` + + // DataLakeAccountName: The Azure Data Lake Store name for the captured events + DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` + + // DataLakeFolderPath: The destination folder path for the captured events + DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` + + // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store + DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` + + // Identity: A value that indicates whether capture description is enabled. + Identity *CaptureIdentity_STATUS `json:"identity,omitempty"` + + // Name: Name for capture destination + Name *string `json:"name,omitempty"` + + // StorageAccountResourceId: Resource id of the storage account to be used to create the blobs + StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` +} + +var _ genruntime.FromARMConverter = &Destination_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (destination *Destination_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Destination_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (destination *Destination_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Destination_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Destination_STATUS_ARM, got %T", armInput) + } + + // Set property "ArchiveNameFormat": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ArchiveNameFormat != nil { + archiveNameFormat := *typedInput.Properties.ArchiveNameFormat + destination.ArchiveNameFormat = &archiveNameFormat + } + } + + // Set property "BlobContainer": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.BlobContainer != nil { + blobContainer := *typedInput.Properties.BlobContainer + destination.BlobContainer = &blobContainer + } + } + + // Set property "DataLakeAccountName": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DataLakeAccountName != nil { + dataLakeAccountName := *typedInput.Properties.DataLakeAccountName + destination.DataLakeAccountName = &dataLakeAccountName + } + } + + // Set property "DataLakeFolderPath": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DataLakeFolderPath != nil { + dataLakeFolderPath := *typedInput.Properties.DataLakeFolderPath + destination.DataLakeFolderPath = &dataLakeFolderPath + } + } + + // Set property "DataLakeSubscriptionId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DataLakeSubscriptionId != nil { + dataLakeSubscriptionId := *typedInput.Properties.DataLakeSubscriptionId + destination.DataLakeSubscriptionId = &dataLakeSubscriptionId + } + } + + // Set property "Identity": + if typedInput.Identity != nil { + var identity1 CaptureIdentity_STATUS + err := identity1.PopulateFromARM(owner, *typedInput.Identity) + if err != nil { + return err + } + identity := identity1 + destination.Identity = &identity + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + destination.Name = &name + } + + // Set property "StorageAccountResourceId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.StorageAccountResourceId != nil { + storageAccountResourceId := *typedInput.Properties.StorageAccountResourceId + destination.StorageAccountResourceId = &storageAccountResourceId + } + } + + // No error + return nil +} + +// AssignProperties_From_Destination_STATUS populates our Destination_STATUS from the provided source Destination_STATUS +func (destination *Destination_STATUS) AssignProperties_From_Destination_STATUS(source *v20240101s.Destination_STATUS) error { + + // ArchiveNameFormat + destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) + + // BlobContainer + destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) + + // DataLakeAccountName + destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) + + // DataLakeFolderPath + destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) + + // DataLakeSubscriptionId + destination.DataLakeSubscriptionId = genruntime.ClonePointerToString(source.DataLakeSubscriptionId) + + // Identity + if source.Identity != nil { + var identity CaptureIdentity_STATUS + err := identity.AssignProperties_From_CaptureIdentity_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CaptureIdentity_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(source.Name) + + // StorageAccountResourceId + destination.StorageAccountResourceId = genruntime.ClonePointerToString(source.StorageAccountResourceId) + + // No error + return nil +} + +// AssignProperties_To_Destination_STATUS populates the provided destination Destination_STATUS from our Destination_STATUS +func (destination *Destination_STATUS) AssignProperties_To_Destination_STATUS(target *v20240101s.Destination_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ArchiveNameFormat + target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) + + // BlobContainer + target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) + + // DataLakeAccountName + target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) + + // DataLakeFolderPath + target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) + + // DataLakeSubscriptionId + target.DataLakeSubscriptionId = genruntime.ClonePointerToString(destination.DataLakeSubscriptionId) + + // Identity + if destination.Identity != nil { + var identity v20240101s.CaptureIdentity_STATUS + err := destination.Identity.AssignProperties_To_CaptureIdentity_STATUS(&identity) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CaptureIdentity_STATUS() to populate field Identity") + } + target.Identity = &identity + } else { + target.Identity = nil + } + + // Name + target.Name = genruntime.ClonePointerToString(destination.Name) + + // StorageAccountResourceId + target.StorageAccountResourceId = genruntime.ClonePointerToString(destination.StorageAccountResourceId) + + // Update the property bag + if len(propertyBag) > 0 { + target.PropertyBag = propertyBag + } else { + target.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Compact","Delete"} +type RetentionDescription_CleanupPolicy string + +const ( + RetentionDescription_CleanupPolicy_Compact = RetentionDescription_CleanupPolicy("Compact") + RetentionDescription_CleanupPolicy_Delete = RetentionDescription_CleanupPolicy("Delete") +) + +type RetentionDescription_CleanupPolicy_STATUS string + +const ( + RetentionDescription_CleanupPolicy_STATUS_Compact = RetentionDescription_CleanupPolicy_STATUS("Compact") + RetentionDescription_CleanupPolicy_STATUS_Delete = RetentionDescription_CleanupPolicy_STATUS("Delete") +) + +// A value that indicates whether capture description is enabled. +type CaptureIdentity struct { + // Type: Type of Azure Active Directory Managed Identity. + Type *CaptureIdentity_Type `json:"type,omitempty"` + + // UserAssignedIdentityReference: ARM ID of Managed User Identity. This property is required is the type is + // UserAssignedIdentity. If type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be + // used. + UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` +} + +var _ genruntime.ARMTransformer = &CaptureIdentity{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (identity *CaptureIdentity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if identity == nil { + return nil, nil + } + result := &CaptureIdentity_ARM{} + + // Set property "Type": + if identity.Type != nil { + typeVar := *identity.Type + result.Type = &typeVar + } + + // Set property "UserAssignedIdentity": + if identity.UserAssignedIdentityReference != nil { + userAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*identity.UserAssignedIdentityReference) + if err != nil { + return nil, err + } + userAssignedIdentityReference := userAssignedIdentityReferenceARMID + result.UserAssignedIdentity = &userAssignedIdentityReference + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *CaptureIdentity) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CaptureIdentity_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *CaptureIdentity) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CaptureIdentity_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureIdentity_ARM, got %T", armInput) + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + identity.Type = &typeVar + } + + // no assignment for property "UserAssignedIdentityReference" + + // No error + return nil +} + +// AssignProperties_From_CaptureIdentity populates our CaptureIdentity from the provided source CaptureIdentity +func (identity *CaptureIdentity) AssignProperties_From_CaptureIdentity(source *v20240101s.CaptureIdentity) error { + + // Type + if source.Type != nil { + typeVar := CaptureIdentity_Type(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentityReference + if source.UserAssignedIdentityReference != nil { + userAssignedIdentityReference := source.UserAssignedIdentityReference.Copy() + identity.UserAssignedIdentityReference = &userAssignedIdentityReference + } else { + identity.UserAssignedIdentityReference = nil + } + + // No error + return nil +} + +// AssignProperties_To_CaptureIdentity populates the provided destination CaptureIdentity from our CaptureIdentity +func (identity *CaptureIdentity) AssignProperties_To_CaptureIdentity(destination *v20240101s.CaptureIdentity) 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 + } + + // UserAssignedIdentityReference + if identity.UserAssignedIdentityReference != nil { + userAssignedIdentityReference := identity.UserAssignedIdentityReference.Copy() + destination.UserAssignedIdentityReference = &userAssignedIdentityReference + } else { + destination.UserAssignedIdentityReference = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_CaptureIdentity_STATUS populates our CaptureIdentity from the provided source CaptureIdentity_STATUS +func (identity *CaptureIdentity) Initialize_From_CaptureIdentity_STATUS(source *CaptureIdentity_STATUS) error { + + // Type + if source.Type != nil { + typeVar := CaptureIdentity_Type(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // No error + return nil +} + +// A value that indicates whether capture description is enabled. +type CaptureIdentity_STATUS struct { + // Type: Type of Azure Active Directory Managed Identity. + Type *CaptureIdentity_Type_STATUS `json:"type,omitempty"` + + // UserAssignedIdentity: ARM ID of Managed User Identity. This property is required is the type is UserAssignedIdentity. If + // type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be used. + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +var _ genruntime.FromARMConverter = &CaptureIdentity_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *CaptureIdentity_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CaptureIdentity_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *CaptureIdentity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CaptureIdentity_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureIdentity_STATUS_ARM, got %T", armInput) + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + identity.Type = &typeVar + } + + // Set property "UserAssignedIdentity": + if typedInput.UserAssignedIdentity != nil { + userAssignedIdentity := *typedInput.UserAssignedIdentity + identity.UserAssignedIdentity = &userAssignedIdentity + } + + // No error + return nil +} + +// AssignProperties_From_CaptureIdentity_STATUS populates our CaptureIdentity_STATUS from the provided source CaptureIdentity_STATUS +func (identity *CaptureIdentity_STATUS) AssignProperties_From_CaptureIdentity_STATUS(source *v20240101s.CaptureIdentity_STATUS) error { + + // Type + if source.Type != nil { + typeVar := CaptureIdentity_Type_STATUS(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentity + identity.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) + + // No error + return nil +} + +// AssignProperties_To_CaptureIdentity_STATUS populates the provided destination CaptureIdentity_STATUS from our CaptureIdentity_STATUS +func (identity *CaptureIdentity_STATUS) AssignProperties_To_CaptureIdentity_STATUS(destination *v20240101s.CaptureIdentity_STATUS) 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 + } + + // UserAssignedIdentity + destination.UserAssignedIdentity = genruntime.ClonePointerToString(identity.UserAssignedIdentity) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"SystemAssigned","UserAssigned"} +type CaptureIdentity_Type string + +const ( + CaptureIdentity_Type_SystemAssigned = CaptureIdentity_Type("SystemAssigned") + CaptureIdentity_Type_UserAssigned = CaptureIdentity_Type("UserAssigned") +) + +type CaptureIdentity_Type_STATUS string + +const ( + CaptureIdentity_Type_STATUS_SystemAssigned = CaptureIdentity_Type_STATUS("SystemAssigned") + CaptureIdentity_Type_STATUS_UserAssigned = CaptureIdentity_Type_STATUS("UserAssigned") +) + +func init() { + SchemeBuilder.Register(&NamespacesEventhub{}, &NamespacesEventhubList{}) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go new file mode 100644 index 00000000000..5d3d93f99c9 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go @@ -0,0 +1,1322 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesEventhub_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhub to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesEventhub, NamespacesEventhubGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesEventhub(subject NamespacesEventhub) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesEventhub + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesEventhub + 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_NamespacesEventhub_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhub to NamespacesEventhub via AssignProperties_To_NamespacesEventhub & AssignProperties_From_NamespacesEventhub returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhub, NamespacesEventhubGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhub(subject NamespacesEventhub) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhub + err := copied.AssignProperties_To_NamespacesEventhub(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhub + err = actual.AssignProperties_From_NamespacesEventhub(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhub_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhub via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhub, NamespacesEventhubGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhub runs a test to see if a specific instance of NamespacesEventhub round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhub(subject NamespacesEventhub) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhub + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhub instances for property testing - lazily instantiated by NamespacesEventhubGenerator() +var namespacesEventhubGenerator gopter.Gen + +// NamespacesEventhubGenerator returns a generator of NamespacesEventhub instances for property testing. +func NamespacesEventhubGenerator() gopter.Gen { + if namespacesEventhubGenerator != nil { + return namespacesEventhubGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhub(generators) + namespacesEventhubGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhub{}), generators) + + return namespacesEventhubGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhub is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhub(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Eventhub_SpecGenerator() + gens["Status"] = Namespaces_Eventhub_STATUSGenerator() +} + +func Test_Namespaces_Eventhub_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhub_Spec to Namespaces_Eventhub_Spec via AssignProperties_To_Namespaces_Eventhub_Spec & AssignProperties_From_Namespaces_Eventhub_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhub_Spec tests if a specific instance of Namespaces_Eventhub_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_Spec + err := copied.AssignProperties_To_Namespaces_Eventhub_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhub_Spec + err = actual.AssignProperties_From_Namespaces_Eventhub_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_Eventhub_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_Spec runs a test to see if a specific instance of Namespaces_Eventhub_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_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 Namespaces_Eventhub_Spec instances for property testing - lazily instantiated by +// Namespaces_Eventhub_SpecGenerator() +var namespaces_Eventhub_SpecGenerator gopter.Gen + +// Namespaces_Eventhub_SpecGenerator returns a generator of Namespaces_Eventhub_Spec instances for property testing. +// We first initialize namespaces_Eventhub_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhub_SpecGenerator() gopter.Gen { + if namespaces_Eventhub_SpecGenerator != nil { + return namespaces_Eventhub_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) + namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) + namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) + + return namespaces_Eventhub_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) + gens["PartitionCount"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { + gens["CaptureDescription"] = gen.PtrOf(CaptureDescriptionGenerator()) + gens["RetentionDescription"] = gen.PtrOf(RetentionDescriptionGenerator()) +} + +func Test_Namespaces_Eventhub_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhub_STATUS to Namespaces_Eventhub_STATUS via AssignProperties_To_Namespaces_Eventhub_STATUS & AssignProperties_From_Namespaces_Eventhub_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS tests if a specific instance of Namespaces_Eventhub_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_STATUS + err := copied.AssignProperties_To_Namespaces_Eventhub_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhub_STATUS + err = actual.AssignProperties_From_Namespaces_Eventhub_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_Eventhub_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_STATUS runs a test to see if a specific instance of Namespaces_Eventhub_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_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 Namespaces_Eventhub_STATUS instances for property testing - lazily instantiated by +// Namespaces_Eventhub_STATUSGenerator() +var namespaces_Eventhub_STATUSGenerator gopter.Gen + +// Namespaces_Eventhub_STATUSGenerator returns a generator of Namespaces_Eventhub_STATUS instances for property testing. +// We first initialize namespaces_Eventhub_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhub_STATUSGenerator() gopter.Gen { + if namespaces_Eventhub_STATUSGenerator != nil { + return namespaces_Eventhub_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) + namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) + namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) + + return namespaces_Eventhub_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PartitionCount"] = gen.PtrOf(gen.Int()) + gens["PartitionIds"] = gen.SliceOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + Namespaces_Eventhub_Properties_Status_STATUS_Active, + Namespaces_Eventhub_Properties_Status_STATUS_Creating, + Namespaces_Eventhub_Properties_Status_STATUS_Deleting, + Namespaces_Eventhub_Properties_Status_STATUS_Disabled, + Namespaces_Eventhub_Properties_Status_STATUS_ReceiveDisabled, + Namespaces_Eventhub_Properties_Status_STATUS_Renaming, + Namespaces_Eventhub_Properties_Status_STATUS_Restoring, + Namespaces_Eventhub_Properties_Status_STATUS_SendDisabled, + Namespaces_Eventhub_Properties_Status_STATUS_Unknown)) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { + gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_STATUSGenerator()) + gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_CaptureDescription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CaptureDescription to CaptureDescription via AssignProperties_To_CaptureDescription & AssignProperties_From_CaptureDescription returns original", + prop.ForAll(RunPropertyAssignmentTestForCaptureDescription, CaptureDescriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCaptureDescription tests if a specific instance of CaptureDescription can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCaptureDescription(subject CaptureDescription) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.CaptureDescription + err := copied.AssignProperties_To_CaptureDescription(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CaptureDescription + err = actual.AssignProperties_From_CaptureDescription(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_CaptureDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureDescription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureDescription, CaptureDescriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureDescription runs a test to see if a specific instance of CaptureDescription round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureDescription(subject CaptureDescription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureDescription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureDescription instances for property testing - lazily instantiated by CaptureDescriptionGenerator() +var captureDescriptionGenerator gopter.Gen + +// CaptureDescriptionGenerator returns a generator of CaptureDescription instances for property testing. +// We first initialize captureDescriptionGenerator 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 CaptureDescriptionGenerator() gopter.Gen { + if captureDescriptionGenerator != nil { + return captureDescriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription(generators) + captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription(generators) + AddRelatedPropertyGeneratorsForCaptureDescription(generators) + captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) + + return captureDescriptionGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_Avro, CaptureDescription_Encoding_AvroDeflate)) + gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) + gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) + gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { + gens["Destination"] = gen.PtrOf(DestinationGenerator()) +} + +func Test_CaptureDescription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CaptureDescription_STATUS to CaptureDescription_STATUS via AssignProperties_To_CaptureDescription_STATUS & AssignProperties_From_CaptureDescription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCaptureDescription_STATUS tests if a specific instance of CaptureDescription_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCaptureDescription_STATUS(subject CaptureDescription_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 v20240101s.CaptureDescription_STATUS + err := copied.AssignProperties_To_CaptureDescription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CaptureDescription_STATUS + err = actual.AssignProperties_From_CaptureDescription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_CaptureDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureDescription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureDescription_STATUS runs a test to see if a specific instance of CaptureDescription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureDescription_STATUS(subject CaptureDescription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureDescription_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 CaptureDescription_STATUS instances for property testing - lazily instantiated by +// CaptureDescription_STATUSGenerator() +var captureDescription_STATUSGenerator gopter.Gen + +// CaptureDescription_STATUSGenerator returns a generator of CaptureDescription_STATUS instances for property testing. +// We first initialize captureDescription_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func CaptureDescription_STATUSGenerator() gopter.Gen { + if captureDescription_STATUSGenerator != nil { + return captureDescription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) + captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) + AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(generators) + captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) + + return captureDescription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_STATUS_Avro, CaptureDescription_Encoding_STATUS_AvroDeflate)) + gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) + gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) + gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { + gens["Destination"] = gen.PtrOf(Destination_STATUSGenerator()) +} + +func Test_RetentionDescription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from RetentionDescription to RetentionDescription via AssignProperties_To_RetentionDescription & AssignProperties_From_RetentionDescription returns original", + prop.ForAll(RunPropertyAssignmentTestForRetentionDescription, RetentionDescriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForRetentionDescription tests if a specific instance of RetentionDescription can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForRetentionDescription(subject RetentionDescription) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.RetentionDescription + err := copied.AssignProperties_To_RetentionDescription(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual RetentionDescription + err = actual.AssignProperties_From_RetentionDescription(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_RetentionDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RetentionDescription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRetentionDescription, RetentionDescriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRetentionDescription runs a test to see if a specific instance of RetentionDescription round trips to JSON and back losslessly +func RunJSONSerializationTestForRetentionDescription(subject RetentionDescription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RetentionDescription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RetentionDescription instances for property testing - lazily instantiated by +// RetentionDescriptionGenerator() +var retentionDescriptionGenerator gopter.Gen + +// RetentionDescriptionGenerator returns a generator of RetentionDescription instances for property testing. +func RetentionDescriptionGenerator() gopter.Gen { + if retentionDescriptionGenerator != nil { + return retentionDescriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRetentionDescription(generators) + retentionDescriptionGenerator = gen.Struct(reflect.TypeOf(RetentionDescription{}), generators) + + return retentionDescriptionGenerator +} + +// AddIndependentPropertyGeneratorsForRetentionDescription is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRetentionDescription(gens map[string]gopter.Gen) { + gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_Compact, RetentionDescription_CleanupPolicy_Delete)) + gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) + gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) +} + +func Test_RetentionDescription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from RetentionDescription_STATUS to RetentionDescription_STATUS via AssignProperties_To_RetentionDescription_STATUS & AssignProperties_From_RetentionDescription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForRetentionDescription_STATUS, RetentionDescription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForRetentionDescription_STATUS tests if a specific instance of RetentionDescription_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForRetentionDescription_STATUS(subject RetentionDescription_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 v20240101s.RetentionDescription_STATUS + err := copied.AssignProperties_To_RetentionDescription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual RetentionDescription_STATUS + err = actual.AssignProperties_From_RetentionDescription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_RetentionDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RetentionDescription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRetentionDescription_STATUS, RetentionDescription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRetentionDescription_STATUS runs a test to see if a specific instance of RetentionDescription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForRetentionDescription_STATUS(subject RetentionDescription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RetentionDescription_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 RetentionDescription_STATUS instances for property testing - lazily instantiated by +// RetentionDescription_STATUSGenerator() +var retentionDescription_STATUSGenerator gopter.Gen + +// RetentionDescription_STATUSGenerator returns a generator of RetentionDescription_STATUS instances for property testing. +func RetentionDescription_STATUSGenerator() gopter.Gen { + if retentionDescription_STATUSGenerator != nil { + return retentionDescription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(generators) + retentionDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_STATUS{}), generators) + + return retentionDescription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForRetentionDescription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(gens map[string]gopter.Gen) { + gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_STATUS_Compact, RetentionDescription_CleanupPolicy_STATUS_Delete)) + gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) + gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) +} + +func Test_Destination_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Destination to Destination via AssignProperties_To_Destination & AssignProperties_From_Destination returns original", + prop.ForAll(RunPropertyAssignmentTestForDestination, DestinationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDestination tests if a specific instance of Destination can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDestination(subject Destination) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.Destination + err := copied.AssignProperties_To_Destination(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Destination + err = actual.AssignProperties_From_Destination(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Destination_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination, DestinationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination runs a test to see if a specific instance of Destination round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination(subject Destination) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Destination instances for property testing - lazily instantiated by DestinationGenerator() +var destinationGenerator gopter.Gen + +// DestinationGenerator returns a generator of Destination instances for property testing. +// We first initialize destinationGenerator 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 DestinationGenerator() gopter.Gen { + if destinationGenerator != nil { + return destinationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination(generators) + destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination(generators) + AddRelatedPropertyGeneratorsForDestination(generators) + destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) + + return destinationGenerator +} + +// AddIndependentPropertyGeneratorsForDestination is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { + gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) + gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForDestination is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(CaptureIdentityGenerator()) +} + +func Test_Destination_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Destination_STATUS to Destination_STATUS via AssignProperties_To_Destination_STATUS & AssignProperties_From_Destination_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForDestination_STATUS, Destination_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDestination_STATUS tests if a specific instance of Destination_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForDestination_STATUS(subject Destination_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 v20240101s.Destination_STATUS + err := copied.AssignProperties_To_Destination_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Destination_STATUS + err = actual.AssignProperties_From_Destination_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Destination_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination_STATUS, Destination_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination_STATUS runs a test to see if a specific instance of Destination_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination_STATUS(subject Destination_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination_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 Destination_STATUS instances for property testing - lazily instantiated by Destination_STATUSGenerator() +var destination_STATUSGenerator gopter.Gen + +// Destination_STATUSGenerator returns a generator of Destination_STATUS instances for property testing. +// We first initialize destination_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Destination_STATUSGenerator() gopter.Gen { + if destination_STATUSGenerator != nil { + return destination_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_STATUS(generators) + destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_STATUS(generators) + AddRelatedPropertyGeneratorsForDestination_STATUS(generators) + destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) + + return destination_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { + gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) + gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(CaptureIdentity_STATUSGenerator()) +} + +func Test_CaptureIdentity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CaptureIdentity to CaptureIdentity via AssignProperties_To_CaptureIdentity & AssignProperties_From_CaptureIdentity returns original", + prop.ForAll(RunPropertyAssignmentTestForCaptureIdentity, CaptureIdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCaptureIdentity tests if a specific instance of CaptureIdentity can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCaptureIdentity(subject CaptureIdentity) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.CaptureIdentity + err := copied.AssignProperties_To_CaptureIdentity(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CaptureIdentity + err = actual.AssignProperties_From_CaptureIdentity(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_CaptureIdentity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureIdentity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureIdentity, CaptureIdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureIdentity runs a test to see if a specific instance of CaptureIdentity round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureIdentity(subject CaptureIdentity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureIdentity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureIdentity instances for property testing - lazily instantiated by CaptureIdentityGenerator() +var captureIdentityGenerator gopter.Gen + +// CaptureIdentityGenerator returns a generator of CaptureIdentity instances for property testing. +func CaptureIdentityGenerator() gopter.Gen { + if captureIdentityGenerator != nil { + return captureIdentityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureIdentity(generators) + captureIdentityGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity{}), generators) + + return captureIdentityGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_SystemAssigned, CaptureIdentity_Type_UserAssigned)) +} + +func Test_CaptureIdentity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CaptureIdentity_STATUS to CaptureIdentity_STATUS via AssignProperties_To_CaptureIdentity_STATUS & AssignProperties_From_CaptureIdentity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCaptureIdentity_STATUS, CaptureIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCaptureIdentity_STATUS tests if a specific instance of CaptureIdentity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForCaptureIdentity_STATUS(subject CaptureIdentity_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 v20240101s.CaptureIdentity_STATUS + err := copied.AssignProperties_To_CaptureIdentity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CaptureIdentity_STATUS + err = actual.AssignProperties_From_CaptureIdentity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_CaptureIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureIdentity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureIdentity_STATUS, CaptureIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureIdentity_STATUS runs a test to see if a specific instance of CaptureIdentity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureIdentity_STATUS(subject CaptureIdentity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureIdentity_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 CaptureIdentity_STATUS instances for property testing - lazily instantiated by +// CaptureIdentity_STATUSGenerator() +var captureIdentity_STATUSGenerator gopter.Gen + +// CaptureIdentity_STATUSGenerator returns a generator of CaptureIdentity_STATUS instances for property testing. +func CaptureIdentity_STATUSGenerator() gopter.Gen { + if captureIdentity_STATUSGenerator != nil { + return captureIdentity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(generators) + captureIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_STATUS{}), generators) + + return captureIdentity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_STATUS_SystemAssigned, CaptureIdentity_Type_STATUS_UserAssigned)) + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go new file mode 100644 index 00000000000..bd467ed9bfd --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go @@ -0,0 +1,35 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Eventhubs_AuthorizationRule_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties supplied to create or update AuthorizationRule + Properties *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) GetName() string { + return rule.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" +} + +type Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM struct { + // Rights: The rights associated with the rule. + Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..e2f17d65a1d --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go @@ -0,0 +1,154 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +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_Namespaces_Eventhubs_AuthorizationRule_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM, Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(subject Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator() +var namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator 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 Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(generators) + namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(generators) + namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator()) +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM, Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM(subject Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM instances for property testing - lazily +// instantiated by Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator() +var namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM instances for property testing. +func Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM(generators) + namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM(gens map[string]gopter.Gen) { + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send)) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go new file mode 100644 index 00000000000..ea35e249927 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go @@ -0,0 +1,30 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +type Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM struct { + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: Properties supplied to create or update AuthorizationRule + Properties *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM `json:"properties,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` +} + +type Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM struct { + // Rights: The rights associated with the rule. + Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen_test.go new file mode 100644 index 00000000000..68dc1cea72b --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_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 v1api20240101 + +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_Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM, Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(subject Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM instances for property testing - lazily instantiated +// by Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator() +var namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator 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 Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(generators) + namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(generators) + namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM, Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM(subject Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM instances for property testing - lazily +// instantiated by Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator() +var namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM instances for property testing. +func Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM(generators) + namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Send)) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go new file mode 100644 index 00000000000..1031d5647db --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go @@ -0,0 +1,1021 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} +type NamespacesEventhubsAuthorizationRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Eventhubs_AuthorizationRule_Spec `json:"spec,omitempty"` + Status Namespaces_Eventhubs_AuthorizationRule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesEventhubsAuthorizationRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesEventhubsAuthorizationRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesEventhubsAuthorizationRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesEventhubsAuthorizationRule{} + +// ConvertFrom populates our NamespacesEventhubsAuthorizationRule from the provided hub NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(source) +} + +// ConvertTo populates the provided hub NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination) +} + +// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespaceseventhubsauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaceseventhubsauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesEventhubsAuthorizationRule{} + +// Default applies defaults to the NamespacesEventhubsAuthorizationRule resource +func (rule *NamespacesEventhubsAuthorizationRule) Default() { + rule.defaultImpl() + var temp any = rule + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (rule *NamespacesEventhubsAuthorizationRule) defaultAzureName() { + if rule.Spec.AzureName == "" { + rule.Spec.AzureName = rule.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesEventhubsAuthorizationRule resource +func (rule *NamespacesEventhubsAuthorizationRule) defaultImpl() { rule.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesEventhubsAuthorizationRule{} + +// InitializeSpec initializes the spec for this resource from the given status +func (rule *NamespacesEventhubsAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { + return rule.Spec.Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Eventhubs_AuthorizationRule_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesEventhubsAuthorizationRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesEventhubsAuthorizationRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesEventhubsAuthorizationRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesEventhubsAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesEventhubsAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesEventhubsAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" +func (rule *NamespacesEventhubsAuthorizationRule) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesEventhubsAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Eventhubs_AuthorizationRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesEventhubsAuthorizationRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesEventhubsAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Eventhubs_AuthorizationRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespaceseventhubsauthorizationrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaceseventhubsauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesEventhubsAuthorizationRule{} + +// ValidateCreate validates the creation of the resource +func (rule *NamespacesEventhubsAuthorizationRule) ValidateCreate() (admission.Warnings, error) { + validations := rule.createValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (rule *NamespacesEventhubsAuthorizationRule) ValidateDelete() (admission.Warnings, error) { + validations := rule.deleteValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (rule *NamespacesEventhubsAuthorizationRule) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := rule.updateValidations() + var temp any = rule + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + return genruntime.ValidateUpdate(old, validations) +} + +// createValidations validates the creation of the resource +func (rule *NamespacesEventhubsAuthorizationRule) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference, rule.validateSecretDestinations} +} + +// deleteValidations validates the deletion of the resource +func (rule *NamespacesEventhubsAuthorizationRule) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (rule *NamespacesEventhubsAuthorizationRule) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateResourceReferences() + }, + rule.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateSecretDestinations() + }, + } +} + +// validateOwnerReference validates the owner field +func (rule *NamespacesEventhubsAuthorizationRule) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(rule) +} + +// validateResourceReferences validates all resource references +func (rule *NamespacesEventhubsAuthorizationRule) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (rule *NamespacesEventhubsAuthorizationRule) validateSecretDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + if rule.Spec.OperatorSpec.Secrets == nil { + return nil, nil + } + toValidate := []*genruntime.SecretDestination{ + rule.Spec.OperatorSpec.Secrets.PrimaryConnectionString, + rule.Spec.OperatorSpec.Secrets.PrimaryKey, + rule.Spec.OperatorSpec.Secrets.SecondaryConnectionString, + rule.Spec.OperatorSpec.Secrets.SecondaryKey, + } + return genruntime.ValidateSecretDestinations(toValidate) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (rule *NamespacesEventhubsAuthorizationRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesEventhubsAuthorizationRule) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, rule) +} + +// AssignProperties_From_NamespacesEventhubsAuthorizationRule populates our NamespacesEventhubsAuthorizationRule from the provided source NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_From_NamespacesEventhubsAuthorizationRule(source *v20240101s.NamespacesEventhubsAuthorizationRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Eventhubs_AuthorizationRule_Spec + err := spec.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_Eventhubs_AuthorizationRule_STATUS + err = status.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") + } + rule.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRule populates the provided destination NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule +func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination *v20240101s.NamespacesEventhubsAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") + } + destination.Status = status + + // No error + return nil +} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *NamespacesEventhubsAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion(), + Kind: "NamespacesEventhubsAuthorizationRule", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} +type NamespacesEventhubsAuthorizationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesEventhubsAuthorizationRule `json:"items"` +} + +type Namespaces_Eventhubs_AuthorizationRule_Spec struct { + // +kubebuilder:validation:MinLength=1 + // 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"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesEventhubsAuthorizationRuleOperatorSpec `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 eventhub.azure.com/NamespacesEventhub resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` + + // +kubebuilder:validation:Required + // Rights: The rights associated with the rule. + Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Eventhubs_AuthorizationRule_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if rule == nil { + return nil, nil + } + result := &Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if rule.Rights != nil { + result.Properties = &Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM{} + } + for _, item := range rule.Rights { + result.Properties.Rights = append(result.Properties.Rights, item) + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_AuthorizationRule_Spec_ARM, got %T", armInput) + } + + // Set property "AzureName": + rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + rule.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "Rights": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.Rights { + rule.Rights = append(rule.Rights, item) + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec{} + +// ConvertSpecFrom populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_Spec +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} + err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(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 +} + +// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_Spec +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { + + // AzureName + rule.AzureName = source.AzureName + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesEventhubsAuthorizationRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + rule.OperatorSpec = &operatorSpec + } else { + rule.OperatorSpec = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec(rightItem) + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec populates the provided destination Namespaces_Eventhubs_AuthorizationRule_Spec from our Namespaces_Eventhubs_AuthorizationRule_Spec +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = rule.AzureName + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion() + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Rights + if rule.Rights != nil { + rightList := make([]string, len(rule.Rights)) + for rightIndex, rightItem := range rule.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = string(rightItem) + } + destination.Rights = rightList + } else { + destination.Rights = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *Namespaces_Eventhubs_AuthorizationRule_STATUS) error { + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + right := Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec(rightItem) + rightList[rightIndex] = right + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) SetAzureName(azureName string) { + rule.AzureName = azureName +} + +type Namespaces_Eventhubs_AuthorizationRule_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"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Rights: The rights associated with the rule. + Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_AuthorizationRule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} + err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(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 = &Namespaces_Eventhubs_AuthorizationRule_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM, got %T", armInput) + } + + // no assignment for property "Conditions" + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + rule.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + rule.Location = &location + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + rule.Name = &name + } + + // Set property "Rights": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.Rights { + rule.Rights = append(rule.Rights, item) + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + rule.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + rule.Type = &typeVar + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS(rightItem) + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + rule.SystemData = &systemDatum + } else { + rule.SystemData = nil + } + + // Type + rule.Type = genruntime.ClonePointerToString(source.Type) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS populates the provided destination Namespaces_Eventhubs_AuthorizationRule_STATUS from our Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // Rights + if rule.Rights != nil { + rightList := make([]string, len(rule.Rights)) + for rightIndex, rightItem := range rule.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + rightList[rightIndex] = string(rightItem) + } + destination.Rights = rightList + } else { + destination.Rights = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Listen","Manage","Send"} +type Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec string + +const ( + Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec("Listen") + Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Manage = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec("Manage") + Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec("Send") +) + +type Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS string + +const ( + Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Listen = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS("Listen") + Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Manage = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS("Manage") + Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Send = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS("Send") +) + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesEventhubsAuthorizationRuleOperatorSpec struct { + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec populates our NamespacesEventhubsAuthorizationRuleOperatorSpec from the provided source NamespacesEventhubsAuthorizationRuleOperatorSpec +func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { + + // Secrets + if source.Secrets != nil { + var secret NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets() to populate field Secrets") + } + operator.Secrets = &secret + } else { + operator.Secrets = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSpec from our NamespacesEventhubsAuthorizationRuleOperatorSpec +func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets() 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 NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { + // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + + // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from + // Azure. + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + + // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret + // will not be retrieved from Azure. + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + + // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved + // from Azure. + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates our NamespacesEventhubsAuthorizationRuleOperatorSecrets from the provided source NamespacesEventhubsAuthorizationRuleOperatorSecrets +func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { + + // PrimaryConnectionString + if source.PrimaryConnectionString != nil { + primaryConnectionString := source.PrimaryConnectionString.Copy() + secrets.PrimaryConnectionString = &primaryConnectionString + } else { + secrets.PrimaryConnectionString = nil + } + + // PrimaryKey + if source.PrimaryKey != nil { + primaryKey := source.PrimaryKey.Copy() + secrets.PrimaryKey = &primaryKey + } else { + secrets.PrimaryKey = nil + } + + // SecondaryConnectionString + if source.SecondaryConnectionString != nil { + secondaryConnectionString := source.SecondaryConnectionString.Copy() + secrets.SecondaryConnectionString = &secondaryConnectionString + } else { + secrets.SecondaryConnectionString = nil + } + + // SecondaryKey + if source.SecondaryKey != nil { + secondaryKey := source.SecondaryKey.Copy() + secrets.SecondaryKey = &secondaryKey + } else { + secrets.SecondaryKey = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSecrets from our NamespacesEventhubsAuthorizationRuleOperatorSecrets +func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrimaryConnectionString + if secrets.PrimaryConnectionString != nil { + primaryConnectionString := secrets.PrimaryConnectionString.Copy() + destination.PrimaryConnectionString = &primaryConnectionString + } else { + destination.PrimaryConnectionString = nil + } + + // PrimaryKey + if secrets.PrimaryKey != nil { + primaryKey := secrets.PrimaryKey.Copy() + destination.PrimaryKey = &primaryKey + } else { + destination.PrimaryKey = nil + } + + // SecondaryConnectionString + if secrets.SecondaryConnectionString != nil { + secondaryConnectionString := secrets.SecondaryConnectionString.Copy() + destination.SecondaryConnectionString = &secondaryConnectionString + } else { + destination.SecondaryConnectionString = nil + } + + // SecondaryKey + if secrets.SecondaryKey != nil { + secondaryKey := secrets.SecondaryKey.Copy() + destination.SecondaryKey = &secondaryKey + } else { + destination.SecondaryKey = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesEventhubsAuthorizationRule{}, &NamespacesEventhubsAuthorizationRuleList{}) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..347f5c3b90d --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go @@ -0,0 +1,605 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesEventhubsAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesEventhubsAuthorizationRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesEventhubsAuthorizationRule + 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_NamespacesEventhubsAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRule to NamespacesEventhubsAuthorizationRule via AssignProperties_To_NamespacesEventhubsAuthorizationRule & AssignProperties_From_NamespacesEventhubsAuthorizationRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsAuthorizationRule + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRule + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRule(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRule instances for property testing - lazily instantiated by +// NamespacesEventhubsAuthorizationRuleGenerator() +var namespacesEventhubsAuthorizationRuleGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleGenerator returns a generator of NamespacesEventhubsAuthorizationRule instances for property testing. +func NamespacesEventhubsAuthorizationRuleGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleGenerator != nil { + return namespacesEventhubsAuthorizationRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(generators) + namespacesEventhubsAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRule{}), generators) + + return namespacesEventhubsAuthorizationRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() + gens["Status"] = Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_AuthorizationRule_Spec to Namespaces_Eventhubs_AuthorizationRule_Spec via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec + err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_AuthorizationRule_Spec + err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() +var namespaces_Eventhubs_AuthorizationRule_SpecGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_SpecGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send)) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator()) +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_AuthorizationRule_STATUS to Namespaces_Eventhubs_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS + err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_AuthorizationRule_STATUS + err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() +var namespaces_Eventhubs_AuthorizationRule_STATUSGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_STATUSGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) + namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) + namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Send)) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSpec to NamespacesEventhubsAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(generators) + namespacesEventhubsAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSpec{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSecrets to NamespacesEventhubsAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets + err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets + err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated +// by NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go new file mode 100644 index 00000000000..e533e31db0f --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go @@ -0,0 +1,788 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} +type NamespacesEventhubsConsumerGroup struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Eventhubs_Consumergroup_Spec `json:"spec,omitempty"` + Status Namespaces_Eventhubs_Consumergroup_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesEventhubsConsumerGroup{} + +// GetConditions returns the conditions of the resource +func (group *NamespacesEventhubsConsumerGroup) GetConditions() conditions.Conditions { + return group.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (group *NamespacesEventhubsConsumerGroup) SetConditions(conditions conditions.Conditions) { + group.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesEventhubsConsumerGroup{} + +// ConvertFrom populates our NamespacesEventhubsConsumerGroup from the provided hub NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) + } + + return group.AssignProperties_From_NamespacesEventhubsConsumerGroup(source) +} + +// ConvertTo populates the provided hub NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) + if !ok { + return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) + } + + return group.AssignProperties_To_NamespacesEventhubsConsumerGroup(destination) +} + +// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespaceseventhubsconsumergroup,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaceseventhubsconsumergroups.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesEventhubsConsumerGroup{} + +// Default applies defaults to the NamespacesEventhubsConsumerGroup resource +func (group *NamespacesEventhubsConsumerGroup) Default() { + group.defaultImpl() + var temp any = group + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (group *NamespacesEventhubsConsumerGroup) defaultAzureName() { + if group.Spec.AzureName == "" { + group.Spec.AzureName = group.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesEventhubsConsumerGroup resource +func (group *NamespacesEventhubsConsumerGroup) defaultImpl() { group.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesEventhubsConsumerGroup{} + +// InitializeSpec initializes the spec for this resource from the given status +func (group *NamespacesEventhubsConsumerGroup) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { + return group.Spec.Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Eventhubs_Consumergroup_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} + +// AzureName returns the Azure name of the resource +func (group *NamespacesEventhubsConsumerGroup) AzureName() string { + return group.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (group NamespacesEventhubsConsumerGroup) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (group *NamespacesEventhubsConsumerGroup) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (group *NamespacesEventhubsConsumerGroup) GetSpec() genruntime.ConvertibleSpec { + return &group.Spec +} + +// GetStatus returns the status of this resource +func (group *NamespacesEventhubsConsumerGroup) GetStatus() genruntime.ConvertibleStatus { + return &group.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (group *NamespacesEventhubsConsumerGroup) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/consumergroups" +func (group *NamespacesEventhubsConsumerGroup) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs/consumergroups" +} + +// NewEmptyStatus returns a new empty (blank) status +func (group *NamespacesEventhubsConsumerGroup) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Eventhubs_Consumergroup_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (group *NamespacesEventhubsConsumerGroup) Owner() *genruntime.ResourceReference { + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) + return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) +} + +// SetStatus sets the status of this resource +func (group *NamespacesEventhubsConsumerGroup) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { + group.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Eventhubs_Consumergroup_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + group.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespaceseventhubsconsumergroup,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaceseventhubsconsumergroups.eventhub.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesEventhubsConsumerGroup{} + +// ValidateCreate validates the creation of the resource +func (group *NamespacesEventhubsConsumerGroup) ValidateCreate() (admission.Warnings, error) { + validations := group.createValidations() + var temp any = group + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (group *NamespacesEventhubsConsumerGroup) ValidateDelete() (admission.Warnings, error) { + validations := group.deleteValidations() + var temp any = group + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (group *NamespacesEventhubsConsumerGroup) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := group.updateValidations() + var temp any = group + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.UpdateValidations()...) + } + return genruntime.ValidateUpdate(old, validations) +} + +// createValidations validates the creation of the resource +func (group *NamespacesEventhubsConsumerGroup) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){group.validateResourceReferences, group.validateOwnerReference} +} + +// deleteValidations validates the deletion of the resource +func (group *NamespacesEventhubsConsumerGroup) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (group *NamespacesEventhubsConsumerGroup) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return group.validateResourceReferences() + }, + group.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return group.validateOwnerReference() + }, + } +} + +// validateOwnerReference validates the owner field +func (group *NamespacesEventhubsConsumerGroup) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(group) +} + +// validateResourceReferences validates all resource references +func (group *NamespacesEventhubsConsumerGroup) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&group.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (group *NamespacesEventhubsConsumerGroup) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesEventhubsConsumerGroup) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, group) +} + +// AssignProperties_From_NamespacesEventhubsConsumerGroup populates our NamespacesEventhubsConsumerGroup from the provided source NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) AssignProperties_From_NamespacesEventhubsConsumerGroup(source *v20240101s.NamespacesEventhubsConsumerGroup) error { + + // ObjectMeta + group.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Eventhubs_Consumergroup_Spec + err := spec.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") + } + group.Spec = spec + + // Status + var status Namespaces_Eventhubs_Consumergroup_STATUS + err = status.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") + } + group.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesEventhubsConsumerGroup populates the provided destination NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup +func (group *NamespacesEventhubsConsumerGroup) AssignProperties_To_NamespacesEventhubsConsumerGroup(destination *v20240101s.NamespacesEventhubsConsumerGroup) error { + + // ObjectMeta + destination.ObjectMeta = *group.ObjectMeta.DeepCopy() + + // Spec + var spec v20240101s.Namespaces_Eventhubs_Consumergroup_Spec + err := group.Spec.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS + err = group.Status.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") + } + destination.Status = status + + // No error + return nil +} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (group *NamespacesEventhubsConsumerGroup) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: group.Spec.OriginalVersion(), + Kind: "NamespacesEventhubsConsumerGroup", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} +type NamespacesEventhubsConsumerGroupList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesEventhubsConsumerGroup `json:"items"` +} + +type Namespaces_Eventhubs_Consumergroup_Spec struct { + // +kubebuilder:validation:MaxLength=50 + // +kubebuilder:validation:MinLength=1 + // 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"` + + // +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 eventhub.azure.com/NamespacesEventhub resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` + + // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be + // used to store descriptive data, such as list of teams and their contact information also user-defined configuration + // settings can be stored. + UserMetadata *string `json:"userMetadata,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Eventhubs_Consumergroup_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if consumergroup == nil { + return nil, nil + } + result := &Namespaces_Eventhubs_Consumergroup_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if consumergroup.UserMetadata != nil { + result.Properties = &Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM{} + } + if consumergroup.UserMetadata != nil { + userMetadata := *consumergroup.UserMetadata + result.Properties.UserMetadata = &userMetadata + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Eventhubs_Consumergroup_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Eventhubs_Consumergroup_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_Consumergroup_Spec_ARM, got %T", armInput) + } + + // Set property "AzureName": + consumergroup.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "Owner": + consumergroup.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "UserMetadata": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UserMetadata != nil { + userMetadata := *typedInput.Properties.UserMetadata + consumergroup.UserMetadata = &userMetadata + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_Consumergroup_Spec{} + +// ConvertSpecFrom populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) + if ok { + // Populate our instance from source + return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_Spec +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) + if ok { + // Populate destination from our instance + return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} + err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(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 +} + +// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_Spec +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(source *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { + + // AzureName + consumergroup.AzureName = source.AzureName + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + consumergroup.Owner = &owner + } else { + consumergroup.Owner = nil + } + + // UserMetadata + consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec populates the provided destination Namespaces_Eventhubs_Consumergroup_Spec from our Namespaces_Eventhubs_Consumergroup_Spec +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = consumergroup.AzureName + + // OriginalVersion + destination.OriginalVersion = consumergroup.OriginalVersion() + + // Owner + if consumergroup.Owner != nil { + owner := consumergroup.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // UserMetadata + destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *Namespaces_Eventhubs_Consumergroup_STATUS) error { + + // UserMetadata + consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) SetAzureName(azureName string) { + consumergroup.AzureName = azureName +} + +type Namespaces_Eventhubs_Consumergroup_STATUS struct { + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` + + // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be + // used to store descriptive data, such as list of teams and their contact information also user-defined configuration + // settings can be stored. + UserMetadata *string `json:"userMetadata,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_Consumergroup_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) + if ok { + // Populate our instance from source + return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) + } + + // Convert to an intermediate form + src = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) + if ok { + // Populate destination from our instance + return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} + err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(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 = &Namespaces_Eventhubs_Consumergroup_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Eventhubs_Consumergroup_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Eventhubs_Consumergroup_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_Consumergroup_STATUS_ARM, got %T", armInput) + } + + // no assignment for property "Conditions" + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + consumergroup.CreatedAt = &createdAt + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + consumergroup.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + consumergroup.Location = &location + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + consumergroup.Name = &name + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + consumergroup.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + consumergroup.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + consumergroup.UpdatedAt = &updatedAt + } + } + + // Set property "UserMetadata": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UserMetadata != nil { + userMetadata := *typedInput.Properties.UserMetadata + consumergroup.UserMetadata = &userMetadata + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { + + // Conditions + consumergroup.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedAt + consumergroup.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // Id + consumergroup.Id = genruntime.ClonePointerToString(source.Id) + + // Location + consumergroup.Location = genruntime.ClonePointerToString(source.Location) + + // Name + consumergroup.Name = genruntime.ClonePointerToString(source.Name) + + // SystemData + if source.SystemData != nil { + var systemDatum SystemData_STATUS + err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") + } + consumergroup.SystemData = &systemDatum + } else { + consumergroup.SystemData = nil + } + + // Type + consumergroup.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + consumergroup.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // UserMetadata + consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS populates the provided destination Namespaces_Eventhubs_Consumergroup_STATUS from our Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(consumergroup.Conditions) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(consumergroup.CreatedAt) + + // Id + destination.Id = genruntime.ClonePointerToString(consumergroup.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(consumergroup.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(consumergroup.Name) + + // SystemData + if consumergroup.SystemData != nil { + var systemDatum v20240101s.SystemData_STATUS + err := consumergroup.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(consumergroup.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(consumergroup.UpdatedAt) + + // UserMetadata + destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesEventhubsConsumerGroup{}, &NamespacesEventhubsConsumerGroupList{}) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go new file mode 100644 index 00000000000..0223bf1c089 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go @@ -0,0 +1,393 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesEventhubsConsumerGroup_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsConsumerGroup to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20240101s.NamespacesEventhubsConsumerGroup + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesEventhubsConsumerGroup + 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_NamespacesEventhubsConsumerGroup_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesEventhubsConsumerGroup to NamespacesEventhubsConsumerGroup via AssignProperties_To_NamespacesEventhubsConsumerGroup & AssignProperties_From_NamespacesEventhubsConsumerGroup returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20240101s.NamespacesEventhubsConsumerGroup + err := copied.AssignProperties_To_NamespacesEventhubsConsumerGroup(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesEventhubsConsumerGroup + err = actual.AssignProperties_From_NamespacesEventhubsConsumerGroup(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesEventhubsConsumerGroup_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsConsumerGroup via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsConsumerGroup runs a test to see if a specific instance of NamespacesEventhubsConsumerGroup round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsConsumerGroup + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsConsumerGroup instances for property testing - lazily instantiated by +// NamespacesEventhubsConsumerGroupGenerator() +var namespacesEventhubsConsumerGroupGenerator gopter.Gen + +// NamespacesEventhubsConsumerGroupGenerator returns a generator of NamespacesEventhubsConsumerGroup instances for property testing. +func NamespacesEventhubsConsumerGroupGenerator() gopter.Gen { + if namespacesEventhubsConsumerGroupGenerator != nil { + return namespacesEventhubsConsumerGroupGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(generators) + namespacesEventhubsConsumerGroupGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsConsumerGroup{}), generators) + + return namespacesEventhubsConsumerGroupGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Eventhubs_Consumergroup_SpecGenerator() + gens["Status"] = Namespaces_Eventhubs_Consumergroup_STATUSGenerator() +} + +func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_Consumergroup_Spec to Namespaces_Eventhubs_Consumergroup_Spec via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec tests if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_Spec + err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_Consumergroup_Spec + err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_Spec instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_Consumergroup_SpecGenerator() +var namespaces_Eventhubs_Consumergroup_SpecGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_SpecGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Spec instances for property testing. +func Namespaces_Eventhubs_Consumergroup_SpecGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_SpecGenerator != nil { + return namespaces_Eventhubs_Consumergroup_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(generators) + namespaces_Eventhubs_Consumergroup_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec{}), generators) + + return namespaces_Eventhubs_Consumergroup_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Eventhubs_Consumergroup_STATUS to Namespaces_Eventhubs_Consumergroup_STATUS via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS tests if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS + err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Eventhubs_Consumergroup_STATUS + err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_Consumergroup_STATUSGenerator() +var namespaces_Eventhubs_Consumergroup_STATUSGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_STATUSGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing. +// We first initialize namespaces_Eventhubs_Consumergroup_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhubs_Consumergroup_STATUSGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_STATUSGenerator != nil { + return namespaces_Eventhubs_Consumergroup_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) + namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) + namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) + + return namespaces_Eventhubs_Consumergroup_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go new file mode 100644 index 00000000000..709f505208d --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go @@ -0,0 +1,37 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Eventhubs_Consumergroup_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Single item in List or Get Consumer group operation + Properties *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Eventhubs_Consumergroup_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (consumergroup Namespaces_Eventhubs_Consumergroup_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec_ARM) GetName() string { + return consumergroup.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/consumergroups" +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec_ARM) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs/consumergroups" +} + +type Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM struct { + // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be + // used to store descriptive data, such as list of teams and their contact information also user-defined configuration + // settings can be stored. + UserMetadata *string `json:"userMetadata,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..5f8ba2cf39d --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go @@ -0,0 +1,154 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +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_Namespaces_Eventhubs_Consumergroup_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec_ARM, Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec_ARM(subject Namespaces_Eventhubs_Consumergroup_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_Consumergroup_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator() +var namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Spec_ARM instances for property testing. +// We first initialize namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator 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 Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator != nil { + return namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(generators) + namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(generators) + namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec_ARM{}), generators) + + return namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator()) +} + +func Test_Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM, Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM(subject Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM instances for property testing - lazily +// instantiated by Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator() +var namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM instances for property testing. +func Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator != nil { + return namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM(generators) + namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM{}), generators) + + return namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM(gens map[string]gopter.Gen) { + gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go new file mode 100644 index 00000000000..df4cab0a031 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go @@ -0,0 +1,38 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +type Namespaces_Eventhubs_Consumergroup_STATUS_ARM struct { + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // Properties: Single item in List or Get Consumer group operation + Properties *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM `json:"properties,omitempty"` + + // SystemData: The system meta data relating to this resource. + SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` + + // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty"` +} + +type Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM struct { + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` + + // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be + // used to store descriptive data, such as list of teams and their contact information also user-defined configuration + // settings can be stored. + UserMetadata *string `json:"userMetadata,omitempty"` +} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go new file mode 100644 index 00000000000..670dacf5474 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go @@ -0,0 +1,160 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +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_Namespaces_Eventhubs_Consumergroup_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS_ARM, Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(subject Namespaces_Eventhubs_Consumergroup_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_Consumergroup_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator() +var namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_STATUS_ARM instances for property testing. +// We first initialize namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator 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 Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator != nil { + return namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(generators) + namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(generators) + namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS_ARM{}), generators) + + return namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM, Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM(subject Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM instances for property testing - lazily +// instantiated by Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator() +var namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM instances for property testing. +func Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator != nil { + return namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM(generators) + namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM{}), generators) + + return namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go b/v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go new file mode 100644 index 00000000000..acfd7c792f8 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go @@ -0,0 +1,32 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package storage contains API Schema definitions for the eventhub storage API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=eventhub.azure.com +// +versionName=v1api20240101storage +package storage + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "eventhub.azure.com", Version: "v1api20240101storage"} + + // 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/eventhub/v1api20240101/storage/namespace_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespace_types_gen.go new file mode 100644 index 00000000000..73920897f91 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespace_types_gen.go @@ -0,0 +1,391 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaces,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaces/status,namespaces/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 v1api20240101.Namespace +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} +type Namespace struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespace_Spec `json:"spec,omitempty"` + Status Namespace_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &Namespace{} + +// GetConditions returns the conditions of the resource +func (namespace *Namespace) GetConditions() conditions.Conditions { + return namespace.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (namespace *Namespace) SetConditions(conditions conditions.Conditions) { + namespace.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &Namespace{} + +// AzureName returns the Azure name of the resource +func (namespace *Namespace) AzureName() string { + return namespace.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (namespace Namespace) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (namespace *Namespace) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (namespace *Namespace) GetSpec() genruntime.ConvertibleSpec { + return &namespace.Spec +} + +// GetStatus returns the status of this resource +func (namespace *Namespace) GetStatus() genruntime.ConvertibleStatus { + return &namespace.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (namespace *Namespace) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces" +func (namespace *Namespace) GetType() string { + return "Microsoft.EventHub/namespaces" +} + +// NewEmptyStatus returns a new empty (blank) status +func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespace_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (namespace *Namespace) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) + return namespace.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespace_STATUS); ok { + namespace.Status = *st + return nil + } + + // Convert status to required version + var st Namespace_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + namespace.Status = st + return nil +} + +// Hub marks that this Namespace is the hub type for conversion +func (namespace *Namespace) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: namespace.Spec.OriginalVersion, + Kind: "Namespace", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101.Namespace +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} +type NamespaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Namespace `json:"items"` +} + +// Storage version of v1api20240101.APIVersion +// +kubebuilder:validation:Enum={"2024-01-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2024-01-01") + +// Storage version of v1api20240101.Namespace_Spec +type Namespace_Spec struct { + AlternateName *string `json:"alternateName,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"` + + // ClusterArmReference: Cluster ARM ID of the Namespace. + ClusterArmReference *genruntime.ResourceReference `armReference:"ClusterArmId" json:"clusterArmReference,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + Identity *Identity `json:"identity,omitempty"` + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + Location *string `json:"location,omitempty"` + MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + MinimumTlsVersion *string `json:"minimumTlsVersion,omitempty"` + OperatorSpec *NamespaceOperatorSpec `json:"operatorSpec,omitempty"` + OriginalVersion string `json:"originalVersion,omitempty"` + + // +kubebuilder:validation:Required + // Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also + // controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a + // reference to a resources.azure.com/ResourceGroup resource + Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespace_Spec{} + +// ConvertSpecFrom populates our Namespace_Spec from the provided source +func (namespace *Namespace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(namespace) +} + +// ConvertSpecTo populates the provided destination from our Namespace_Spec +func (namespace *Namespace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(namespace) +} + +// Storage version of v1api20240101.Namespace_STATUS +type Namespace_STATUS struct { + AlternateName *string `json:"alternateName,omitempty"` + ClusterArmId *string `json:"clusterArmId,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Encryption *Encryption_STATUS `json:"encryption,omitempty"` + Id *string `json:"id,omitempty"` + Identity *Identity_STATUS `json:"identity,omitempty"` + IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` + KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` + Location *string `json:"location,omitempty"` + MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` + MetricId *string `json:"metricId,omitempty"` + MinimumTlsVersion *string `json:"minimumTlsVersion,omitempty"` + Name *string `json:"name,omitempty"` + PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + Sku *Sku_STATUS `json:"sku,omitempty"` + Status *string `json:"status,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespace_STATUS{} + +// ConvertStatusFrom populates our Namespace_STATUS from the provided source +func (namespace *Namespace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(namespace) +} + +// ConvertStatusTo populates the provided destination from our Namespace_STATUS +func (namespace *Namespace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(namespace) +} + +// Storage version of v1api20240101.Encryption +// Properties to configure Encryption +type Encryption struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +// Storage version of v1api20240101.Encryption_STATUS +// Properties to configure Encryption +type Encryption_STATUS struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +// Storage version of v1api20240101.Identity +// Properties to configure Identity for Bring your Own Keys +type Identity struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` + UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} + +// Storage version of v1api20240101.Identity_STATUS +// Properties to configure Identity for Bring your Own Keys +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 v1api20240101.NamespaceOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespaceOperatorSpec struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` +} + +// Storage version of v1api20240101.PrivateEndpointConnection_STATUS +// Properties of the PrivateEndpointConnection. +type PrivateEndpointConnection_STATUS struct { + Id *string `json:"id,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.Sku +// SKU parameters supplied to the create namespace operation +type Sku struct { + Capacity *int `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// Storage version of v1api20240101.Sku_STATUS +// SKU parameters supplied to the create namespace operation +type Sku_STATUS struct { + Capacity *int `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// Storage version of v1api20240101.SystemData_STATUS +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByType *string `json:"createdByType,omitempty"` + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedByType *string `json:"lastModifiedByType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.KeyVaultProperties +// Properties to configure keyVault Properties +type KeyVaultProperties struct { + Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.KeyVaultProperties_STATUS +// Properties to configure keyVault Properties +type KeyVaultProperties_STATUS struct { + Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.NamespaceOperatorSecrets +type NamespaceOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +// Storage version of v1api20240101.UserAssignedIdentity_STATUS +// Recognized Dictionary value. +type UserAssignedIdentity_STATUS struct { + ClientId *string `json:"clientId,omitempty"` + PrincipalId *string `json:"principalId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.UserAssignedIdentityDetails +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` +} + +// Storage version of v1api20240101.UserAssignedIdentityProperties +type UserAssignedIdentityProperties struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // UserAssignedIdentityReference: ARM ID of user Identity selected for encryption + UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` +} + +// Storage version of v1api20240101.UserAssignedIdentityProperties_STATUS +type UserAssignedIdentityProperties_STATUS struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +func init() { + SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go new file mode 100644 index 00000000000..0811bd0e68b --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go @@ -0,0 +1,1316 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_Namespace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace runs a test to see if a specific instance of Namespace round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace(subject Namespace) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Namespace instances for property testing - lazily instantiated by NamespaceGenerator() +var namespaceGenerator gopter.Gen + +// NamespaceGenerator returns a generator of Namespace instances for property testing. +func NamespaceGenerator() gopter.Gen { + if namespaceGenerator != nil { + return namespaceGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespace(generators) + namespaceGenerator = gen.Struct(reflect.TypeOf(Namespace{}), generators) + + return namespaceGenerator +} + +// AddRelatedPropertyGeneratorsForNamespace is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace(gens map[string]gopter.Gen) { + gens["Spec"] = Namespace_SpecGenerator() + gens["Status"] = Namespace_STATUSGenerator() +} + +func Test_Namespace_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_Spec, Namespace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_Spec runs a test to see if a specific instance of Namespace_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_Spec(subject Namespace_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_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 Namespace_Spec instances for property testing - lazily instantiated by Namespace_SpecGenerator() +var namespace_SpecGenerator gopter.Gen + +// Namespace_SpecGenerator returns a generator of Namespace_Spec instances for property testing. +// We first initialize namespace_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespace_SpecGenerator() gopter.Gen { + if namespace_SpecGenerator != nil { + return namespace_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Spec(generators) + namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_Spec(generators) + AddRelatedPropertyGeneratorsForNamespace_Spec(generators) + namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) + + return namespace_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) + gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() + gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionGenerator()) + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespaceOperatorSpecGenerator()) + gens["Sku"] = gen.PtrOf(SkuGenerator()) +} + +func Test_Namespace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespace_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespace_STATUS, Namespace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespace_STATUS runs a test to see if a specific instance of Namespace_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespace_STATUS(subject Namespace_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespace_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 Namespace_STATUS instances for property testing - lazily instantiated by Namespace_STATUSGenerator() +var namespace_STATUSGenerator gopter.Gen + +// Namespace_STATUSGenerator returns a generator of Namespace_STATUS instances for property testing. +// We first initialize namespace_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespace_STATUSGenerator() gopter.Gen { + if namespace_STATUSGenerator != nil { + return namespace_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) + namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespace_STATUS(generators) + namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) + + return namespace_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) + gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString()) + gens["ServiceBusEndpoint"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_STATUSGenerator()) + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUSGenerator()) + gens["Sku"] = gen.PtrOf(Sku_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Encryption_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption, EncryptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption runs a test to see if a specific instance of Encryption round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption(subject Encryption) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Encryption instances for property testing - lazily instantiated by EncryptionGenerator() +var encryptionGenerator gopter.Gen + +// EncryptionGenerator returns a generator of Encryption instances for property testing. +// We first initialize encryptionGenerator 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 EncryptionGenerator() gopter.Gen { + if encryptionGenerator != nil { + return encryptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption(generators) + encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption(generators) + AddRelatedPropertyGeneratorsForEncryption(generators) + encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) + + return encryptionGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.AlphaString()) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) +} + +func Test_Encryption_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption_STATUS, Encryption_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption_STATUS runs a test to see if a specific instance of Encryption_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption_STATUS(subject Encryption_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption_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 Encryption_STATUS instances for property testing - lazily instantiated by Encryption_STATUSGenerator() +var encryption_STATUSGenerator gopter.Gen + +// Encryption_STATUSGenerator returns a generator of Encryption_STATUS instances for property testing. +// We first initialize encryption_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Encryption_STATUSGenerator() gopter.Gen { + if encryption_STATUSGenerator != nil { + return encryption_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) + encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) + AddRelatedPropertyGeneratorsForEncryption_STATUS(generators) + encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) + + return encryption_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.AlphaString()) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) +} + +func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity(subject Identity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() +var identityGenerator gopter.Gen + +// IdentityGenerator returns a generator of Identity instances for property testing. +// We first initialize identityGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + AddRelatedPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + return identityGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) +} + +func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() +var identity_STATUSGenerator gopter.Gen + +// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. +// We first initialize identity_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_STATUSGenerator() gopter.Gen { + if identity_STATUSGenerator != nil { + return identity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + return identity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUSGenerator()) +} + +func Test_NamespaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespaceOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSpec runs a test to see if a specific instance of NamespaceOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSpec instances for property testing - lazily instantiated by +// NamespaceOperatorSpecGenerator() +var namespaceOperatorSpecGenerator gopter.Gen + +// NamespaceOperatorSpecGenerator returns a generator of NamespaceOperatorSpec instances for property testing. +func NamespaceOperatorSpecGenerator() gopter.Gen { + if namespaceOperatorSpecGenerator != nil { + return namespaceOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(generators) + namespaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSpec{}), generators) + + return namespaceOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespaceOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) +} + +func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual PrivateEndpointConnection_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 PrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by +// PrivateEndpointConnection_STATUSGenerator() +var privateEndpointConnection_STATUSGenerator gopter.Gen + +// PrivateEndpointConnection_STATUSGenerator returns a generator of PrivateEndpointConnection_STATUS instances for property testing. +func PrivateEndpointConnection_STATUSGenerator() gopter.Gen { + if privateEndpointConnection_STATUSGenerator != nil { + return privateEndpointConnection_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(generators) + privateEndpointConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS{}), generators) + + return privateEndpointConnection_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of 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["Capacity"] = gen.PtrOf(gen.Int()) + 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.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Sku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSku_STATUS, Sku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSku_STATUS runs a test to see if a specific instance of Sku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSku_STATUS(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 Sku_STATUSGenerator() +var sku_STATUSGenerator gopter.Gen + +// Sku_STATUSGenerator returns a generator of Sku_STATUS instances for property testing. +func Sku_STATUSGenerator() gopter.Gen { + if sku_STATUSGenerator != nil { + return sku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSku_STATUS(generators) + sku_STATUSGenerator = gen.Struct(reflect.TypeOf(Sku_STATUS{}), generators) + + return sku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSku_STATUS(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Tier"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() +var systemData_STATUSGenerator gopter.Gen + +// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. +func SystemData_STATUSGenerator() gopter.Gen { + if systemData_STATUSGenerator != nil { + return systemData_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) + systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) + + return systemData_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of 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. +// We first initialize keyVaultPropertiesGenerator 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 KeyVaultPropertiesGenerator() gopter.Gen { + if keyVaultPropertiesGenerator != nil { + return keyVaultPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + AddRelatedPropertyGeneratorsForKeyVaultProperties(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["KeyName"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) +} + +func Test_KeyVaultProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultProperties_STATUS runs a test to see if a specific instance of KeyVaultProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultProperties_STATUS(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 +// KeyVaultProperties_STATUSGenerator() +var keyVaultProperties_STATUSGenerator gopter.Gen + +// KeyVaultProperties_STATUSGenerator returns a generator of KeyVaultProperties_STATUS instances for property testing. +// We first initialize keyVaultProperties_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func KeyVaultProperties_STATUSGenerator() gopter.Gen { + if keyVaultProperties_STATUSGenerator != nil { + return keyVaultProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) + keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(generators) + keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) + + return keyVaultProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { + gens["KeyName"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) +} + +func Test_NamespaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespaceOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaceOperatorSecrets runs a test to see if a specific instance of NamespaceOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespaceOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespaceOperatorSecrets instances for property testing - lazily instantiated by +// NamespaceOperatorSecretsGenerator() +var namespaceOperatorSecretsGenerator gopter.Gen + +// NamespaceOperatorSecretsGenerator returns a generator of NamespaceOperatorSecrets instances for property testing. +func NamespaceOperatorSecretsGenerator() gopter.Gen { + if namespaceOperatorSecretsGenerator != nil { + return namespaceOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSecrets{}), generators) + + return namespaceOperatorSecretsGenerator +} + +func Test_UserAssignedIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentity_STATUS runs a test to see if a specific instance of UserAssignedIdentity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentity_STATUS(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 +// UserAssignedIdentity_STATUSGenerator() +var userAssignedIdentity_STATUSGenerator gopter.Gen + +// UserAssignedIdentity_STATUSGenerator returns a generator of UserAssignedIdentity_STATUS instances for property testing. +func UserAssignedIdentity_STATUSGenerator() gopter.Gen { + if userAssignedIdentity_STATUSGenerator != nil { + return userAssignedIdentity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(generators) + userAssignedIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_STATUS{}), generators) + + return userAssignedIdentity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityDetails via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityDetails + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by +// UserAssignedIdentityDetailsGenerator() +var userAssignedIdentityDetailsGenerator gopter.Gen + +// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. +func UserAssignedIdentityDetailsGenerator() gopter.Gen { + if userAssignedIdentityDetailsGenerator != nil { + return userAssignedIdentityDetailsGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) + + return userAssignedIdentityDetailsGenerator +} + +func Test_UserAssignedIdentityProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityProperties runs a test to see if a specific instance of UserAssignedIdentityProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityProperties instances for property testing - lazily instantiated by +// UserAssignedIdentityPropertiesGenerator() +var userAssignedIdentityPropertiesGenerator gopter.Gen + +// UserAssignedIdentityPropertiesGenerator returns a generator of UserAssignedIdentityProperties instances for property testing. +func UserAssignedIdentityPropertiesGenerator() gopter.Gen { + if userAssignedIdentityPropertiesGenerator != nil { + return userAssignedIdentityPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityPropertiesGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties{}), generators) + + return userAssignedIdentityPropertiesGenerator +} + +func Test_UserAssignedIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS runs a test to see if a specific instance of UserAssignedIdentityProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS instances for property testing - lazily instantiated by +// UserAssignedIdentityProperties_STATUSGenerator() +var userAssignedIdentityProperties_STATUSGenerator gopter.Gen + +// UserAssignedIdentityProperties_STATUSGenerator returns a generator of UserAssignedIdentityProperties_STATUS instances for property testing. +func UserAssignedIdentityProperties_STATUSGenerator() gopter.Gen { + if userAssignedIdentityProperties_STATUSGenerator != nil { + return userAssignedIdentityProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(generators) + userAssignedIdentityProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_STATUS{}), generators) + + return userAssignedIdentityProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..edd4692a84c --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go @@ -0,0 +1,228 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespacesauthorizationrules/status,namespacesauthorizationrules/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 v1api20240101.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} +type NamespacesAuthorizationRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_AuthorizationRule_Spec `json:"spec,omitempty"` + Status Namespaces_AuthorizationRule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesAuthorizationRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesAuthorizationRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesAuthorizationRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesAuthorizationRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesAuthorizationRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesAuthorizationRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/authorizationRules" +func (rule *NamespacesAuthorizationRule) GetType() string { + return "Microsoft.EventHub/namespaces/authorizationRules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_AuthorizationRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_AuthorizationRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// Hub marks that this NamespacesAuthorizationRule is the hub type for conversion +func (rule *NamespacesAuthorizationRule) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion, + Kind: "NamespacesAuthorizationRule", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} +type NamespacesAuthorizationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesAuthorizationRule `json:"items"` +} + +// Storage version of v1api20240101.Namespaces_AuthorizationRule_Spec +type Namespaces_AuthorizationRule_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"` + OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `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 eventhub.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Rights []string `json:"rights,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_AuthorizationRule_Spec{} + +// ConvertSpecFrom populates our Namespaces_AuthorizationRule_Spec from the provided source +func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(rule) +} + +// ConvertSpecTo populates the provided destination from our Namespaces_AuthorizationRule_Spec +func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(rule) +} + +// Storage version of v1api20240101.Namespaces_AuthorizationRule_STATUS +type Namespaces_AuthorizationRule_STATUS struct { + Conditions []conditions.Condition `json:"conditions,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Rights []string `json:"rights,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_AuthorizationRule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_AuthorizationRule_STATUS from the provided source +func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(rule) +} + +// ConvertStatusTo populates the provided destination from our Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(rule) +} + +// Storage version of v1api20240101.NamespacesAuthorizationRuleOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesAuthorizationRuleOperatorSpec struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// Storage version of v1api20240101.NamespacesAuthorizationRuleOperatorSecrets +type NamespacesAuthorizationRuleOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..bffb499b5ec --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go @@ -0,0 +1,352 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule runs a test to see if a specific instance of NamespacesAuthorizationRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRule instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleGenerator() +var namespacesAuthorizationRuleGenerator gopter.Gen + +// NamespacesAuthorizationRuleGenerator returns a generator of NamespacesAuthorizationRule instances for property testing. +func NamespacesAuthorizationRuleGenerator() gopter.Gen { + if namespacesAuthorizationRuleGenerator != nil { + return namespacesAuthorizationRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(generators) + namespacesAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule{}), generators) + + return namespacesAuthorizationRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_AuthorizationRule_SpecGenerator() + gens["Status"] = Namespaces_AuthorizationRule_STATUSGenerator() +} + +func Test_Namespaces_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_AuthorizationRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_Spec instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_SpecGenerator() +var namespaces_AuthorizationRule_SpecGenerator gopter.Gen + +// Namespaces_AuthorizationRule_SpecGenerator returns a generator of Namespaces_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { + if namespaces_AuthorizationRule_SpecGenerator != nil { + return namespaces_AuthorizationRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) + namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) + + return namespaces_AuthorizationRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["OriginalVersion"] = gen.AlphaString() + gens["Rights"] = gen.SliceOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) +} + +func Test_Namespaces_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_AuthorizationRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_AuthorizationRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_STATUS instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_STATUSGenerator() +var namespaces_AuthorizationRule_STATUSGenerator gopter.Gen + +// Namespaces_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_AuthorizationRule_STATUS instances for property testing. +// We first initialize namespaces_AuthorizationRule_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_AuthorizationRule_STATUSGenerator() gopter.Gen { + if namespaces_AuthorizationRule_STATUSGenerator != nil { + return namespaces_AuthorizationRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) + namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) + namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) + + return namespaces_AuthorizationRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Rights"] = gen.SliceOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSpecGenerator() +var namespacesAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(generators) + namespacesAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSpec{}), generators) + + return namespacesAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleOperatorSecretsGenerator() +var namespacesAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go new file mode 100644 index 00000000000..2043d8c813a --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go @@ -0,0 +1,313 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubs/status,namespaceseventhubs/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 v1api20240101.NamespacesEventhub +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} +type NamespacesEventhub struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Eventhub_Spec `json:"spec,omitempty"` + Status Namespaces_Eventhub_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesEventhub{} + +// GetConditions returns the conditions of the resource +func (eventhub *NamespacesEventhub) GetConditions() conditions.Conditions { + return eventhub.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (eventhub *NamespacesEventhub) SetConditions(conditions conditions.Conditions) { + eventhub.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesEventhub{} + +// AzureName returns the Azure name of the resource +func (eventhub *NamespacesEventhub) AzureName() string { + return eventhub.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (eventhub NamespacesEventhub) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (eventhub *NamespacesEventhub) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (eventhub *NamespacesEventhub) GetSpec() genruntime.ConvertibleSpec { + return &eventhub.Spec +} + +// GetStatus returns the status of this resource +func (eventhub *NamespacesEventhub) GetStatus() genruntime.ConvertibleStatus { + return &eventhub.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (eventhub *NamespacesEventhub) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs" +func (eventhub *NamespacesEventhub) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs" +} + +// NewEmptyStatus returns a new empty (blank) status +func (eventhub *NamespacesEventhub) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Eventhub_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (eventhub *NamespacesEventhub) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(eventhub.Spec) + return eventhub.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (eventhub *NamespacesEventhub) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Eventhub_STATUS); ok { + eventhub.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Eventhub_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + eventhub.Status = st + return nil +} + +// Hub marks that this NamespacesEventhub is the hub type for conversion +func (eventhub *NamespacesEventhub) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (eventhub *NamespacesEventhub) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: eventhub.Spec.OriginalVersion, + Kind: "NamespacesEventhub", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101.NamespacesEventhub +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} +type NamespacesEventhubList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesEventhub `json:"items"` +} + +// Storage version of v1api20240101.Namespaces_Eventhub_Spec +type Namespaces_Eventhub_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"` + CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"` + MessageRetentionInDays *int `json:"messageRetentionInDays,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 eventhub.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` + PartitionCount *int `json:"partitionCount,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RetentionDescription *RetentionDescription `json:"retentionDescription,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Eventhub_Spec{} + +// ConvertSpecFrom populates our Namespaces_Eventhub_Spec from the provided source +func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(eventhub) +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Eventhub_Spec +func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(eventhub) +} + +// Storage version of v1api20240101.Namespaces_Eventhub_STATUS +type Namespaces_Eventhub_STATUS struct { + CaptureDescription *CaptureDescription_STATUS `json:"captureDescription,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` + Name *string `json:"name,omitempty"` + PartitionCount *int `json:"partitionCount,omitempty"` + PartitionIds []string `json:"partitionIds,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RetentionDescription *RetentionDescription_STATUS `json:"retentionDescription,omitempty"` + Status *string `json:"status,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Eventhub_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Eventhub_STATUS from the provided source +func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(eventhub) +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(eventhub) +} + +// Storage version of v1api20240101.CaptureDescription +// Properties to configure capture description for eventhub +type CaptureDescription struct { + Destination *Destination `json:"destination,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Encoding *string `json:"encoding,omitempty"` + IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` + SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` +} + +// Storage version of v1api20240101.CaptureDescription_STATUS +// Properties to configure capture description for eventhub +type CaptureDescription_STATUS struct { + Destination *Destination_STATUS `json:"destination,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Encoding *string `json:"encoding,omitempty"` + IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` + SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` +} + +// Storage version of v1api20240101.RetentionDescription +// Properties to configure retention settings for the eventhub +type RetentionDescription struct { + CleanupPolicy *string `json:"cleanupPolicy,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` + TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` +} + +// Storage version of v1api20240101.RetentionDescription_STATUS +// Properties to configure retention settings for the eventhub +type RetentionDescription_STATUS struct { + CleanupPolicy *string `json:"cleanupPolicy,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` + TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` +} + +// Storage version of v1api20240101.Destination +// Capture storage details for capture description +type Destination struct { + ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` + BlobContainer *string `json:"blobContainer,omitempty"` + DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` + DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` + DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` + Identity *CaptureIdentity `json:"identity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // StorageAccountResourceReference: Resource id of the storage account to be used to create the blobs + StorageAccountResourceReference *genruntime.ResourceReference `armReference:"StorageAccountResourceId" json:"storageAccountResourceReference,omitempty"` +} + +// Storage version of v1api20240101.Destination_STATUS +// Capture storage details for capture description +type Destination_STATUS struct { + ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` + BlobContainer *string `json:"blobContainer,omitempty"` + DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` + DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` + DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` + Identity *CaptureIdentity_STATUS `json:"identity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` +} + +// Storage version of v1api20240101.CaptureIdentity +// A value that indicates whether capture description is enabled. +type CaptureIdentity struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` + + // UserAssignedIdentityReference: ARM ID of Managed User Identity. This property is required is the type is + // UserAssignedIdentity. If type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be + // used. + UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` +} + +// Storage version of v1api20240101.CaptureIdentity_STATUS +// A value that indicates whether capture description is enabled. +type CaptureIdentity_STATUS struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesEventhub{}, &NamespacesEventhubList{}) +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go new file mode 100644 index 00000000000..b55849cef9c --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go @@ -0,0 +1,808 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesEventhub_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhub via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhub, NamespacesEventhubGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhub runs a test to see if a specific instance of NamespacesEventhub round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhub(subject NamespacesEventhub) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhub + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhub instances for property testing - lazily instantiated by NamespacesEventhubGenerator() +var namespacesEventhubGenerator gopter.Gen + +// NamespacesEventhubGenerator returns a generator of NamespacesEventhub instances for property testing. +func NamespacesEventhubGenerator() gopter.Gen { + if namespacesEventhubGenerator != nil { + return namespacesEventhubGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhub(generators) + namespacesEventhubGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhub{}), generators) + + return namespacesEventhubGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhub is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhub(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Eventhub_SpecGenerator() + gens["Status"] = Namespaces_Eventhub_STATUSGenerator() +} + +func Test_Namespaces_Eventhub_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_Spec runs a test to see if a specific instance of Namespaces_Eventhub_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_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 Namespaces_Eventhub_Spec instances for property testing - lazily instantiated by +// Namespaces_Eventhub_SpecGenerator() +var namespaces_Eventhub_SpecGenerator gopter.Gen + +// Namespaces_Eventhub_SpecGenerator returns a generator of Namespaces_Eventhub_Spec instances for property testing. +// We first initialize namespaces_Eventhub_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhub_SpecGenerator() gopter.Gen { + if namespaces_Eventhub_SpecGenerator != nil { + return namespaces_Eventhub_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) + namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) + namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) + + return namespaces_Eventhub_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) + gens["OriginalVersion"] = gen.AlphaString() + gens["PartitionCount"] = gen.PtrOf(gen.Int()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { + gens["CaptureDescription"] = gen.PtrOf(CaptureDescriptionGenerator()) + gens["RetentionDescription"] = gen.PtrOf(RetentionDescriptionGenerator()) +} + +func Test_Namespaces_Eventhub_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhub_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhub_STATUS runs a test to see if a specific instance of Namespaces_Eventhub_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhub_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 Namespaces_Eventhub_STATUS instances for property testing - lazily instantiated by +// Namespaces_Eventhub_STATUSGenerator() +var namespaces_Eventhub_STATUSGenerator gopter.Gen + +// Namespaces_Eventhub_STATUSGenerator returns a generator of Namespaces_Eventhub_STATUS instances for property testing. +// We first initialize namespaces_Eventhub_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhub_STATUSGenerator() gopter.Gen { + if namespaces_Eventhub_STATUSGenerator != nil { + return namespaces_Eventhub_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) + namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) + namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) + + return namespaces_Eventhub_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PartitionCount"] = gen.PtrOf(gen.Int()) + gens["PartitionIds"] = gen.SliceOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { + gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_STATUSGenerator()) + gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_CaptureDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureDescription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureDescription, CaptureDescriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureDescription runs a test to see if a specific instance of CaptureDescription round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureDescription(subject CaptureDescription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureDescription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureDescription instances for property testing - lazily instantiated by CaptureDescriptionGenerator() +var captureDescriptionGenerator gopter.Gen + +// CaptureDescriptionGenerator returns a generator of CaptureDescription instances for property testing. +// We first initialize captureDescriptionGenerator 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 CaptureDescriptionGenerator() gopter.Gen { + if captureDescriptionGenerator != nil { + return captureDescriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription(generators) + captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription(generators) + AddRelatedPropertyGeneratorsForCaptureDescription(generators) + captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) + + return captureDescriptionGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Encoding"] = gen.PtrOf(gen.AlphaString()) + gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) + gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) + gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { + gens["Destination"] = gen.PtrOf(DestinationGenerator()) +} + +func Test_CaptureDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureDescription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureDescription_STATUS runs a test to see if a specific instance of CaptureDescription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureDescription_STATUS(subject CaptureDescription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureDescription_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 CaptureDescription_STATUS instances for property testing - lazily instantiated by +// CaptureDescription_STATUSGenerator() +var captureDescription_STATUSGenerator gopter.Gen + +// CaptureDescription_STATUSGenerator returns a generator of CaptureDescription_STATUS instances for property testing. +// We first initialize captureDescription_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func CaptureDescription_STATUSGenerator() gopter.Gen { + if captureDescription_STATUSGenerator != nil { + return captureDescription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) + captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) + AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(generators) + captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) + + return captureDescription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { + gens["Enabled"] = gen.PtrOf(gen.Bool()) + gens["Encoding"] = gen.PtrOf(gen.AlphaString()) + gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) + gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) + gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { + gens["Destination"] = gen.PtrOf(Destination_STATUSGenerator()) +} + +func Test_RetentionDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RetentionDescription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRetentionDescription, RetentionDescriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRetentionDescription runs a test to see if a specific instance of RetentionDescription round trips to JSON and back losslessly +func RunJSONSerializationTestForRetentionDescription(subject RetentionDescription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RetentionDescription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of RetentionDescription instances for property testing - lazily instantiated by +// RetentionDescriptionGenerator() +var retentionDescriptionGenerator gopter.Gen + +// RetentionDescriptionGenerator returns a generator of RetentionDescription instances for property testing. +func RetentionDescriptionGenerator() gopter.Gen { + if retentionDescriptionGenerator != nil { + return retentionDescriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRetentionDescription(generators) + retentionDescriptionGenerator = gen.Struct(reflect.TypeOf(RetentionDescription{}), generators) + + return retentionDescriptionGenerator +} + +// AddIndependentPropertyGeneratorsForRetentionDescription is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRetentionDescription(gens map[string]gopter.Gen) { + gens["CleanupPolicy"] = gen.PtrOf(gen.AlphaString()) + gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) + gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) +} + +func Test_RetentionDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of RetentionDescription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRetentionDescription_STATUS, RetentionDescription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRetentionDescription_STATUS runs a test to see if a specific instance of RetentionDescription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForRetentionDescription_STATUS(subject RetentionDescription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual RetentionDescription_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 RetentionDescription_STATUS instances for property testing - lazily instantiated by +// RetentionDescription_STATUSGenerator() +var retentionDescription_STATUSGenerator gopter.Gen + +// RetentionDescription_STATUSGenerator returns a generator of RetentionDescription_STATUS instances for property testing. +func RetentionDescription_STATUSGenerator() gopter.Gen { + if retentionDescription_STATUSGenerator != nil { + return retentionDescription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(generators) + retentionDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_STATUS{}), generators) + + return retentionDescription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForRetentionDescription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(gens map[string]gopter.Gen) { + gens["CleanupPolicy"] = gen.PtrOf(gen.AlphaString()) + gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) + gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) +} + +func Test_Destination_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination, DestinationGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination runs a test to see if a specific instance of Destination round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination(subject Destination) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Destination instances for property testing - lazily instantiated by DestinationGenerator() +var destinationGenerator gopter.Gen + +// DestinationGenerator returns a generator of Destination instances for property testing. +// We first initialize destinationGenerator 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 DestinationGenerator() gopter.Gen { + if destinationGenerator != nil { + return destinationGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination(generators) + destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination(generators) + AddRelatedPropertyGeneratorsForDestination(generators) + destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) + + return destinationGenerator +} + +// AddIndependentPropertyGeneratorsForDestination is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { + gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) + gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForDestination is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(CaptureIdentityGenerator()) +} + +func Test_Destination_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Destination_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForDestination_STATUS, Destination_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForDestination_STATUS runs a test to see if a specific instance of Destination_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForDestination_STATUS(subject Destination_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Destination_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 Destination_STATUS instances for property testing - lazily instantiated by Destination_STATUSGenerator() +var destination_STATUSGenerator gopter.Gen + +// Destination_STATUSGenerator returns a generator of Destination_STATUS instances for property testing. +// We first initialize destination_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Destination_STATUSGenerator() gopter.Gen { + if destination_STATUSGenerator != nil { + return destination_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_STATUS(generators) + destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForDestination_STATUS(generators) + AddRelatedPropertyGeneratorsForDestination_STATUS(generators) + destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) + + return destination_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { + gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) + gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) + gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(CaptureIdentity_STATUSGenerator()) +} + +func Test_CaptureIdentity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureIdentity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureIdentity, CaptureIdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureIdentity runs a test to see if a specific instance of CaptureIdentity round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureIdentity(subject CaptureIdentity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureIdentity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CaptureIdentity instances for property testing - lazily instantiated by CaptureIdentityGenerator() +var captureIdentityGenerator gopter.Gen + +// CaptureIdentityGenerator returns a generator of CaptureIdentity instances for property testing. +func CaptureIdentityGenerator() gopter.Gen { + if captureIdentityGenerator != nil { + return captureIdentityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureIdentity(generators) + captureIdentityGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity{}), generators) + + return captureIdentityGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CaptureIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of CaptureIdentity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCaptureIdentity_STATUS, CaptureIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCaptureIdentity_STATUS runs a test to see if a specific instance of CaptureIdentity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCaptureIdentity_STATUS(subject CaptureIdentity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CaptureIdentity_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 CaptureIdentity_STATUS instances for property testing - lazily instantiated by +// CaptureIdentity_STATUSGenerator() +var captureIdentity_STATUSGenerator gopter.Gen + +// CaptureIdentity_STATUSGenerator returns a generator of CaptureIdentity_STATUS instances for property testing. +func CaptureIdentity_STATUSGenerator() gopter.Gen { + if captureIdentity_STATUSGenerator != nil { + return captureIdentity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(generators) + captureIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_STATUS{}), generators) + + return captureIdentity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go new file mode 100644 index 00000000000..cc4bcfc953a --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go @@ -0,0 +1,228 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsauthorizationrules/status,namespaceseventhubsauthorizationrules/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 v1api20240101.NamespacesEventhubsAuthorizationRule +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} +type NamespacesEventhubsAuthorizationRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Eventhubs_AuthorizationRule_Spec `json:"spec,omitempty"` + Status Namespaces_Eventhubs_AuthorizationRule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesEventhubsAuthorizationRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesEventhubsAuthorizationRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesEventhubsAuthorizationRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesEventhubsAuthorizationRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesEventhubsAuthorizationRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesEventhubsAuthorizationRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesEventhubsAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesEventhubsAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesEventhubsAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" +func (rule *NamespacesEventhubsAuthorizationRule) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesEventhubsAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Eventhubs_AuthorizationRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesEventhubsAuthorizationRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesEventhubsAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Eventhubs_AuthorizationRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// Hub marks that this NamespacesEventhubsAuthorizationRule is the hub type for conversion +func (rule *NamespacesEventhubsAuthorizationRule) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *NamespacesEventhubsAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion, + Kind: "NamespacesEventhubsAuthorizationRule", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101.NamespacesEventhubsAuthorizationRule +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} +type NamespacesEventhubsAuthorizationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesEventhubsAuthorizationRule `json:"items"` +} + +// Storage version of v1api20240101.Namespaces_Eventhubs_AuthorizationRule_Spec +type Namespaces_Eventhubs_AuthorizationRule_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"` + OperatorSpec *NamespacesEventhubsAuthorizationRuleOperatorSpec `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 eventhub.azure.com/NamespacesEventhub resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Rights []string `json:"rights,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec{} + +// ConvertSpecFrom populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(rule) +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_Spec +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(rule) +} + +// Storage version of v1api20240101.Namespaces_Eventhubs_AuthorizationRule_STATUS +type Namespaces_Eventhubs_AuthorizationRule_STATUS struct { + Conditions []conditions.Condition `json:"conditions,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Rights []string `json:"rights,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_AuthorizationRule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(rule) +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(rule) +} + +// Storage version of v1api20240101.NamespacesEventhubsAuthorizationRuleOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesEventhubsAuthorizationRuleOperatorSpec struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// Storage version of v1api20240101.NamespacesEventhubsAuthorizationRuleOperatorSecrets +type NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesEventhubsAuthorizationRule{}, &NamespacesEventhubsAuthorizationRuleList{}) +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..b8969f255e3 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go @@ -0,0 +1,352 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesEventhubsAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRule instances for property testing - lazily instantiated by +// NamespacesEventhubsAuthorizationRuleGenerator() +var namespacesEventhubsAuthorizationRuleGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleGenerator returns a generator of NamespacesEventhubsAuthorizationRule instances for property testing. +func NamespacesEventhubsAuthorizationRuleGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleGenerator != nil { + return namespacesEventhubsAuthorizationRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(generators) + namespacesEventhubsAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRule{}), generators) + + return namespacesEventhubsAuthorizationRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() + gens["Status"] = Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() +var namespaces_Eventhubs_AuthorizationRule_SpecGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_SpecGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_SpecGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) + namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["OriginalVersion"] = gen.AlphaString() + gens["Rights"] = gen.SliceOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator()) +} + +func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_AuthorizationRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() +var namespaces_Eventhubs_AuthorizationRule_STATUSGenerator gopter.Gen + +// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing. +// We first initialize namespaces_Eventhubs_AuthorizationRule_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() gopter.Gen { + if namespaces_Eventhubs_AuthorizationRule_STATUSGenerator != nil { + return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) + namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) + namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) + + return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Rights"] = gen.SliceOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSpecGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSpecGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(generators) + namespacesEventhubsAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSpec{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { + gens["Secrets"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator()) +} + +func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSecrets via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated +// by NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() +var namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator gopter.Gen + +// NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing. +func NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { + if namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator != nil { + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSecrets{}), generators) + + return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go new file mode 100644 index 00000000000..87e7d940108 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go @@ -0,0 +1,213 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsconsumergroups/status,namespaceseventhubsconsumergroups/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 v1api20240101.NamespacesEventhubsConsumerGroup +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} +type NamespacesEventhubsConsumerGroup struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Eventhubs_Consumergroup_Spec `json:"spec,omitempty"` + Status Namespaces_Eventhubs_Consumergroup_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesEventhubsConsumerGroup{} + +// GetConditions returns the conditions of the resource +func (group *NamespacesEventhubsConsumerGroup) GetConditions() conditions.Conditions { + return group.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (group *NamespacesEventhubsConsumerGroup) SetConditions(conditions conditions.Conditions) { + group.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} + +// AzureName returns the Azure name of the resource +func (group *NamespacesEventhubsConsumerGroup) AzureName() string { + return group.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (group NamespacesEventhubsConsumerGroup) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (group *NamespacesEventhubsConsumerGroup) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (group *NamespacesEventhubsConsumerGroup) GetSpec() genruntime.ConvertibleSpec { + return &group.Spec +} + +// GetStatus returns the status of this resource +func (group *NamespacesEventhubsConsumerGroup) GetStatus() genruntime.ConvertibleStatus { + return &group.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (group *NamespacesEventhubsConsumerGroup) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/consumergroups" +func (group *NamespacesEventhubsConsumerGroup) GetType() string { + return "Microsoft.EventHub/namespaces/eventhubs/consumergroups" +} + +// NewEmptyStatus returns a new empty (blank) status +func (group *NamespacesEventhubsConsumerGroup) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Eventhubs_Consumergroup_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (group *NamespacesEventhubsConsumerGroup) Owner() *genruntime.ResourceReference { + ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) + return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) +} + +// SetStatus sets the status of this resource +func (group *NamespacesEventhubsConsumerGroup) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { + group.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Eventhubs_Consumergroup_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + group.Status = st + return nil +} + +// Hub marks that this NamespacesEventhubsConsumerGroup is the hub type for conversion +func (group *NamespacesEventhubsConsumerGroup) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (group *NamespacesEventhubsConsumerGroup) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: group.Spec.OriginalVersion, + Kind: "NamespacesEventhubsConsumerGroup", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101.NamespacesEventhubsConsumerGroup +// Generator information: +// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} +type NamespacesEventhubsConsumerGroupList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesEventhubsConsumerGroup `json:"items"` +} + +// Storage version of v1api20240101.Namespaces_Eventhubs_Consumergroup_Spec +type Namespaces_Eventhubs_Consumergroup_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"` + 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 eventhub.azure.com/NamespacesEventhub resource + Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + UserMetadata *string `json:"userMetadata,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_Consumergroup_Spec{} + +// ConvertSpecFrom populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(consumergroup) +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_Spec +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(consumergroup) +} + +// Storage version of v1api20240101.Namespaces_Eventhubs_Consumergroup_STATUS +type Namespaces_Eventhubs_Consumergroup_STATUS struct { + Conditions []conditions.Condition `json:"conditions,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` + UserMetadata *string `json:"userMetadata,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_Consumergroup_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(consumergroup) +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(consumergroup) +} + +func init() { + SchemeBuilder.Register(&NamespacesEventhubsConsumerGroup{}, &NamespacesEventhubsConsumerGroupList{}) +} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go new file mode 100644 index 00000000000..bd224b18b28 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go @@ -0,0 +1,224 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesEventhubsConsumerGroup_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesEventhubsConsumerGroup via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesEventhubsConsumerGroup runs a test to see if a specific instance of NamespacesEventhubsConsumerGroup round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesEventhubsConsumerGroup + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesEventhubsConsumerGroup instances for property testing - lazily instantiated by +// NamespacesEventhubsConsumerGroupGenerator() +var namespacesEventhubsConsumerGroupGenerator gopter.Gen + +// NamespacesEventhubsConsumerGroupGenerator returns a generator of NamespacesEventhubsConsumerGroup instances for property testing. +func NamespacesEventhubsConsumerGroupGenerator() gopter.Gen { + if namespacesEventhubsConsumerGroupGenerator != nil { + return namespacesEventhubsConsumerGroupGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(generators) + namespacesEventhubsConsumerGroupGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsConsumerGroup{}), generators) + + return namespacesEventhubsConsumerGroupGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Eventhubs_Consumergroup_SpecGenerator() + gens["Status"] = Namespaces_Eventhubs_Consumergroup_STATUSGenerator() +} + +func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_Spec instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_Consumergroup_SpecGenerator() +var namespaces_Eventhubs_Consumergroup_SpecGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_SpecGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Spec instances for property testing. +func Namespaces_Eventhubs_Consumergroup_SpecGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_SpecGenerator != nil { + return namespaces_Eventhubs_Consumergroup_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(generators) + namespaces_Eventhubs_Consumergroup_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec{}), generators) + + return namespaces_Eventhubs_Consumergroup_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["OriginalVersion"] = gen.AlphaString() + gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Namespaces_Eventhubs_Consumergroup_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing - lazily instantiated by +// Namespaces_Eventhubs_Consumergroup_STATUSGenerator() +var namespaces_Eventhubs_Consumergroup_STATUSGenerator gopter.Gen + +// Namespaces_Eventhubs_Consumergroup_STATUSGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing. +// We first initialize namespaces_Eventhubs_Consumergroup_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Namespaces_Eventhubs_Consumergroup_STATUSGenerator() gopter.Gen { + if namespaces_Eventhubs_Consumergroup_STATUSGenerator != nil { + return namespaces_Eventhubs_Consumergroup_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) + namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) + namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) + + return namespaces_Eventhubs_Consumergroup_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} diff --git a/v2/api/eventhub/v1api20240101/storage/structure.txt b/v2/api/eventhub/v1api20240101/storage/structure.txt new file mode 100644 index 00000000000..c148579b240 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/structure.txt @@ -0,0 +1,283 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage +├── APIVersion: Enum (1 value) +│ └── "2024-01-01" +├── Namespace: Resource +│ ├── Owner: resources/v1apiv20191001.ResourceGroup +│ ├── Spec: Object (19 properties) +│ │ ├── AlternateName: *string +│ │ ├── AzureName: string +│ │ ├── ClusterArmReference: *genruntime.ResourceReference +│ │ ├── DisableLocalAuth: *bool +│ │ ├── Encryption: *Object (4 properties) +│ │ │ ├── KeySource: *string +│ │ │ ├── KeyVaultProperties: Object (5 properties)[] +│ │ │ │ ├── Identity: *Object (2 properties) +│ │ │ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference +│ │ │ │ ├── KeyName: *string +│ │ │ │ ├── KeyVaultUri: *string +│ │ │ │ ├── KeyVersion: *string +│ │ │ │ └── PropertyBag: genruntime.PropertyBag +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── RequireInfrastructureEncryption: *bool +│ │ ├── Identity: *Object (3 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── Type: *string +│ │ │ └── UserAssignedIdentities: Object (2 properties)[] +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Reference: genruntime.ResourceReference +│ │ ├── IsAutoInflateEnabled: *bool +│ │ ├── KafkaEnabled: *bool +│ │ ├── Location: *string +│ │ ├── MaximumThroughputUnits: *int +│ │ ├── MinimumTlsVersion: *string +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── PublicNetworkAccess: *string +│ │ ├── Sku: *Object (4 properties) +│ │ │ ├── Capacity: *int +│ │ │ ├── Name: *string +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Tier: *string +│ │ ├── Tags: map[string]string +│ │ └── ZoneRedundant: *bool +│ └── Status: Object (27 properties) +│ ├── AlternateName: *string +│ ├── ClusterArmId: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CreatedAt: *string +│ ├── DisableLocalAuth: *bool +│ ├── Encryption: *Object (4 properties) +│ │ ├── KeySource: *string +│ │ ├── KeyVaultProperties: Object (5 properties)[] +│ │ │ ├── Identity: *Object (2 properties) +│ │ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ │ └── UserAssignedIdentity: *string +│ │ │ ├── KeyName: *string +│ │ │ ├── KeyVaultUri: *string +│ │ │ ├── KeyVersion: *string +│ │ │ └── PropertyBag: genruntime.PropertyBag +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── RequireInfrastructureEncryption: *bool +│ ├── Id: *string +│ ├── Identity: *Object (5 properties) +│ │ ├── PrincipalId: *string +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── TenantId: *string +│ │ ├── Type: *string +│ │ └── UserAssignedIdentities: map[string]Object (3 properties) +│ │ ├── ClientId: *string +│ │ ├── PrincipalId: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── IsAutoInflateEnabled: *bool +│ ├── KafkaEnabled: *bool +│ ├── Location: *string +│ ├── MaximumThroughputUnits: *int +│ ├── MetricId: *string +│ ├── MinimumTlsVersion: *string +│ ├── Name: *string +│ ├── PrivateEndpointConnections: Object (2 properties)[] +│ │ ├── Id: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── ProvisioningState: *string +│ ├── PublicNetworkAccess: *string +│ ├── ServiceBusEndpoint: *string +│ ├── Sku: *Object (4 properties) +│ │ ├── Capacity: *int +│ │ ├── Name: *string +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── Tier: *string +│ ├── Status: *string +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Tags: map[string]string +│ ├── Type: *string +│ ├── UpdatedAt: *string +│ └── ZoneRedundant: *bool +├── NamespacesAuthorizationRule: Resource +│ ├── Owner: eventhub/v1api20240101.Namespace +│ ├── Spec: Object (6 properties) +│ │ ├── AzureName: string +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── Rights: string[] +│ └── Status: Object (8 properties) +│ ├── Conditions: conditions.Condition[] +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── Rights: string[] +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ └── Type: *string +├── NamespacesEventhub: Resource +│ ├── Owner: eventhub/v1api20240101.Namespace +│ ├── Spec: Object (8 properties) +│ │ ├── AzureName: string +│ │ ├── CaptureDescription: *Object (7 properties) +│ │ │ ├── Destination: *Object (9 properties) +│ │ │ │ ├── ArchiveNameFormat: *string +│ │ │ │ ├── BlobContainer: *string +│ │ │ │ ├── DataLakeAccountName: *string +│ │ │ │ ├── DataLakeFolderPath: *string +│ │ │ │ ├── DataLakeSubscriptionId: *string +│ │ │ │ ├── Identity: *Object (3 properties) +│ │ │ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ │ │ ├── Type: *string +│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference +│ │ │ │ ├── Name: *string +│ │ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ │ └── StorageAccountResourceReference: *genruntime.ResourceReference +│ │ │ ├── Enabled: *bool +│ │ │ ├── Encoding: *string +│ │ │ ├── IntervalInSeconds: *int +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SizeLimitInBytes: *int +│ │ │ └── SkipEmptyArchives: *bool +│ │ ├── MessageRetentionInDays: *int +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PartitionCount: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── RetentionDescription: *Object (4 properties) +│ │ ├── CleanupPolicy: *string +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RetentionTimeInHours: *int +│ │ └── TombstoneRetentionTimeInHours: *int +│ └── Status: Object (15 properties) +│ ├── CaptureDescription: *Object (7 properties) +│ │ ├── Destination: *Object (9 properties) +│ │ │ ├── ArchiveNameFormat: *string +│ │ │ ├── BlobContainer: *string +│ │ │ ├── DataLakeAccountName: *string +│ │ │ ├── DataLakeFolderPath: *string +│ │ │ ├── DataLakeSubscriptionId: *string +│ │ │ ├── Identity: *Object (3 properties) +│ │ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ │ ├── Type: *string +│ │ │ │ └── UserAssignedIdentity: *string +│ │ │ ├── Name: *string +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── StorageAccountResourceId: *string +│ │ ├── Enabled: *bool +│ │ ├── Encoding: *string +│ │ ├── IntervalInSeconds: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── SizeLimitInBytes: *int +│ │ └── SkipEmptyArchives: *bool +│ ├── Conditions: conditions.Condition[] +│ ├── CreatedAt: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── MessageRetentionInDays: *int +│ ├── Name: *string +│ ├── PartitionCount: *int +│ ├── PartitionIds: string[] +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── RetentionDescription: *Object (4 properties) +│ │ ├── CleanupPolicy: *string +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RetentionTimeInHours: *int +│ │ └── TombstoneRetentionTimeInHours: *int +│ ├── Status: *string +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Type: *string +│ └── UpdatedAt: *string +├── NamespacesEventhubsAuthorizationRule: Resource +│ ├── Owner: eventhub/v1api20240101.NamespacesEventhub +│ ├── Spec: Object (6 properties) +│ │ ├── AzureName: string +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── Rights: string[] +│ └── Status: Object (8 properties) +│ ├── Conditions: conditions.Condition[] +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── Rights: string[] +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ └── Type: *string +└── NamespacesEventhubsConsumerGroup: Resource + ├── Owner: eventhub/v1api20240101.NamespacesEventhub + ├── Spec: Object (5 properties) + │ ├── AzureName: string + │ ├── OriginalVersion: string + │ ├── Owner: *genruntime.KnownResourceReference + │ ├── PropertyBag: genruntime.PropertyBag + │ └── UserMetadata: *string + └── Status: Object (10 properties) + ├── Conditions: conditions.Condition[] + ├── CreatedAt: *string + ├── Id: *string + ├── Location: *string + ├── Name: *string + ├── PropertyBag: genruntime.PropertyBag + ├── SystemData: *Object (7 properties) + │ ├── CreatedAt: *string + │ ├── CreatedBy: *string + │ ├── CreatedByType: *string + │ ├── LastModifiedAt: *string + │ ├── LastModifiedBy: *string + │ ├── LastModifiedByType: *string + │ └── PropertyBag: genruntime.PropertyBag + ├── Type: *string + ├── UpdatedAt: *string + └── UserMetadata: *string diff --git a/v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go b/v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go new file mode 100644 index 00000000000..9d235de3676 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go @@ -0,0 +1,2082 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + 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 *CaptureDescription) DeepCopyInto(out *CaptureDescription) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(Destination) + (*in).DeepCopyInto(*out) + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Encoding != nil { + in, out := &in.Encoding, &out.Encoding + *out = new(string) + **out = **in + } + if in.IntervalInSeconds != nil { + in, out := &in.IntervalInSeconds, &out.IntervalInSeconds + *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.SizeLimitInBytes != nil { + in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes + *out = new(int) + **out = **in + } + if in.SkipEmptyArchives != nil { + in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription. +func (in *CaptureDescription) DeepCopy() *CaptureDescription { + if in == nil { + return nil + } + out := new(CaptureDescription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureDescription_STATUS) DeepCopyInto(out *CaptureDescription_STATUS) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(Destination_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Encoding != nil { + in, out := &in.Encoding, &out.Encoding + *out = new(string) + **out = **in + } + if in.IntervalInSeconds != nil { + in, out := &in.IntervalInSeconds, &out.IntervalInSeconds + *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.SizeLimitInBytes != nil { + in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes + *out = new(int) + **out = **in + } + if in.SkipEmptyArchives != nil { + in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_STATUS. +func (in *CaptureDescription_STATUS) DeepCopy() *CaptureDescription_STATUS { + if in == nil { + return nil + } + out := new(CaptureDescription_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 *CaptureIdentity) DeepCopyInto(out *CaptureIdentity) { + *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.UserAssignedIdentityReference != nil { + in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureIdentity. +func (in *CaptureIdentity) DeepCopy() *CaptureIdentity { + if in == nil { + return nil + } + out := new(CaptureIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureIdentity_STATUS) DeepCopyInto(out *CaptureIdentity_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.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **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 CaptureIdentity_STATUS. +func (in *CaptureIdentity_STATUS) DeepCopy() *CaptureIdentity_STATUS { + if in == nil { + return nil + } + out := new(CaptureIdentity_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 *Destination) DeepCopyInto(out *Destination) { + *out = *in + if in.ArchiveNameFormat != nil { + in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat + *out = new(string) + **out = **in + } + if in.BlobContainer != nil { + in, out := &in.BlobContainer, &out.BlobContainer + *out = new(string) + **out = **in + } + if in.DataLakeAccountName != nil { + in, out := &in.DataLakeAccountName, &out.DataLakeAccountName + *out = new(string) + **out = **in + } + if in.DataLakeFolderPath != nil { + in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath + *out = new(string) + **out = **in + } + if in.DataLakeSubscriptionId != nil { + in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(CaptureIdentity) + (*in).DeepCopyInto(*out) + } + 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.StorageAccountResourceReference != nil { + in, out := &in.StorageAccountResourceReference, &out.StorageAccountResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination. +func (in *Destination) DeepCopy() *Destination { + if in == nil { + return nil + } + out := new(Destination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Destination_STATUS) DeepCopyInto(out *Destination_STATUS) { + *out = *in + if in.ArchiveNameFormat != nil { + in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat + *out = new(string) + **out = **in + } + if in.BlobContainer != nil { + in, out := &in.BlobContainer, &out.BlobContainer + *out = new(string) + **out = **in + } + if in.DataLakeAccountName != nil { + in, out := &in.DataLakeAccountName, &out.DataLakeAccountName + *out = new(string) + **out = **in + } + if in.DataLakeFolderPath != nil { + in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath + *out = new(string) + **out = **in + } + if in.DataLakeSubscriptionId != nil { + in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(CaptureIdentity_STATUS) + (*in).DeepCopyInto(*out) + } + 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.StorageAccountResourceId != nil { + in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_STATUS. +func (in *Destination_STATUS) DeepCopy() *Destination_STATUS { + if in == nil { + return nil + } + out := new(Destination_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 *Encryption) DeepCopyInto(out *Encryption) { + *out = *in + if in.KeySource != nil { + in, out := &in.KeySource, &out.KeySource + *out = new(string) + **out = **in + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = make([]KeyVaultProperties, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.RequireInfrastructureEncryption != nil { + in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption. +func (in *Encryption) DeepCopy() *Encryption { + if in == nil { + return nil + } + out := new(Encryption) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Encryption_STATUS) DeepCopyInto(out *Encryption_STATUS) { + *out = *in + if in.KeySource != nil { + in, out := &in.KeySource, &out.KeySource + *out = new(string) + **out = **in + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = make([]KeyVaultProperties_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.RequireInfrastructureEncryption != nil { + in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_STATUS. +func (in *Encryption_STATUS) DeepCopy() *Encryption_STATUS { + if in == nil { + return nil + } + out := new(Encryption_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity) DeepCopyInto(out *Identity) { + *out = *in + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make([]UserAssignedIdentityDetails, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. +func (in *Identity) DeepCopy() *Identity { + if in == nil { + return nil + } + out := new(Identity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity_STATUS) DeepCopyInto(out *Identity_STATUS) { + *out = *in + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]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.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(UserAssignedIdentityProperties) + (*in).DeepCopyInto(*out) + } + if in.KeyName != nil { + in, out := &in.KeyName, &out.KeyName + *out = new(string) + **out = **in + } + if in.KeyVaultUri != nil { + in, out := &in.KeyVaultUri, &out.KeyVaultUri + *out = new(string) + **out = **in + } + if in.KeyVersion != nil { + in, out := &in.KeyVersion, &out.KeyVersion + *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.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(UserAssignedIdentityProperties_STATUS) + (*in).DeepCopyInto(*out) + } + if in.KeyName != nil { + in, out := &in.KeyName, &out.KeyName + *out = new(string) + **out = **in + } + if in.KeyVaultUri != nil { + in, out := &in.KeyVaultUri, &out.KeyVaultUri + *out = new(string) + **out = **in + } + if in.KeyVersion != nil { + in, out := &in.KeyVersion, &out.KeyVersion + *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 *Namespace) DeepCopyInto(out *Namespace) { + *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 Namespace. +func (in *Namespace) DeepCopy() *Namespace { + if in == nil { + return nil + } + out := new(Namespace) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Namespace) 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 *NamespaceList) DeepCopyInto(out *NamespaceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Namespace, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceList. +func (in *NamespaceList) DeepCopy() *NamespaceList { + if in == nil { + return nil + } + out := new(NamespaceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespaceList) 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 *NamespaceOperatorSecrets) DeepCopyInto(out *NamespaceOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *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.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSecrets. +func (in *NamespaceOperatorSecrets) DeepCopy() *NamespaceOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespaceOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceOperatorSpec) DeepCopyInto(out *NamespaceOperatorSpec) { + *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(NamespaceOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSpec. +func (in *NamespaceOperatorSpec) DeepCopy() *NamespaceOperatorSpec { + if in == nil { + return nil + } + out := new(NamespaceOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespace_STATUS) DeepCopyInto(out *Namespace_STATUS) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *out = new(string) + **out = **in + } + if in.ClusterArmId != nil { + in, out := &in.ClusterArmId, &out.ClusterArmId + *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.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(Encryption_STATUS) + (*in).DeepCopyInto(*out) + } + 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.IsAutoInflateEnabled != nil { + in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled + *out = new(bool) + **out = **in + } + if in.KafkaEnabled != nil { + in, out := &in.KafkaEnabled, &out.KafkaEnabled + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MaximumThroughputUnits != nil { + in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits + *out = new(int) + **out = **in + } + if in.MetricId != nil { + in, out := &in.MetricId, &out.MetricId + *out = new(string) + **out = **in + } + if in.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateEndpointConnections != nil { + in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections + *out = make([]PrivateEndpointConnection_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *out = new(string) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(string) + **out = **in + } + if in.ServiceBusEndpoint != nil { + in, out := &in.ServiceBusEndpoint, &out.ServiceBusEndpoint + *out = new(string) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **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.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.ZoneRedundant != nil { + in, out := &in.ZoneRedundant, &out.ZoneRedundant + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_STATUS. +func (in *Namespace_STATUS) DeepCopy() *Namespace_STATUS { + if in == nil { + return nil + } + out := new(Namespace_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 *Namespace_Spec) DeepCopyInto(out *Namespace_Spec) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *out = new(string) + **out = **in + } + if in.ClusterArmReference != nil { + in, out := &in.ClusterArmReference, &out.ClusterArmReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(Encryption) + (*in).DeepCopyInto(*out) + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.IsAutoInflateEnabled != nil { + in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled + *out = new(bool) + **out = **in + } + if in.KafkaEnabled != nil { + in, out := &in.KafkaEnabled, &out.KafkaEnabled + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MaximumThroughputUnits != nil { + in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits + *out = new(int) + **out = **in + } + if in.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(string) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespaceOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(string) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku) + (*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.ZoneRedundant != nil { + in, out := &in.ZoneRedundant, &out.ZoneRedundant + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Spec. +func (in *Namespace_Spec) DeepCopy() *Namespace_Spec { + if in == nil { + return nil + } + out := new(Namespace_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 *NamespacesAuthorizationRule) DeepCopyInto(out *NamespacesAuthorizationRule) { + *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 NamespacesAuthorizationRule. +func (in *NamespacesAuthorizationRule) DeepCopy() *NamespacesAuthorizationRule { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesAuthorizationRule) 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 *NamespacesAuthorizationRuleList) DeepCopyInto(out *NamespacesAuthorizationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesAuthorizationRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleList. +func (in *NamespacesAuthorizationRuleList) DeepCopy() *NamespacesAuthorizationRuleList { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesAuthorizationRuleList) 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 *NamespacesAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *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.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSecrets. +func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSpec) { + *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(NamespacesAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSpec. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhub) DeepCopyInto(out *NamespacesEventhub) { + *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 NamespacesEventhub. +func (in *NamespacesEventhub) DeepCopy() *NamespacesEventhub { + if in == nil { + return nil + } + out := new(NamespacesEventhub) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhub) 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 *NamespacesEventhubList) DeepCopyInto(out *NamespacesEventhubList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesEventhub, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubList. +func (in *NamespacesEventhubList) DeepCopy() *NamespacesEventhubList { + if in == nil { + return nil + } + out := new(NamespacesEventhubList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubList) 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 *NamespacesEventhubsAuthorizationRule) DeepCopyInto(out *NamespacesEventhubsAuthorizationRule) { + *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 NamespacesEventhubsAuthorizationRule. +func (in *NamespacesEventhubsAuthorizationRule) DeepCopy() *NamespacesEventhubsAuthorizationRule { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsAuthorizationRule) 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 *NamespacesEventhubsAuthorizationRuleList) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesEventhubsAuthorizationRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleList. +func (in *NamespacesEventhubsAuthorizationRuleList) DeepCopy() *NamespacesEventhubsAuthorizationRuleList { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsAuthorizationRuleList) 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 *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *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.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSecrets. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSpec) { + *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(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSpec. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsConsumerGroup) DeepCopyInto(out *NamespacesEventhubsConsumerGroup) { + *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 NamespacesEventhubsConsumerGroup. +func (in *NamespacesEventhubsConsumerGroup) DeepCopy() *NamespacesEventhubsConsumerGroup { + if in == nil { + return nil + } + out := new(NamespacesEventhubsConsumerGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsConsumerGroup) 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 *NamespacesEventhubsConsumerGroupList) DeepCopyInto(out *NamespacesEventhubsConsumerGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesEventhubsConsumerGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsConsumerGroupList. +func (in *NamespacesEventhubsConsumerGroupList) DeepCopy() *NamespacesEventhubsConsumerGroupList { + if in == nil { + return nil + } + out := new(NamespacesEventhubsConsumerGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsConsumerGroupList) 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 *Namespaces_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_AuthorizationRule_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.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.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*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 Namespaces_AuthorizationRule_STATUS. +func (in *Namespaces_AuthorizationRule_STATUS) DeepCopy() *Namespaces_AuthorizationRule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_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 *Namespaces_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec) { + *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Spec. +func (in *Namespaces_AuthorizationRule_Spec) DeepCopy() *Namespaces_AuthorizationRule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_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 *Namespaces_Eventhub_STATUS) DeepCopyInto(out *Namespaces_Eventhub_STATUS) { + *out = *in + if in.CaptureDescription != nil { + in, out := &in.CaptureDescription, &out.CaptureDescription + *out = new(CaptureDescription_STATUS) + (*in).DeepCopyInto(*out) + } + 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.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MessageRetentionInDays != nil { + in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PartitionCount != nil { + in, out := &in.PartitionCount, &out.PartitionCount + *out = new(int) + **out = **in + } + if in.PartitionIds != nil { + in, out := &in.PartitionIds, &out.PartitionIds + *out = make([]string, len(*in)) + copy(*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.RetentionDescription != nil { + in, out := &in.RetentionDescription, &out.RetentionDescription + *out = new(RetentionDescription_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_STATUS. +func (in *Namespaces_Eventhub_STATUS) DeepCopy() *Namespaces_Eventhub_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_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 *Namespaces_Eventhub_Spec) DeepCopyInto(out *Namespaces_Eventhub_Spec) { + *out = *in + if in.CaptureDescription != nil { + in, out := &in.CaptureDescription, &out.CaptureDescription + *out = new(CaptureDescription) + (*in).DeepCopyInto(*out) + } + if in.MessageRetentionInDays != nil { + in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PartitionCount != nil { + in, out := &in.PartitionCount, &out.PartitionCount + *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.RetentionDescription != nil { + in, out := &in.RetentionDescription, &out.RetentionDescription + *out = new(RetentionDescription) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Spec. +func (in *Namespaces_Eventhub_Spec) DeepCopy() *Namespaces_Eventhub_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_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 *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_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.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.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*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 Namespaces_Eventhubs_AuthorizationRule_STATUS. +func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec) { + *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Spec. +func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_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.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + 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.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.UserMetadata != nil { + in, out := &in.UserMetadata, &out.UserMetadata + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_STATUS. +func (in *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopy() *Namespaces_Eventhubs_Consumergroup_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_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 *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Spec) { + *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.UserMetadata != nil { + in, out := &in.UserMetadata, &out.UserMetadata + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Spec. +func (in *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_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 *PrivateEndpointConnection_STATUS) DeepCopyInto(out *PrivateEndpointConnection_STATUS) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *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 PrivateEndpointConnection_STATUS. +func (in *PrivateEndpointConnection_STATUS) DeepCopy() *PrivateEndpointConnection_STATUS { + if in == nil { + return nil + } + out := new(PrivateEndpointConnection_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 *RetentionDescription) DeepCopyInto(out *RetentionDescription) { + *out = *in + if in.CleanupPolicy != nil { + in, out := &in.CleanupPolicy, &out.CleanupPolicy + *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.RetentionTimeInHours != nil { + in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours + *out = new(int) + **out = **in + } + if in.TombstoneRetentionTimeInHours != nil { + in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription. +func (in *RetentionDescription) DeepCopy() *RetentionDescription { + if in == nil { + return nil + } + out := new(RetentionDescription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RetentionDescription_STATUS) DeepCopyInto(out *RetentionDescription_STATUS) { + *out = *in + if in.CleanupPolicy != nil { + in, out := &in.CleanupPolicy, &out.CleanupPolicy + *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.RetentionTimeInHours != nil { + in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours + *out = new(int) + **out = **in + } + if in.TombstoneRetentionTimeInHours != nil { + in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_STATUS. +func (in *RetentionDescription_STATUS) DeepCopy() *RetentionDescription_STATUS { + if in == nil { + return nil + } + out := new(RetentionDescription_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.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + 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.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + 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 *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.CreatedBy != nil { + in, out := &in.CreatedBy, &out.CreatedBy + *out = new(string) + **out = **in + } + if in.CreatedByType != nil { + in, out := &in.CreatedByType, &out.CreatedByType + *out = new(string) + **out = **in + } + if in.LastModifiedAt != nil { + in, out := &in.LastModifiedAt, &out.LastModifiedAt + *out = new(string) + **out = **in + } + if in.LastModifiedBy != nil { + in, out := &in.LastModifiedBy, &out.LastModifiedBy + *out = new(string) + **out = **in + } + if in.LastModifiedByType != nil { + in, out := &in.LastModifiedByType, &out.LastModifiedByType + *out = new(string) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS. +func (in *SystemData_STATUS) DeepCopy() *SystemData_STATUS { + if in == nil { + return nil + } + out := new(SystemData_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityDetails) DeepCopyInto(out *UserAssignedIdentityDetails) { + *out = *in + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + out.Reference = in.Reference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails. +func (in *UserAssignedIdentityDetails) DeepCopy() *UserAssignedIdentityDetails { + if in == nil { + return nil + } + out := new(UserAssignedIdentityDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityProperties) DeepCopyInto(out *UserAssignedIdentityProperties) { + *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.UserAssignedIdentityReference != nil { + in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityProperties. +func (in *UserAssignedIdentityProperties) DeepCopy() *UserAssignedIdentityProperties { + if in == nil { + return nil + } + out := new(UserAssignedIdentityProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityProperties_STATUS) DeepCopyInto(out *UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS. +func (in *UserAssignedIdentityProperties_STATUS) DeepCopy() *UserAssignedIdentityProperties_STATUS { + if in == nil { + return nil + } + out := new(UserAssignedIdentityProperties_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_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 + } + } +} + +// 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 +} diff --git a/v2/api/eventhub/v1api20240101/structure.txt b/v2/api/eventhub/v1api20240101/structure.txt new file mode 100644 index 00000000000..25f4b188e51 --- /dev/null +++ b/v2/api/eventhub/v1api20240101/structure.txt @@ -0,0 +1,669 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101 +├── APIVersion: Enum (1 value) +│ └── "2024-01-01" +├── Namespace: Resource +│ ├── Owner: resources/v1apiv20191001.ResourceGroup +│ ├── Spec: Object (17 properties) +│ │ ├── AlternateName: *string +│ │ ├── AzureName: Validated (3 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ ├── Rule 1: MinLength: 6 +│ │ │ └── Rule 2: Pattern: "^[a-zA-Z][a-zA-Z0-9-]{6,50}[a-zA-Z0-9]$" +│ │ ├── ClusterArmReference: *genruntime.ResourceReference +│ │ ├── DisableLocalAuth: *bool +│ │ ├── Encryption: *Object (3 properties) +│ │ │ ├── KeySource: *Enum (1 value) +│ │ │ │ └── "Microsoft.KeyVault" +│ │ │ ├── KeyVaultProperties: Object (4 properties)[] +│ │ │ │ ├── Identity: *Object (1 property) +│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference +│ │ │ │ ├── KeyName: *string +│ │ │ │ ├── KeyVaultUri: *string +│ │ │ │ └── KeyVersion: *string +│ │ │ └── RequireInfrastructureEncryption: *bool +│ │ ├── Identity: *Object (2 properties) +│ │ │ ├── Type: *Enum (4 values) +│ │ │ │ ├── "None" +│ │ │ │ ├── "SystemAssigned" +│ │ │ │ ├── "SystemAssigned, UserAssigned" +│ │ │ │ └── "UserAssigned" +│ │ │ └── UserAssignedIdentities: Object (1 property)[] +│ │ │ └── Reference: genruntime.ResourceReference +│ │ ├── IsAutoInflateEnabled: *bool +│ │ ├── KafkaEnabled: *bool +│ │ ├── Location: *string +│ │ ├── MaximumThroughputUnits: Validated<*int> (1 rule) +│ │ │ └── Rule 0: Minimum: 0 +│ │ ├── MinimumTlsVersion: *Enum (3 values) +│ │ │ ├── "1.0" +│ │ │ ├── "1.1" +│ │ │ └── "1.2" +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (4 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PublicNetworkAccess: *Enum (3 values) +│ │ │ ├── "Disabled" +│ │ │ ├── "Enabled" +│ │ │ └── "SecuredByPerimeter" +│ │ ├── Sku: *Object (3 properties) +│ │ │ ├── Capacity: Validated<*int> (1 rule) +│ │ │ │ └── Rule 0: Minimum: 0 +│ │ │ ├── Name: *Enum (3 values) +│ │ │ │ ├── "Basic" +│ │ │ │ ├── "Premium" +│ │ │ │ └── "Standard" +│ │ │ └── Tier: *Enum (3 values) +│ │ │ ├── "Basic" +│ │ │ ├── "Premium" +│ │ │ └── "Standard" +│ │ ├── Tags: map[string]string +│ │ └── ZoneRedundant: *bool +│ └── Status: Object (26 properties) +│ ├── AlternateName: *string +│ ├── ClusterArmId: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CreatedAt: *string +│ ├── DisableLocalAuth: *bool +│ ├── Encryption: *Object (3 properties) +│ │ ├── KeySource: *Enum (1 value) +│ │ │ └── "Microsoft.KeyVault" +│ │ ├── KeyVaultProperties: Object (4 properties)[] +│ │ │ ├── Identity: *Object (1 property) +│ │ │ │ └── UserAssignedIdentity: *string +│ │ │ ├── KeyName: *string +│ │ │ ├── KeyVaultUri: *string +│ │ │ └── KeyVersion: *string +│ │ └── RequireInfrastructureEncryption: *bool +│ ├── Id: *string +│ ├── Identity: *Object (4 properties) +│ │ ├── PrincipalId: *string +│ │ ├── TenantId: *string +│ │ ├── Type: *Enum (4 values) +│ │ │ ├── "None" +│ │ │ ├── "SystemAssigned" +│ │ │ ├── "SystemAssigned, UserAssigned" +│ │ │ └── "UserAssigned" +│ │ └── UserAssignedIdentities: map[string]Object (2 properties) +│ │ ├── ClientId: *string +│ │ └── PrincipalId: *string +│ ├── IsAutoInflateEnabled: *bool +│ ├── KafkaEnabled: *bool +│ ├── Location: *string +│ ├── MaximumThroughputUnits: *int +│ ├── MetricId: *string +│ ├── MinimumTlsVersion: *Enum (3 values) +│ │ ├── "1.0" +│ │ ├── "1.1" +│ │ └── "1.2" +│ ├── Name: *string +│ ├── PrivateEndpointConnections: Object (1 property)[] +│ │ └── Id: *string +│ ├── ProvisioningState: *string +│ ├── PublicNetworkAccess: *Enum (3 values) +│ │ ├── "Disabled" +│ │ ├── "Enabled" +│ │ └── "SecuredByPerimeter" +│ ├── ServiceBusEndpoint: *string +│ ├── Sku: *Object (3 properties) +│ │ ├── Capacity: *int +│ │ ├── Name: *Enum (3 values) +│ │ │ ├── "Basic" +│ │ │ ├── "Premium" +│ │ │ └── "Standard" +│ │ └── Tier: *Enum (3 values) +│ │ ├── "Basic" +│ │ ├── "Premium" +│ │ └── "Standard" +│ ├── Status: *string +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ ├── Tags: map[string]string +│ ├── Type: *string +│ ├── UpdatedAt: *string +│ └── ZoneRedundant: *bool +├── Namespace_STATUS_ARM: Object (9 properties) +│ ├── Id: *string +│ ├── Identity: *Object (4 properties) +│ │ ├── PrincipalId: *string +│ │ ├── TenantId: *string +│ │ ├── Type: *Enum (4 values) +│ │ │ ├── "None" +│ │ │ ├── "SystemAssigned" +│ │ │ ├── "SystemAssigned, UserAssigned" +│ │ │ └── "UserAssigned" +│ │ └── UserAssignedIdentities: map[string]Object (2 properties) +│ │ ├── ClientId: *string +│ │ └── PrincipalId: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (17 properties) +│ │ ├── AlternateName: *string +│ │ ├── ClusterArmId: *string +│ │ ├── CreatedAt: *string +│ │ ├── DisableLocalAuth: *bool +│ │ ├── Encryption: *Object (3 properties) +│ │ │ ├── KeySource: *Enum (1 value) +│ │ │ │ └── "Microsoft.KeyVault" +│ │ │ ├── KeyVaultProperties: Object (4 properties)[] +│ │ │ │ ├── Identity: *Object (1 property) +│ │ │ │ │ └── UserAssignedIdentity: *string +│ │ │ │ ├── KeyName: *string +│ │ │ │ ├── KeyVaultUri: *string +│ │ │ │ └── KeyVersion: *string +│ │ │ └── RequireInfrastructureEncryption: *bool +│ │ ├── IsAutoInflateEnabled: *bool +│ │ ├── KafkaEnabled: *bool +│ │ ├── MaximumThroughputUnits: *int +│ │ ├── MetricId: *string +│ │ ├── MinimumTlsVersion: *Enum (3 values) +│ │ │ ├── "1.0" +│ │ │ ├── "1.1" +│ │ │ └── "1.2" +│ │ ├── PrivateEndpointConnections: Object (1 property)[] +│ │ │ └── Id: *string +│ │ ├── ProvisioningState: *string +│ │ ├── PublicNetworkAccess: *Enum (3 values) +│ │ │ ├── "Disabled" +│ │ │ ├── "Enabled" +│ │ │ └── "SecuredByPerimeter" +│ │ ├── ServiceBusEndpoint: *string +│ │ ├── Status: *string +│ │ ├── UpdatedAt: *string +│ │ └── ZoneRedundant: *bool +│ ├── Sku: *Object (3 properties) +│ │ ├── Capacity: *int +│ │ ├── Name: *Enum (3 values) +│ │ │ ├── "Basic" +│ │ │ ├── "Premium" +│ │ │ └── "Standard" +│ │ └── Tier: *Enum (3 values) +│ │ ├── "Basic" +│ │ ├── "Premium" +│ │ └── "Standard" +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ ├── Tags: map[string]string +│ └── Type: *string +├── Namespace_Spec_ARM: Object (6 properties) +│ ├── Identity: *Object (2 properties) +│ │ ├── Type: *Enum (4 values) +│ │ │ ├── "None" +│ │ │ ├── "SystemAssigned" +│ │ │ ├── "SystemAssigned, UserAssigned" +│ │ │ └── "UserAssigned" +│ │ └── UserAssignedIdentities: map[string]Object (0 properties) +│ ├── Location: *string +│ ├── Name: string +│ ├── Properties: *Object (10 properties) +│ │ ├── AlternateName: *string +│ │ ├── ClusterArmId: *string +│ │ ├── DisableLocalAuth: *bool +│ │ ├── Encryption: *Object (3 properties) +│ │ │ ├── KeySource: *Enum (1 value) +│ │ │ │ └── "Microsoft.KeyVault" +│ │ │ ├── KeyVaultProperties: Object (4 properties)[] +│ │ │ │ ├── Identity: *Object (1 property) +│ │ │ │ │ └── UserAssignedIdentity: *string +│ │ │ │ ├── KeyName: *string +│ │ │ │ ├── KeyVaultUri: *string +│ │ │ │ └── KeyVersion: *string +│ │ │ └── RequireInfrastructureEncryption: *bool +│ │ ├── IsAutoInflateEnabled: *bool +│ │ ├── KafkaEnabled: *bool +│ │ ├── MaximumThroughputUnits: *int +│ │ ├── MinimumTlsVersion: *Enum (3 values) +│ │ │ ├── "1.0" +│ │ │ ├── "1.1" +│ │ │ └── "1.2" +│ │ ├── PublicNetworkAccess: *Enum (3 values) +│ │ │ ├── "Disabled" +│ │ │ ├── "Enabled" +│ │ │ └── "SecuredByPerimeter" +│ │ └── ZoneRedundant: *bool +│ ├── Sku: *Object (3 properties) +│ │ ├── Capacity: *int +│ │ ├── Name: *Enum (3 values) +│ │ │ ├── "Basic" +│ │ │ ├── "Premium" +│ │ │ └── "Standard" +│ │ └── Tier: *Enum (3 values) +│ │ ├── "Basic" +│ │ ├── "Premium" +│ │ └── "Standard" +│ └── Tags: map[string]string +├── NamespacesAuthorizationRule: Resource +│ ├── Owner: Namespace +│ ├── Spec: Object (4 properties) +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (4 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ └── Rights: Enum (3 values)[] +│ │ ├── "Listen" +│ │ ├── "Manage" +│ │ └── "Send" +│ └── Status: Object (7 properties) +│ ├── Conditions: conditions.Condition[] +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Rights: Enum (3 values)[] +│ │ ├── "Listen" +│ │ ├── "Manage" +│ │ └── "Send" +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ └── Type: *string +├── NamespacesEventhub: Resource +│ ├── Owner: Namespace +│ ├── Spec: Object (6 properties) +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 256 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── CaptureDescription: *Object (6 properties) +│ │ │ ├── Destination: *Object (8 properties) +│ │ │ │ ├── ArchiveNameFormat: *string +│ │ │ │ ├── BlobContainer: *string +│ │ │ │ ├── DataLakeAccountName: *string +│ │ │ │ ├── DataLakeFolderPath: *string +│ │ │ │ ├── DataLakeSubscriptionId: Validated<*string> (1 rule) +│ │ │ │ │ └── Rule 0: Pattern: "^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$" +│ │ │ │ ├── Identity: *Object (2 properties) +│ │ │ │ │ ├── Type: *Enum (2 values) +│ │ │ │ │ │ ├── "SystemAssigned" +│ │ │ │ │ │ └── "UserAssigned" +│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference +│ │ │ │ ├── Name: *string +│ │ │ │ └── StorageAccountResourceReference: *genruntime.ResourceReference +│ │ │ ├── Enabled: *bool +│ │ │ ├── Encoding: *Enum (2 values) +│ │ │ │ ├── "Avro" +│ │ │ │ └── "AvroDeflate" +│ │ │ ├── IntervalInSeconds: *int +│ │ │ ├── SizeLimitInBytes: *int +│ │ │ └── SkipEmptyArchives: *bool +│ │ ├── MessageRetentionInDays: Validated<*int> (1 rule) +│ │ │ └── Rule 0: Minimum: 1 +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PartitionCount: Validated<*int> (1 rule) +│ │ │ └── Rule 0: Minimum: 1 +│ │ └── RetentionDescription: *Object (3 properties) +│ │ ├── CleanupPolicy: *Enum (2 values) +│ │ │ ├── "Compact" +│ │ │ └── "Delete" +│ │ ├── RetentionTimeInHours: *int +│ │ └── TombstoneRetentionTimeInHours: *int +│ └── Status: Object (14 properties) +│ ├── CaptureDescription: *Object (6 properties) +│ │ ├── Destination: *Object (8 properties) +│ │ │ ├── ArchiveNameFormat: *string +│ │ │ ├── BlobContainer: *string +│ │ │ ├── DataLakeAccountName: *string +│ │ │ ├── DataLakeFolderPath: *string +│ │ │ ├── DataLakeSubscriptionId: *string +│ │ │ ├── Identity: *Object (2 properties) +│ │ │ │ ├── Type: *Enum (2 values) +│ │ │ │ │ ├── "SystemAssigned" +│ │ │ │ │ └── "UserAssigned" +│ │ │ │ └── UserAssignedIdentity: *string +│ │ │ ├── Name: *string +│ │ │ └── StorageAccountResourceId: *string +│ │ ├── Enabled: *bool +│ │ ├── Encoding: *Enum (2 values) +│ │ │ ├── "Avro" +│ │ │ └── "AvroDeflate" +│ │ ├── IntervalInSeconds: *int +│ │ ├── SizeLimitInBytes: *int +│ │ └── SkipEmptyArchives: *bool +│ ├── Conditions: conditions.Condition[] +│ ├── CreatedAt: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── MessageRetentionInDays: *int +│ ├── Name: *string +│ ├── PartitionCount: *int +│ ├── PartitionIds: string[] +│ ├── RetentionDescription: *Object (3 properties) +│ │ ├── CleanupPolicy: *Enum (2 values) +│ │ │ ├── "Compact" +│ │ │ └── "Delete" +│ │ ├── RetentionTimeInHours: *int +│ │ └── TombstoneRetentionTimeInHours: *int +│ ├── Status: *Enum (9 values) +│ │ ├── "Active" +│ │ ├── "Creating" +│ │ ├── "Deleting" +│ │ ├── "Disabled" +│ │ ├── "ReceiveDisabled" +│ │ ├── "Renaming" +│ │ ├── "Restoring" +│ │ ├── "SendDisabled" +│ │ └── "Unknown" +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ ├── Type: *string +│ └── UpdatedAt: *string +├── NamespacesEventhubsAuthorizationRule: Resource +│ ├── Owner: NamespacesEventhub +│ ├── Spec: Object (4 properties) +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (4 properties) +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ └── Rights: Enum (3 values)[] +│ │ ├── "Listen" +│ │ ├── "Manage" +│ │ └── "Send" +│ └── Status: Object (7 properties) +│ ├── Conditions: conditions.Condition[] +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Rights: Enum (3 values)[] +│ │ ├── "Listen" +│ │ ├── "Manage" +│ │ └── "Send" +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ └── Type: *string +├── NamespacesEventhubsConsumerGroup: Resource +│ ├── Owner: NamespacesEventhub +│ ├── Spec: Object (3 properties) +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ └── UserMetadata: *string +│ └── Status: Object (9 properties) +│ ├── Conditions: conditions.Condition[] +│ ├── CreatedAt: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ ├── Type: *string +│ ├── UpdatedAt: *string +│ └── UserMetadata: *string +├── Namespaces_AuthorizationRule_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (1 property) +│ │ └── Rights: Enum (3 values)[] +│ │ ├── "Listen" +│ │ ├── "Manage" +│ │ └── "Send" +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ └── Type: *string +├── Namespaces_AuthorizationRule_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (1 property) +│ └── Rights: Enum (3 values)[] +│ ├── "Listen" +│ ├── "Manage" +│ └── "Send" +├── Namespaces_Eventhub_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (8 properties) +│ │ ├── CaptureDescription: *Object (6 properties) +│ │ │ ├── Destination: *Object (3 properties) +│ │ │ │ ├── Identity: *Object (2 properties) +│ │ │ │ │ ├── Type: *Enum (2 values) +│ │ │ │ │ │ ├── "SystemAssigned" +│ │ │ │ │ │ └── "UserAssigned" +│ │ │ │ │ └── UserAssignedIdentity: *string +│ │ │ │ ├── Name: *string +│ │ │ │ └── Properties: *Object (6 properties) +│ │ │ │ ├── ArchiveNameFormat: *string +│ │ │ │ ├── BlobContainer: *string +│ │ │ │ ├── DataLakeAccountName: *string +│ │ │ │ ├── DataLakeFolderPath: *string +│ │ │ │ ├── DataLakeSubscriptionId: *string +│ │ │ │ └── StorageAccountResourceId: *string +│ │ │ ├── Enabled: *bool +│ │ │ ├── Encoding: *Enum (2 values) +│ │ │ │ ├── "Avro" +│ │ │ │ └── "AvroDeflate" +│ │ │ ├── IntervalInSeconds: *int +│ │ │ ├── SizeLimitInBytes: *int +│ │ │ └── SkipEmptyArchives: *bool +│ │ ├── CreatedAt: *string +│ │ ├── MessageRetentionInDays: *int +│ │ ├── PartitionCount: *int +│ │ ├── PartitionIds: string[] +│ │ ├── RetentionDescription: *Object (3 properties) +│ │ │ ├── CleanupPolicy: *Enum (2 values) +│ │ │ │ ├── "Compact" +│ │ │ │ └── "Delete" +│ │ │ ├── RetentionTimeInHours: *int +│ │ │ └── TombstoneRetentionTimeInHours: *int +│ │ ├── Status: *Enum (9 values) +│ │ │ ├── "Active" +│ │ │ ├── "Creating" +│ │ │ ├── "Deleting" +│ │ │ ├── "Disabled" +│ │ │ ├── "ReceiveDisabled" +│ │ │ ├── "Renaming" +│ │ │ ├── "Restoring" +│ │ │ ├── "SendDisabled" +│ │ │ └── "Unknown" +│ │ └── UpdatedAt: *string +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ └── Type: *string +├── Namespaces_Eventhub_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (4 properties) +│ ├── CaptureDescription: *Object (6 properties) +│ │ ├── Destination: *Object (3 properties) +│ │ │ ├── Identity: *Object (2 properties) +│ │ │ │ ├── Type: *Enum (2 values) +│ │ │ │ │ ├── "SystemAssigned" +│ │ │ │ │ └── "UserAssigned" +│ │ │ │ └── UserAssignedIdentity: *string +│ │ │ ├── Name: *string +│ │ │ └── Properties: *Object (6 properties) +│ │ │ ├── ArchiveNameFormat: *string +│ │ │ ├── BlobContainer: *string +│ │ │ ├── DataLakeAccountName: *string +│ │ │ ├── DataLakeFolderPath: *string +│ │ │ ├── DataLakeSubscriptionId: *string +│ │ │ └── StorageAccountResourceId: *string +│ │ ├── Enabled: *bool +│ │ ├── Encoding: *Enum (2 values) +│ │ │ ├── "Avro" +│ │ │ └── "AvroDeflate" +│ │ ├── IntervalInSeconds: *int +│ │ ├── SizeLimitInBytes: *int +│ │ └── SkipEmptyArchives: *bool +│ ├── MessageRetentionInDays: *int +│ ├── PartitionCount: *int +│ └── RetentionDescription: *Object (3 properties) +│ ├── CleanupPolicy: *Enum (2 values) +│ │ ├── "Compact" +│ │ └── "Delete" +│ ├── RetentionTimeInHours: *int +│ └── TombstoneRetentionTimeInHours: *int +├── Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (1 property) +│ │ └── Rights: Enum (3 values)[] +│ │ ├── "Listen" +│ │ ├── "Manage" +│ │ └── "Send" +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ └── Type: *string +├── Namespaces_Eventhubs_AuthorizationRule_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (1 property) +│ └── Rights: Enum (3 values)[] +│ ├── "Listen" +│ ├── "Manage" +│ └── "Send" +├── Namespaces_Eventhubs_Consumergroup_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (3 properties) +│ │ ├── CreatedAt: *string +│ │ ├── UpdatedAt: *string +│ │ └── UserMetadata: *string +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ └── Type: *string +└── Namespaces_Eventhubs_Consumergroup_Spec_ARM: Object (2 properties) + ├── Name: string + └── Properties: *Object (1 property) + └── UserMetadata: *string diff --git a/v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go b/v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go new file mode 100644 index 00000000000..bcbd04a6b9c --- /dev/null +++ b/v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go @@ -0,0 +1,3318 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20240101 + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureDescription) DeepCopyInto(out *CaptureDescription) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(Destination) + (*in).DeepCopyInto(*out) + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Encoding != nil { + in, out := &in.Encoding, &out.Encoding + *out = new(CaptureDescription_Encoding) + **out = **in + } + if in.IntervalInSeconds != nil { + in, out := &in.IntervalInSeconds, &out.IntervalInSeconds + *out = new(int) + **out = **in + } + if in.SizeLimitInBytes != nil { + in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes + *out = new(int) + **out = **in + } + if in.SkipEmptyArchives != nil { + in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription. +func (in *CaptureDescription) DeepCopy() *CaptureDescription { + if in == nil { + return nil + } + out := new(CaptureDescription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureDescription_ARM) DeepCopyInto(out *CaptureDescription_ARM) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(Destination_ARM) + (*in).DeepCopyInto(*out) + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Encoding != nil { + in, out := &in.Encoding, &out.Encoding + *out = new(CaptureDescription_Encoding) + **out = **in + } + if in.IntervalInSeconds != nil { + in, out := &in.IntervalInSeconds, &out.IntervalInSeconds + *out = new(int) + **out = **in + } + if in.SizeLimitInBytes != nil { + in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes + *out = new(int) + **out = **in + } + if in.SkipEmptyArchives != nil { + in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_ARM. +func (in *CaptureDescription_ARM) DeepCopy() *CaptureDescription_ARM { + if in == nil { + return nil + } + out := new(CaptureDescription_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureDescription_STATUS) DeepCopyInto(out *CaptureDescription_STATUS) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(Destination_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Encoding != nil { + in, out := &in.Encoding, &out.Encoding + *out = new(CaptureDescription_Encoding_STATUS) + **out = **in + } + if in.IntervalInSeconds != nil { + in, out := &in.IntervalInSeconds, &out.IntervalInSeconds + *out = new(int) + **out = **in + } + if in.SizeLimitInBytes != nil { + in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes + *out = new(int) + **out = **in + } + if in.SkipEmptyArchives != nil { + in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_STATUS. +func (in *CaptureDescription_STATUS) DeepCopy() *CaptureDescription_STATUS { + if in == nil { + return nil + } + out := new(CaptureDescription_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 *CaptureDescription_STATUS_ARM) DeepCopyInto(out *CaptureDescription_STATUS_ARM) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(Destination_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Encoding != nil { + in, out := &in.Encoding, &out.Encoding + *out = new(CaptureDescription_Encoding_STATUS) + **out = **in + } + if in.IntervalInSeconds != nil { + in, out := &in.IntervalInSeconds, &out.IntervalInSeconds + *out = new(int) + **out = **in + } + if in.SizeLimitInBytes != nil { + in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes + *out = new(int) + **out = **in + } + if in.SkipEmptyArchives != nil { + in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_STATUS_ARM. +func (in *CaptureDescription_STATUS_ARM) DeepCopy() *CaptureDescription_STATUS_ARM { + if in == nil { + return nil + } + out := new(CaptureDescription_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureIdentity) DeepCopyInto(out *CaptureIdentity) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(CaptureIdentity_Type) + **out = **in + } + if in.UserAssignedIdentityReference != nil { + in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureIdentity. +func (in *CaptureIdentity) DeepCopy() *CaptureIdentity { + if in == nil { + return nil + } + out := new(CaptureIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureIdentity_ARM) DeepCopyInto(out *CaptureIdentity_ARM) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(CaptureIdentity_Type) + **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 CaptureIdentity_ARM. +func (in *CaptureIdentity_ARM) DeepCopy() *CaptureIdentity_ARM { + if in == nil { + return nil + } + out := new(CaptureIdentity_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaptureIdentity_STATUS) DeepCopyInto(out *CaptureIdentity_STATUS) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(CaptureIdentity_Type_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 CaptureIdentity_STATUS. +func (in *CaptureIdentity_STATUS) DeepCopy() *CaptureIdentity_STATUS { + if in == nil { + return nil + } + out := new(CaptureIdentity_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 *CaptureIdentity_STATUS_ARM) DeepCopyInto(out *CaptureIdentity_STATUS_ARM) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(CaptureIdentity_Type_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 CaptureIdentity_STATUS_ARM. +func (in *CaptureIdentity_STATUS_ARM) DeepCopy() *CaptureIdentity_STATUS_ARM { + if in == nil { + return nil + } + out := new(CaptureIdentity_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Destination) DeepCopyInto(out *Destination) { + *out = *in + if in.ArchiveNameFormat != nil { + in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat + *out = new(string) + **out = **in + } + if in.BlobContainer != nil { + in, out := &in.BlobContainer, &out.BlobContainer + *out = new(string) + **out = **in + } + if in.DataLakeAccountName != nil { + in, out := &in.DataLakeAccountName, &out.DataLakeAccountName + *out = new(string) + **out = **in + } + if in.DataLakeFolderPath != nil { + in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath + *out = new(string) + **out = **in + } + if in.DataLakeSubscriptionId != nil { + in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(CaptureIdentity) + (*in).DeepCopyInto(*out) + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StorageAccountResourceReference != nil { + in, out := &in.StorageAccountResourceReference, &out.StorageAccountResourceReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination. +func (in *Destination) DeepCopy() *Destination { + if in == nil { + return nil + } + out := new(Destination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Destination_ARM) DeepCopyInto(out *Destination_ARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(CaptureIdentity_ARM) + (*in).DeepCopyInto(*out) + } + 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(Destination_Properties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_ARM. +func (in *Destination_ARM) DeepCopy() *Destination_ARM { + if in == nil { + return nil + } + out := new(Destination_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Destination_Properties_ARM) DeepCopyInto(out *Destination_Properties_ARM) { + *out = *in + if in.ArchiveNameFormat != nil { + in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat + *out = new(string) + **out = **in + } + if in.BlobContainer != nil { + in, out := &in.BlobContainer, &out.BlobContainer + *out = new(string) + **out = **in + } + if in.DataLakeAccountName != nil { + in, out := &in.DataLakeAccountName, &out.DataLakeAccountName + *out = new(string) + **out = **in + } + if in.DataLakeFolderPath != nil { + in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath + *out = new(string) + **out = **in + } + if in.DataLakeSubscriptionId != nil { + in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId + *out = new(string) + **out = **in + } + if in.StorageAccountResourceId != nil { + in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_Properties_ARM. +func (in *Destination_Properties_ARM) DeepCopy() *Destination_Properties_ARM { + if in == nil { + return nil + } + out := new(Destination_Properties_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Destination_Properties_STATUS_ARM) DeepCopyInto(out *Destination_Properties_STATUS_ARM) { + *out = *in + if in.ArchiveNameFormat != nil { + in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat + *out = new(string) + **out = **in + } + if in.BlobContainer != nil { + in, out := &in.BlobContainer, &out.BlobContainer + *out = new(string) + **out = **in + } + if in.DataLakeAccountName != nil { + in, out := &in.DataLakeAccountName, &out.DataLakeAccountName + *out = new(string) + **out = **in + } + if in.DataLakeFolderPath != nil { + in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath + *out = new(string) + **out = **in + } + if in.DataLakeSubscriptionId != nil { + in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId + *out = new(string) + **out = **in + } + if in.StorageAccountResourceId != nil { + in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_Properties_STATUS_ARM. +func (in *Destination_Properties_STATUS_ARM) DeepCopy() *Destination_Properties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Destination_Properties_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Destination_STATUS) DeepCopyInto(out *Destination_STATUS) { + *out = *in + if in.ArchiveNameFormat != nil { + in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat + *out = new(string) + **out = **in + } + if in.BlobContainer != nil { + in, out := &in.BlobContainer, &out.BlobContainer + *out = new(string) + **out = **in + } + if in.DataLakeAccountName != nil { + in, out := &in.DataLakeAccountName, &out.DataLakeAccountName + *out = new(string) + **out = **in + } + if in.DataLakeFolderPath != nil { + in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath + *out = new(string) + **out = **in + } + if in.DataLakeSubscriptionId != nil { + in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId + *out = new(string) + **out = **in + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(CaptureIdentity_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.StorageAccountResourceId != nil { + in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_STATUS. +func (in *Destination_STATUS) DeepCopy() *Destination_STATUS { + if in == nil { + return nil + } + out := new(Destination_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 *Destination_STATUS_ARM) DeepCopyInto(out *Destination_STATUS_ARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(CaptureIdentity_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + 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(Destination_Properties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_STATUS_ARM. +func (in *Destination_STATUS_ARM) DeepCopy() *Destination_STATUS_ARM { + if in == nil { + return nil + } + out := new(Destination_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Encryption) DeepCopyInto(out *Encryption) { + *out = *in + if in.KeySource != nil { + in, out := &in.KeySource, &out.KeySource + *out = new(Encryption_KeySource) + **out = **in + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = make([]KeyVaultProperties, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireInfrastructureEncryption != nil { + in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption. +func (in *Encryption) DeepCopy() *Encryption { + if in == nil { + return nil + } + out := new(Encryption) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Encryption_ARM) DeepCopyInto(out *Encryption_ARM) { + *out = *in + if in.KeySource != nil { + in, out := &in.KeySource, &out.KeySource + *out = new(Encryption_KeySource) + **out = **in + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = make([]KeyVaultProperties_ARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireInfrastructureEncryption != nil { + in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_ARM. +func (in *Encryption_ARM) DeepCopy() *Encryption_ARM { + if in == nil { + return nil + } + out := new(Encryption_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Encryption_STATUS) DeepCopyInto(out *Encryption_STATUS) { + *out = *in + if in.KeySource != nil { + in, out := &in.KeySource, &out.KeySource + *out = new(Encryption_KeySource_STATUS) + **out = **in + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = make([]KeyVaultProperties_STATUS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireInfrastructureEncryption != nil { + in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_STATUS. +func (in *Encryption_STATUS) DeepCopy() *Encryption_STATUS { + if in == nil { + return nil + } + out := new(Encryption_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 *Encryption_STATUS_ARM) DeepCopyInto(out *Encryption_STATUS_ARM) { + *out = *in + if in.KeySource != nil { + in, out := &in.KeySource, &out.KeySource + *out = new(Encryption_KeySource_STATUS) + **out = **in + } + if in.KeyVaultProperties != nil { + in, out := &in.KeyVaultProperties, &out.KeyVaultProperties + *out = make([]KeyVaultProperties_STATUS_ARM, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireInfrastructureEncryption != nil { + in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_STATUS_ARM. +func (in *Encryption_STATUS_ARM) DeepCopy() *Encryption_STATUS_ARM { + if in == nil { + return nil + } + out := new(Encryption_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity) DeepCopyInto(out *Identity) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make([]UserAssignedIdentityDetails, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. +func (in *Identity) DeepCopy() *Identity { + if in == nil { + return nil + } + out := new(Identity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity_ARM) DeepCopyInto(out *Identity_ARM) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]UserAssignedIdentityDetails_ARM, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity_ARM. +func (in *Identity_ARM) DeepCopy() *Identity_ARM { + if in == nil { + return nil + } + out := new(Identity_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity_STATUS) DeepCopyInto(out *Identity_STATUS) { + *out = *in + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type_STATUS) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]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_STATUS_ARM) DeepCopyInto(out *Identity_STATUS_ARM) { + *out = *in + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type_STATUS) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]UserAssignedIdentity_STATUS_ARM, 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_ARM. +func (in *Identity_STATUS_ARM) DeepCopy() *Identity_STATUS_ARM { + if in == nil { + return nil + } + out := new(Identity_STATUS_ARM) + 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.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(UserAssignedIdentityProperties) + (*in).DeepCopyInto(*out) + } + if in.KeyName != nil { + in, out := &in.KeyName, &out.KeyName + *out = new(string) + **out = **in + } + if in.KeyVaultUri != nil { + in, out := &in.KeyVaultUri, &out.KeyVaultUri + *out = new(string) + **out = **in + } + if in.KeyVersion != nil { + in, out := &in.KeyVersion, &out.KeyVersion + *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 *KeyVaultProperties_ARM) DeepCopyInto(out *KeyVaultProperties_ARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(UserAssignedIdentityProperties_ARM) + (*in).DeepCopyInto(*out) + } + if in.KeyName != nil { + in, out := &in.KeyName, &out.KeyName + *out = new(string) + **out = **in + } + if in.KeyVaultUri != nil { + in, out := &in.KeyVaultUri, &out.KeyVaultUri + *out = new(string) + **out = **in + } + if in.KeyVersion != nil { + in, out := &in.KeyVersion, &out.KeyVersion + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultProperties_ARM. +func (in *KeyVaultProperties_ARM) DeepCopy() *KeyVaultProperties_ARM { + if in == nil { + return nil + } + out := new(KeyVaultProperties_ARM) + 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.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(UserAssignedIdentityProperties_STATUS) + (*in).DeepCopyInto(*out) + } + if in.KeyName != nil { + in, out := &in.KeyName, &out.KeyName + *out = new(string) + **out = **in + } + if in.KeyVaultUri != nil { + in, out := &in.KeyVaultUri, &out.KeyVaultUri + *out = new(string) + **out = **in + } + if in.KeyVersion != nil { + in, out := &in.KeyVersion, &out.KeyVersion + *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_STATUS_ARM) DeepCopyInto(out *KeyVaultProperties_STATUS_ARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(UserAssignedIdentityProperties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.KeyName != nil { + in, out := &in.KeyName, &out.KeyName + *out = new(string) + **out = **in + } + if in.KeyVaultUri != nil { + in, out := &in.KeyVaultUri, &out.KeyVaultUri + *out = new(string) + **out = **in + } + if in.KeyVersion != nil { + in, out := &in.KeyVersion, &out.KeyVersion + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultProperties_STATUS_ARM. +func (in *KeyVaultProperties_STATUS_ARM) DeepCopy() *KeyVaultProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(KeyVaultProperties_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespace) DeepCopyInto(out *Namespace) { + *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 Namespace. +func (in *Namespace) DeepCopy() *Namespace { + if in == nil { + return nil + } + out := new(Namespace) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Namespace) 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 *NamespaceList) DeepCopyInto(out *NamespaceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Namespace, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceList. +func (in *NamespaceList) DeepCopy() *NamespaceList { + if in == nil { + return nil + } + out := new(NamespaceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespaceList) 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 *NamespaceOperatorSecrets) DeepCopyInto(out *NamespaceOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSecrets. +func (in *NamespaceOperatorSecrets) DeepCopy() *NamespaceOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespaceOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceOperatorSpec) DeepCopyInto(out *NamespaceOperatorSpec) { + *out = *in + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(NamespaceOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSpec. +func (in *NamespaceOperatorSpec) DeepCopy() *NamespaceOperatorSpec { + if in == nil { + return nil + } + out := new(NamespaceOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespace_Properties_STATUS_ARM) DeepCopyInto(out *Namespace_Properties_STATUS_ARM) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *out = new(string) + **out = **in + } + if in.ClusterArmId != nil { + in, out := &in.ClusterArmId, &out.ClusterArmId + *out = new(string) + **out = **in + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(Encryption_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.IsAutoInflateEnabled != nil { + in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled + *out = new(bool) + **out = **in + } + if in.KafkaEnabled != nil { + in, out := &in.KafkaEnabled, &out.KafkaEnabled + *out = new(bool) + **out = **in + } + if in.MaximumThroughputUnits != nil { + in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits + *out = new(int) + **out = **in + } + if in.MetricId != nil { + in, out := &in.MetricId, &out.MetricId + *out = new(string) + **out = **in + } + if in.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(Namespace_Properties_MinimumTlsVersion_STATUS) + **out = **in + } + if in.PrivateEndpointConnections != nil { + in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections + *out = make([]PrivateEndpointConnection_STATUS_ARM, 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.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(Namespace_Properties_PublicNetworkAccess_STATUS) + **out = **in + } + if in.ServiceBusEndpoint != nil { + in, out := &in.ServiceBusEndpoint, &out.ServiceBusEndpoint + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.ZoneRedundant != nil { + in, out := &in.ZoneRedundant, &out.ZoneRedundant + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Properties_STATUS_ARM. +func (in *Namespace_Properties_STATUS_ARM) DeepCopy() *Namespace_Properties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespace_Properties_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespace_Properties_Spec_ARM) DeepCopyInto(out *Namespace_Properties_Spec_ARM) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *out = new(string) + **out = **in + } + if in.ClusterArmId != nil { + in, out := &in.ClusterArmId, &out.ClusterArmId + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(Encryption_ARM) + (*in).DeepCopyInto(*out) + } + if in.IsAutoInflateEnabled != nil { + in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled + *out = new(bool) + **out = **in + } + if in.KafkaEnabled != nil { + in, out := &in.KafkaEnabled, &out.KafkaEnabled + *out = new(bool) + **out = **in + } + if in.MaximumThroughputUnits != nil { + in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits + *out = new(int) + **out = **in + } + if in.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(Namespace_Properties_MinimumTlsVersion_Spec) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(Namespace_Properties_PublicNetworkAccess_Spec) + **out = **in + } + if in.ZoneRedundant != nil { + in, out := &in.ZoneRedundant, &out.ZoneRedundant + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Properties_Spec_ARM. +func (in *Namespace_Properties_Spec_ARM) DeepCopy() *Namespace_Properties_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespace_Properties_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespace_STATUS) DeepCopyInto(out *Namespace_STATUS) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *out = new(string) + **out = **in + } + if in.ClusterArmId != nil { + in, out := &in.ClusterArmId, &out.ClusterArmId + *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.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(Encryption_STATUS) + (*in).DeepCopyInto(*out) + } + 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.IsAutoInflateEnabled != nil { + in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled + *out = new(bool) + **out = **in + } + if in.KafkaEnabled != nil { + in, out := &in.KafkaEnabled, &out.KafkaEnabled + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MaximumThroughputUnits != nil { + in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits + *out = new(int) + **out = **in + } + if in.MetricId != nil { + in, out := &in.MetricId, &out.MetricId + *out = new(string) + **out = **in + } + if in.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(Namespace_Properties_MinimumTlsVersion_STATUS) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PrivateEndpointConnections != nil { + in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections + *out = make([]PrivateEndpointConnection_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.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(Namespace_Properties_PublicNetworkAccess_STATUS) + **out = **in + } + if in.ServiceBusEndpoint != nil { + in, out := &in.ServiceBusEndpoint, &out.ServiceBusEndpoint + *out = new(string) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **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.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.ZoneRedundant != nil { + in, out := &in.ZoneRedundant, &out.ZoneRedundant + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_STATUS. +func (in *Namespace_STATUS) DeepCopy() *Namespace_STATUS { + if in == nil { + return nil + } + out := new(Namespace_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 *Namespace_STATUS_ARM) DeepCopyInto(out *Namespace_STATUS_ARM) { + *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_ARM) + (*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(Namespace_Properties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS_ARM) + (*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 Namespace_STATUS_ARM. +func (in *Namespace_STATUS_ARM) DeepCopy() *Namespace_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespace_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespace_Spec) DeepCopyInto(out *Namespace_Spec) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *out = new(string) + **out = **in + } + if in.ClusterArmReference != nil { + in, out := &in.ClusterArmReference, &out.ClusterArmReference + *out = new(genruntime.ResourceReference) + **out = **in + } + if in.DisableLocalAuth != nil { + in, out := &in.DisableLocalAuth, &out.DisableLocalAuth + *out = new(bool) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(Encryption) + (*in).DeepCopyInto(*out) + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + (*in).DeepCopyInto(*out) + } + if in.IsAutoInflateEnabled != nil { + in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled + *out = new(bool) + **out = **in + } + if in.KafkaEnabled != nil { + in, out := &in.KafkaEnabled, &out.KafkaEnabled + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MaximumThroughputUnits != nil { + in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits + *out = new(int) + **out = **in + } + if in.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(Namespace_Properties_MinimumTlsVersion_Spec) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespaceOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(Namespace_Properties_PublicNetworkAccess_Spec) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku) + (*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.ZoneRedundant != nil { + in, out := &in.ZoneRedundant, &out.ZoneRedundant + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Spec. +func (in *Namespace_Spec) DeepCopy() *Namespace_Spec { + if in == nil { + return nil + } + out := new(Namespace_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 *Namespace_Spec_ARM) DeepCopyInto(out *Namespace_Spec_ARM) { + *out = *in + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity_ARM) + (*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(Namespace_Properties_Spec_ARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(Sku_ARM) + (*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 Namespace_Spec_ARM. +func (in *Namespace_Spec_ARM) DeepCopy() *Namespace_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespace_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesAuthorizationRule) DeepCopyInto(out *NamespacesAuthorizationRule) { + *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 NamespacesAuthorizationRule. +func (in *NamespacesAuthorizationRule) DeepCopy() *NamespacesAuthorizationRule { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesAuthorizationRule) 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 *NamespacesAuthorizationRuleList) DeepCopyInto(out *NamespacesAuthorizationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesAuthorizationRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleList. +func (in *NamespacesAuthorizationRuleList) DeepCopy() *NamespacesAuthorizationRuleList { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesAuthorizationRuleList) 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 *NamespacesAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSecrets. +func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSpec) { + *out = *in + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(NamespacesAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSpec. +func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhub) DeepCopyInto(out *NamespacesEventhub) { + *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 NamespacesEventhub. +func (in *NamespacesEventhub) DeepCopy() *NamespacesEventhub { + if in == nil { + return nil + } + out := new(NamespacesEventhub) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhub) 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 *NamespacesEventhubList) DeepCopyInto(out *NamespacesEventhubList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesEventhub, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubList. +func (in *NamespacesEventhubList) DeepCopy() *NamespacesEventhubList { + if in == nil { + return nil + } + out := new(NamespacesEventhubList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubList) 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 *NamespacesEventhubsAuthorizationRule) DeepCopyInto(out *NamespacesEventhubsAuthorizationRule) { + *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 NamespacesEventhubsAuthorizationRule. +func (in *NamespacesEventhubsAuthorizationRule) DeepCopy() *NamespacesEventhubsAuthorizationRule { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsAuthorizationRule) 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 *NamespacesEventhubsAuthorizationRuleList) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesEventhubsAuthorizationRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleList. +func (in *NamespacesEventhubsAuthorizationRuleList) DeepCopy() *NamespacesEventhubsAuthorizationRuleList { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsAuthorizationRuleList) 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 *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSecrets) { + *out = *in + if in.PrimaryConnectionString != nil { + in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.PrimaryKey != nil { + in, out := &in.PrimaryKey, &out.PrimaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryConnectionString != nil { + in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString + *out = new(genruntime.SecretDestination) + **out = **in + } + if in.SecondaryKey != nil { + in, out := &in.SecondaryKey, &out.SecondaryKey + *out = new(genruntime.SecretDestination) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSecrets. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSecrets { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSpec) { + *out = *in + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSpec. +func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesEventhubsConsumerGroup) DeepCopyInto(out *NamespacesEventhubsConsumerGroup) { + *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 NamespacesEventhubsConsumerGroup. +func (in *NamespacesEventhubsConsumerGroup) DeepCopy() *NamespacesEventhubsConsumerGroup { + if in == nil { + return nil + } + out := new(NamespacesEventhubsConsumerGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsConsumerGroup) 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 *NamespacesEventhubsConsumerGroupList) DeepCopyInto(out *NamespacesEventhubsConsumerGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesEventhubsConsumerGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsConsumerGroupList. +func (in *NamespacesEventhubsConsumerGroupList) DeepCopy() *NamespacesEventhubsConsumerGroupList { + if in == nil { + return nil + } + out := new(NamespacesEventhubsConsumerGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesEventhubsConsumerGroupList) 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 *Namespaces_AuthorizationRule_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_Properties_STATUS_ARM) { + *out = *in + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_AuthorizationRule_Properties_Rights_STATUS, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Properties_STATUS_ARM. +func (in *Namespaces_AuthorizationRule_Properties_STATUS_ARM) DeepCopy() *Namespaces_AuthorizationRule_Properties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_Properties_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_AuthorizationRule_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_Properties_Spec_ARM) { + *out = *in + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Properties_Spec_ARM. +func (in *Namespaces_AuthorizationRule_Properties_Spec_ARM) DeepCopy() *Namespaces_AuthorizationRule_Properties_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_Properties_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_AuthorizationRule_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.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.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_AuthorizationRule_Properties_Rights_STATUS, len(*in)) + copy(*out, *in) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*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 Namespaces_AuthorizationRule_STATUS. +func (in *Namespaces_AuthorizationRule_STATUS) DeepCopy() *Namespaces_AuthorizationRule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_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 *Namespaces_AuthorizationRule_STATUS_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_STATUS_ARM) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + 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(Namespaces_AuthorizationRule_Properties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS_ARM) + (*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 Namespaces_AuthorizationRule_STATUS_ARM. +func (in *Namespaces_AuthorizationRule_STATUS_ARM) DeepCopy() *Namespaces_AuthorizationRule_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec) { + *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Spec. +func (in *Namespaces_AuthorizationRule_Spec) DeepCopy() *Namespaces_AuthorizationRule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_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 *Namespaces_AuthorizationRule_Spec_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Namespaces_AuthorizationRule_Properties_Spec_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Spec_ARM. +func (in *Namespaces_AuthorizationRule_Spec_ARM) DeepCopy() *Namespaces_AuthorizationRule_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_AuthorizationRule_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhub_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhub_Properties_STATUS_ARM) { + *out = *in + if in.CaptureDescription != nil { + in, out := &in.CaptureDescription, &out.CaptureDescription + *out = new(CaptureDescription_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.MessageRetentionInDays != nil { + in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays + *out = new(int) + **out = **in + } + if in.PartitionCount != nil { + in, out := &in.PartitionCount, &out.PartitionCount + *out = new(int) + **out = **in + } + if in.PartitionIds != nil { + in, out := &in.PartitionIds, &out.PartitionIds + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RetentionDescription != nil { + in, out := &in.RetentionDescription, &out.RetentionDescription + *out = new(RetentionDescription_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(Namespaces_Eventhub_Properties_Status_STATUS) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Properties_STATUS_ARM. +func (in *Namespaces_Eventhub_Properties_STATUS_ARM) DeepCopy() *Namespaces_Eventhub_Properties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_Properties_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhub_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhub_Properties_Spec_ARM) { + *out = *in + if in.CaptureDescription != nil { + in, out := &in.CaptureDescription, &out.CaptureDescription + *out = new(CaptureDescription_ARM) + (*in).DeepCopyInto(*out) + } + if in.MessageRetentionInDays != nil { + in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays + *out = new(int) + **out = **in + } + if in.PartitionCount != nil { + in, out := &in.PartitionCount, &out.PartitionCount + *out = new(int) + **out = **in + } + if in.RetentionDescription != nil { + in, out := &in.RetentionDescription, &out.RetentionDescription + *out = new(RetentionDescription_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Properties_Spec_ARM. +func (in *Namespaces_Eventhub_Properties_Spec_ARM) DeepCopy() *Namespaces_Eventhub_Properties_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_Properties_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhub_STATUS) DeepCopyInto(out *Namespaces_Eventhub_STATUS) { + *out = *in + if in.CaptureDescription != nil { + in, out := &in.CaptureDescription, &out.CaptureDescription + *out = new(CaptureDescription_STATUS) + (*in).DeepCopyInto(*out) + } + 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.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MessageRetentionInDays != nil { + in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PartitionCount != nil { + in, out := &in.PartitionCount, &out.PartitionCount + *out = new(int) + **out = **in + } + if in.PartitionIds != nil { + in, out := &in.PartitionIds, &out.PartitionIds + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RetentionDescription != nil { + in, out := &in.RetentionDescription, &out.RetentionDescription + *out = new(RetentionDescription_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(Namespaces_Eventhub_Properties_Status_STATUS) + **out = **in + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_STATUS. +func (in *Namespaces_Eventhub_STATUS) DeepCopy() *Namespaces_Eventhub_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_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 *Namespaces_Eventhub_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhub_STATUS_ARM) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + 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(Namespaces_Eventhub_Properties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS_ARM) + (*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 Namespaces_Eventhub_STATUS_ARM. +func (in *Namespaces_Eventhub_STATUS_ARM) DeepCopy() *Namespaces_Eventhub_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhub_Spec) DeepCopyInto(out *Namespaces_Eventhub_Spec) { + *out = *in + if in.CaptureDescription != nil { + in, out := &in.CaptureDescription, &out.CaptureDescription + *out = new(CaptureDescription) + (*in).DeepCopyInto(*out) + } + if in.MessageRetentionInDays != nil { + in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PartitionCount != nil { + in, out := &in.PartitionCount, &out.PartitionCount + *out = new(int) + **out = **in + } + if in.RetentionDescription != nil { + in, out := &in.RetentionDescription, &out.RetentionDescription + *out = new(RetentionDescription) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Spec. +func (in *Namespaces_Eventhub_Spec) DeepCopy() *Namespaces_Eventhub_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_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 *Namespaces_Eventhub_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhub_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Namespaces_Eventhub_Properties_Spec_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Spec_ARM. +func (in *Namespaces_Eventhub_Spec_ARM) DeepCopy() *Namespaces_Eventhub_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhub_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) { + *out = *in + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM. +func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) { + *out = *in + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM. +func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_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.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.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS, len(*in)) + copy(*out, *in) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*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 Namespaces_Eventhubs_AuthorizationRule_STATUS. +func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + 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(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS_ARM) + (*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 Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM. +func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec) { + *out = *in + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesEventhubsAuthorizationRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.Rights != nil { + in, out := &in.Rights, &out.Rights + *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Spec. +func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Spec_ARM. +func (in *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.UserMetadata != nil { + in, out := &in.UserMetadata, &out.UserMetadata + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM. +func (in *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) { + *out = *in + if in.UserMetadata != nil { + in, out := &in.UserMetadata, &out.UserMetadata + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM. +func (in *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_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.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + 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.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS) + (*in).DeepCopyInto(*out) + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.UserMetadata != nil { + in, out := &in.UserMetadata, &out.UserMetadata + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_STATUS. +func (in *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopy() *Namespaces_Eventhubs_Consumergroup_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_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 *Namespaces_Eventhubs_Consumergroup_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_STATUS_ARM) { + *out = *in + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + 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(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.SystemData != nil { + in, out := &in.SystemData, &out.SystemData + *out = new(SystemData_STATUS_ARM) + (*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 Namespaces_Eventhubs_Consumergroup_STATUS_ARM. +func (in *Namespaces_Eventhubs_Consumergroup_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Spec) { + *out = *in + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.UserMetadata != nil { + in, out := &in.UserMetadata, &out.UserMetadata + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Spec. +func (in *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_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 *Namespaces_Eventhubs_Consumergroup_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Spec_ARM. +func (in *Namespaces_Eventhubs_Consumergroup_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Eventhubs_Consumergroup_Spec_ARM) + 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) DeepCopyInto(out *PrivateEndpointConnection_STATUS) { + *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 PrivateEndpointConnection_STATUS. +func (in *PrivateEndpointConnection_STATUS) DeepCopy() *PrivateEndpointConnection_STATUS { + if in == nil { + return nil + } + out := new(PrivateEndpointConnection_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 *PrivateEndpointConnection_STATUS_ARM) DeepCopyInto(out *PrivateEndpointConnection_STATUS_ARM) { + *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 PrivateEndpointConnection_STATUS_ARM. +func (in *PrivateEndpointConnection_STATUS_ARM) DeepCopy() *PrivateEndpointConnection_STATUS_ARM { + if in == nil { + return nil + } + out := new(PrivateEndpointConnection_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RetentionDescription) DeepCopyInto(out *RetentionDescription) { + *out = *in + if in.CleanupPolicy != nil { + in, out := &in.CleanupPolicy, &out.CleanupPolicy + *out = new(RetentionDescription_CleanupPolicy) + **out = **in + } + if in.RetentionTimeInHours != nil { + in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours + *out = new(int) + **out = **in + } + if in.TombstoneRetentionTimeInHours != nil { + in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription. +func (in *RetentionDescription) DeepCopy() *RetentionDescription { + if in == nil { + return nil + } + out := new(RetentionDescription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RetentionDescription_ARM) DeepCopyInto(out *RetentionDescription_ARM) { + *out = *in + if in.CleanupPolicy != nil { + in, out := &in.CleanupPolicy, &out.CleanupPolicy + *out = new(RetentionDescription_CleanupPolicy) + **out = **in + } + if in.RetentionTimeInHours != nil { + in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours + *out = new(int) + **out = **in + } + if in.TombstoneRetentionTimeInHours != nil { + in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_ARM. +func (in *RetentionDescription_ARM) DeepCopy() *RetentionDescription_ARM { + if in == nil { + return nil + } + out := new(RetentionDescription_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RetentionDescription_STATUS) DeepCopyInto(out *RetentionDescription_STATUS) { + *out = *in + if in.CleanupPolicy != nil { + in, out := &in.CleanupPolicy, &out.CleanupPolicy + *out = new(RetentionDescription_CleanupPolicy_STATUS) + **out = **in + } + if in.RetentionTimeInHours != nil { + in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours + *out = new(int) + **out = **in + } + if in.TombstoneRetentionTimeInHours != nil { + in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_STATUS. +func (in *RetentionDescription_STATUS) DeepCopy() *RetentionDescription_STATUS { + if in == nil { + return nil + } + out := new(RetentionDescription_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 *RetentionDescription_STATUS_ARM) DeepCopyInto(out *RetentionDescription_STATUS_ARM) { + *out = *in + if in.CleanupPolicy != nil { + in, out := &in.CleanupPolicy, &out.CleanupPolicy + *out = new(RetentionDescription_CleanupPolicy_STATUS) + **out = **in + } + if in.RetentionTimeInHours != nil { + in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours + *out = new(int) + **out = **in + } + if in.TombstoneRetentionTimeInHours != nil { + in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_STATUS_ARM. +func (in *RetentionDescription_STATUS_ARM) DeepCopy() *RetentionDescription_STATUS_ARM { + if in == nil { + return nil + } + out := new(RetentionDescription_STATUS_ARM) + 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.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(Sku_Name) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(Sku_Tier) + **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_ARM) DeepCopyInto(out *Sku_ARM) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(Sku_Name) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(Sku_Tier) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku_ARM. +func (in *Sku_ARM) DeepCopy() *Sku_ARM { + if in == nil { + return nil + } + out := new(Sku_ARM) + 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.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(Sku_Name_STATUS) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(Sku_Tier_STATUS) + **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_STATUS_ARM) DeepCopyInto(out *Sku_STATUS_ARM) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(Sku_Name_STATUS) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(Sku_Tier_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku_STATUS_ARM. +func (in *Sku_STATUS_ARM) DeepCopy() *Sku_STATUS_ARM { + if in == nil { + return nil + } + out := new(Sku_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.CreatedBy != nil { + in, out := &in.CreatedBy, &out.CreatedBy + *out = new(string) + **out = **in + } + if in.CreatedByType != nil { + in, out := &in.CreatedByType, &out.CreatedByType + *out = new(SystemData_CreatedByType_STATUS) + **out = **in + } + if in.LastModifiedAt != nil { + in, out := &in.LastModifiedAt, &out.LastModifiedAt + *out = new(string) + **out = **in + } + if in.LastModifiedBy != nil { + in, out := &in.LastModifiedBy, &out.LastModifiedBy + *out = new(string) + **out = **in + } + if in.LastModifiedByType != nil { + in, out := &in.LastModifiedByType, &out.LastModifiedByType + *out = new(SystemData_LastModifiedByType_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS. +func (in *SystemData_STATUS) DeepCopy() *SystemData_STATUS { + if in == nil { + return nil + } + out := new(SystemData_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemData_STATUS_ARM) DeepCopyInto(out *SystemData_STATUS_ARM) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.CreatedBy != nil { + in, out := &in.CreatedBy, &out.CreatedBy + *out = new(string) + **out = **in + } + if in.CreatedByType != nil { + in, out := &in.CreatedByType, &out.CreatedByType + *out = new(SystemData_CreatedByType_STATUS) + **out = **in + } + if in.LastModifiedAt != nil { + in, out := &in.LastModifiedAt, &out.LastModifiedAt + *out = new(string) + **out = **in + } + if in.LastModifiedBy != nil { + in, out := &in.LastModifiedBy, &out.LastModifiedBy + *out = new(string) + **out = **in + } + if in.LastModifiedByType != nil { + in, out := &in.LastModifiedByType, &out.LastModifiedByType + *out = new(SystemData_LastModifiedByType_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS_ARM. +func (in *SystemData_STATUS_ARM) DeepCopy() *SystemData_STATUS_ARM { + if in == nil { + return nil + } + out := new(SystemData_STATUS_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityDetails) DeepCopyInto(out *UserAssignedIdentityDetails) { + *out = *in + out.Reference = in.Reference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails. +func (in *UserAssignedIdentityDetails) DeepCopy() *UserAssignedIdentityDetails { + if in == nil { + return nil + } + out := new(UserAssignedIdentityDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityDetails_ARM) DeepCopyInto(out *UserAssignedIdentityDetails_ARM) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails_ARM. +func (in *UserAssignedIdentityDetails_ARM) DeepCopy() *UserAssignedIdentityDetails_ARM { + if in == nil { + return nil + } + out := new(UserAssignedIdentityDetails_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityProperties) DeepCopyInto(out *UserAssignedIdentityProperties) { + *out = *in + if in.UserAssignedIdentityReference != nil { + in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference + *out = new(genruntime.ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityProperties. +func (in *UserAssignedIdentityProperties) DeepCopy() *UserAssignedIdentityProperties { + if in == nil { + return nil + } + out := new(UserAssignedIdentityProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityProperties_ARM) DeepCopyInto(out *UserAssignedIdentityProperties_ARM) { + *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 UserAssignedIdentityProperties_ARM. +func (in *UserAssignedIdentityProperties_ARM) DeepCopy() *UserAssignedIdentityProperties_ARM { + if in == nil { + return nil + } + out := new(UserAssignedIdentityProperties_ARM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityProperties_STATUS) DeepCopyInto(out *UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS. +func (in *UserAssignedIdentityProperties_STATUS) DeepCopy() *UserAssignedIdentityProperties_STATUS { + if in == nil { + return nil + } + out := new(UserAssignedIdentityProperties_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 *UserAssignedIdentityProperties_STATUS_ARM) DeepCopyInto(out *UserAssignedIdentityProperties_STATUS_ARM) { + *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 UserAssignedIdentityProperties_STATUS_ARM. +func (in *UserAssignedIdentityProperties_STATUS_ARM) DeepCopy() *UserAssignedIdentityProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(UserAssignedIdentityProperties_STATUS_ARM) + 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 + } +} + +// 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_STATUS_ARM) DeepCopyInto(out *UserAssignedIdentity_STATUS_ARM) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentity_STATUS_ARM. +func (in *UserAssignedIdentity_STATUS_ARM) DeepCopy() *UserAssignedIdentity_STATUS_ARM { + if in == nil { + return nil + } + out := new(UserAssignedIdentity_STATUS_ARM) + in.DeepCopyInto(out) + return out +} diff --git a/v2/api/eventhub/versions_matrix.md b/v2/api/eventhub/versions_matrix.md index f5b3d5c9008..8ad1607ca10 100644 --- a/v2/api/eventhub/versions_matrix.md +++ b/v2/api/eventhub/versions_matrix.md @@ -1,65 +1,77 @@ -| Type Definitions in package "eventhub" | v1api20211101 | -|-----------------------------------------------------------------|---------------| -| APIVersion | v1api20211101 | -| CaptureDescription | v1api20211101 | -| CaptureDescription_Encoding | v1api20211101 | -| CaptureDescription_Encoding_STATUS | v1api20211101 | -| CaptureDescription_STATUS | v1api20211101 | -| Destination | v1api20211101 | -| Destination_Properties | v1api20211101 | -| Destination_Properties_STATUS | v1api20211101 | -| Destination_STATUS | v1api20211101 | -| Encryption | v1api20211101 | -| Encryption_KeySource | v1api20211101 | -| Encryption_KeySource_STATUS | v1api20211101 | -| Encryption_STATUS | v1api20211101 | -| Identity | v1api20211101 | -| Identity_STATUS | v1api20211101 | -| Identity_Type | v1api20211101 | -| Identity_Type_STATUS | v1api20211101 | -| KeyVaultProperties | v1api20211101 | -| KeyVaultProperties_STATUS | v1api20211101 | -| Namespace | v1api20211101 | -| Namespace_Properties_STATUS | v1api20211101 | -| Namespace_Properties_Spec | v1api20211101 | -| Namespace_STATUS | v1api20211101 | -| Namespace_Spec | v1api20211101 | -| NamespacesAuthorizationRule | v1api20211101 | -| NamespacesEventhub | v1api20211101 | -| NamespacesEventhubsAuthorizationRule | v1api20211101 | -| NamespacesEventhubsConsumerGroup | v1api20211101 | -| Namespaces_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | -| Namespaces_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | -| Namespaces_AuthorizationRule_Properties_STATUS | v1api20211101 | -| Namespaces_AuthorizationRule_Properties_Spec | v1api20211101 | -| Namespaces_AuthorizationRule_STATUS | v1api20211101 | -| Namespaces_AuthorizationRule_Spec | v1api20211101 | -| Namespaces_Eventhub_Properties_STATUS | v1api20211101 | -| Namespaces_Eventhub_Properties_Spec | v1api20211101 | -| Namespaces_Eventhub_Properties_Status_STATUS | v1api20211101 | -| Namespaces_Eventhub_STATUS | v1api20211101 | -| Namespaces_Eventhub_Spec | v1api20211101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS | v1api20211101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_Spec | v1api20211101 | -| Namespaces_Eventhubs_AuthorizationRule_STATUS | v1api20211101 | -| Namespaces_Eventhubs_AuthorizationRule_Spec | v1api20211101 | -| Namespaces_Eventhubs_Consumergroup_Properties_STATUS | v1api20211101 | -| Namespaces_Eventhubs_Consumergroup_Properties_Spec | v1api20211101 | -| Namespaces_Eventhubs_Consumergroup_STATUS | v1api20211101 | -| Namespaces_Eventhubs_Consumergroup_Spec | v1api20211101 | -| PrivateEndpointConnection_STATUS | v1api20211101 | -| Sku | v1api20211101 | -| Sku_Name | v1api20211101 | -| Sku_Name_STATUS | v1api20211101 | -| Sku_STATUS | v1api20211101 | -| Sku_Tier | v1api20211101 | -| Sku_Tier_STATUS | v1api20211101 | -| SystemData_CreatedByType_STATUS | v1api20211101 | -| SystemData_LastModifiedByType_STATUS | v1api20211101 | -| SystemData_STATUS | v1api20211101 | -| UserAssignedIdentityDetails | v1api20211101 | -| UserAssignedIdentityProperties | v1api20211101 | -| UserAssignedIdentityProperties_STATUS | v1api20211101 | -| UserAssignedIdentity_STATUS | v1api20211101 | +| Type Definitions in package "eventhub" | v1api20211101 | v1api20240101 | +|-----------------------------------------------------------------|---------------|---------------| +| APIVersion | v1api20211101 | v1api20240101 | +| CaptureDescription | v1api20211101 | v1api20240101 | +| CaptureDescription_Encoding | v1api20211101 | v1api20240101 | +| CaptureDescription_Encoding_STATUS | v1api20211101 | v1api20240101 | +| CaptureDescription_STATUS | v1api20211101 | v1api20240101 | +| CaptureIdentity | | v1api20240101 | +| CaptureIdentity_STATUS | | v1api20240101 | +| CaptureIdentity_Type | | v1api20240101 | +| CaptureIdentity_Type_STATUS | | v1api20240101 | +| Destination | v1api20211101 | v1api20240101 | +| Destination_Properties | v1api20211101 | v1api20240101 | +| Destination_Properties_STATUS | v1api20211101 | v1api20240101 | +| Destination_STATUS | v1api20211101 | v1api20240101 | +| Encryption | v1api20211101 | v1api20240101 | +| Encryption_KeySource | v1api20211101 | v1api20240101 | +| Encryption_KeySource_STATUS | v1api20211101 | v1api20240101 | +| Encryption_STATUS | v1api20211101 | v1api20240101 | +| Identity | v1api20211101 | v1api20240101 | +| Identity_STATUS | v1api20211101 | v1api20240101 | +| Identity_Type | v1api20211101 | v1api20240101 | +| Identity_Type_STATUS | v1api20211101 | v1api20240101 | +| KeyVaultProperties | v1api20211101 | v1api20240101 | +| KeyVaultProperties_STATUS | v1api20211101 | v1api20240101 | +| Namespace | v1api20211101 | v1api20240101 | +| Namespace_Properties_MinimumTlsVersion_STATUS | | v1api20240101 | +| Namespace_Properties_MinimumTlsVersion_Spec | | v1api20240101 | +| Namespace_Properties_PublicNetworkAccess_STATUS | | v1api20240101 | +| Namespace_Properties_PublicNetworkAccess_Spec | | v1api20240101 | +| Namespace_Properties_STATUS | v1api20211101 | v1api20240101 | +| Namespace_Properties_Spec | v1api20211101 | v1api20240101 | +| Namespace_STATUS | v1api20211101 | v1api20240101 | +| Namespace_Spec | v1api20211101 | v1api20240101 | +| NamespacesAuthorizationRule | v1api20211101 | v1api20240101 | +| NamespacesEventhub | v1api20211101 | v1api20240101 | +| NamespacesEventhubsAuthorizationRule | v1api20211101 | v1api20240101 | +| NamespacesEventhubsConsumerGroup | v1api20211101 | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_Spec | v1api20211101 | v1api20240101 | +| Namespaces_AuthorizationRule_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_AuthorizationRule_Spec | v1api20211101 | v1api20240101 | +| Namespaces_Eventhub_Properties_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhub_Properties_Spec | v1api20211101 | v1api20240101 | +| Namespaces_Eventhub_Properties_Status_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhub_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhub_Spec | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_Spec | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_AuthorizationRule_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_AuthorizationRule_Spec | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_Consumergroup_Properties_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_Consumergroup_Properties_Spec | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_Consumergroup_STATUS | v1api20211101 | v1api20240101 | +| Namespaces_Eventhubs_Consumergroup_Spec | v1api20211101 | v1api20240101 | +| PrivateEndpointConnection_STATUS | v1api20211101 | v1api20240101 | +| RetentionDescription | | v1api20240101 | +| RetentionDescription_CleanupPolicy | | v1api20240101 | +| RetentionDescription_CleanupPolicy_STATUS | | v1api20240101 | +| RetentionDescription_STATUS | | v1api20240101 | +| Sku | v1api20211101 | v1api20240101 | +| Sku_Name | v1api20211101 | v1api20240101 | +| Sku_Name_STATUS | v1api20211101 | v1api20240101 | +| Sku_STATUS | v1api20211101 | v1api20240101 | +| Sku_Tier | v1api20211101 | v1api20240101 | +| Sku_Tier_STATUS | v1api20211101 | v1api20240101 | +| SystemData_CreatedByType_STATUS | v1api20211101 | v1api20240101 | +| SystemData_LastModifiedByType_STATUS | v1api20211101 | v1api20240101 | +| SystemData_STATUS | v1api20211101 | v1api20240101 | +| UserAssignedIdentityDetails | v1api20211101 | v1api20240101 | +| UserAssignedIdentityProperties | v1api20211101 | v1api20240101 | +| UserAssignedIdentityProperties_STATUS | v1api20211101 | v1api20240101 | +| UserAssignedIdentity_STATUS | v1api20211101 | v1api20240101 | diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 645d720381a..389de313114 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -1992,15 +1992,30 @@ objectModelConfiguration: Namespace: $export: true $supportedFrom: v2.0.0-alpha.1 + $azureGeneratedSecrets: + - PrimaryKey + - SecondaryKey + - PrimaryConnectionString + - SecondaryConnectionString Namespaces_AuthorizationRule: $exportAs: NamespacesAuthorizationRule $supportedFrom: v2.0.0-alpha.2 + $azureGeneratedSecrets: + - PrimaryKey + - SecondaryKey + - PrimaryConnectionString + - SecondaryConnectionString Namespaces_Eventhub: $exportAs: NamespacesEventhub $supportedFrom: v2.0.0-alpha.3 Namespaces_Eventhubs_AuthorizationRule: $exportAs: NamespacesEventhubsAuthorizationRule $supportedFrom: v2.0.0-alpha.3 + $azureGeneratedSecrets: + - PrimaryKey + - SecondaryKey + - PrimaryConnectionString + - SecondaryConnectionString Namespaces_Eventhubs_Consumergroup: $exportAs: NamespacesEventhubsConsumerGroup $supportedFrom: v2.0.0-alpha.1 @@ -2014,7 +2029,49 @@ objectModelConfiguration: UserAssignedIdentityProperties: UserAssignedIdentity: $armReference: true - + 2024-01-01: + Destination_Properties: + StorageAccountResourceId: + $armReference: true + Namespace: + $export: true + $supportedFrom: v2.7.0 + $azureGeneratedSecrets: + - PrimaryKey + - SecondaryKey + - PrimaryConnectionString + - SecondaryConnectionString + Namespaces_AuthorizationRule: + $exportAs: NamespacesAuthorizationRule + $supportedFrom: v2.7.0 + $azureGeneratedSecrets: + - PrimaryKey + - SecondaryKey + - PrimaryConnectionString + - SecondaryConnectionString + Namespaces_Eventhub: + $exportAs: NamespacesEventhub + $supportedFrom: v2.7.0 + Namespaces_Eventhubs_AuthorizationRule: + $exportAs: NamespacesEventhubsAuthorizationRule + $supportedFrom: v2.7.0 + $azureGeneratedSecrets: + - PrimaryKey + - SecondaryKey + - PrimaryConnectionString + - SecondaryConnectionString + Namespaces_Eventhubs_Consumergroup: + $exportAs: NamespacesEventhubsConsumerGroup + $supportedFrom: v2.7.0 + Namespace_Properties_Spec: + ClusterArmId: + $armReference: true + UserAssignedIdentityProperties: + UserAssignedIdentity: + $armReference: true + CaptureIdentity: + UserAssignedIdentity: + $armReference: true insights: 2018-05-01-preview: Webtest: diff --git a/v2/go.mod b/v2/go.mod index 14454a06ca4..eab98518408 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -10,6 +10,7 @@ require ( 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/eventgrid/armeventgrid v1.0.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.1.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0 diff --git a/v2/go.sum b/v2/go.sum index 05bb0710a45..59d3e4c224d 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -16,6 +16,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0 h1 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/eventgrid/armeventgrid v1.0.0 h1:w6b0+FygDpqM7g5cjbeyPoBzgxVHwwt2vCUvTz1oFY8= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid v1.0.0/go.mod h1:t8kRpcgm+RdImuJgHG6SfoQ0tpb9LGl7MF1E6u0yeeA= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.1.1 h1:gZ1ZZvrVUhDNsGNpbo2N87Y0CJB8p3IS5UH9Z4Ui97g= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.1.1/go.mod h1:7fQVOnRA11ScLE8dOCWanXHQa2NMFOM2i0u/1VRICXA= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0 h1:NZP+oPbAVFy7PhQ4PTD3SuGWbEziNhp7lphGkkN707s= diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index fbd816c5454..a80c1bf7f6f 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -99,6 +99,8 @@ import ( eventhub_customizations "github.com/Azure/azure-service-operator/v2/api/eventhub/customizations" eventhub_v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" eventhub_v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" + eventhub_v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" + eventhub_v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" insights_customizations "github.com/Azure/azure-service-operator/v2/api/insights/customizations" insights_v20180301 "github.com/Azure/azure-service-operator/v2/api/insights/v1api20180301" insights_v20180301s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20180301/storage" @@ -674,11 +676,11 @@ func getKnownStorageTypes() []*registration.StorageType { }, }) result = append(result, ®istration.StorageType{Obj: new(eventgrid_v20200601s.Topic)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.Namespace)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesAuthorizationRule)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesEventhub)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesEventhubsAuthorizationRule)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesEventhubsConsumerGroup)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.Namespace)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesAuthorizationRule)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesEventhub)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesEventhubsAuthorizationRule)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesEventhubsConsumerGroup)}) result = append(result, ®istration.StorageType{Obj: new(insights_v20180301s.MetricAlert)}) result = append(result, ®istration.StorageType{Obj: new(insights_v20180501ps.Webtest)}) result = append(result, ®istration.StorageType{Obj: new(insights_v20200202s.Component)}) @@ -1427,6 +1429,20 @@ func getKnownTypes() []client.Object { new(eventhub_v20211101s.NamespacesEventhub), new(eventhub_v20211101s.NamespacesEventhubsAuthorizationRule), new(eventhub_v20211101s.NamespacesEventhubsConsumerGroup)) + result = append( + result, + new(eventhub_v20240101.Namespace), + new(eventhub_v20240101.NamespacesAuthorizationRule), + new(eventhub_v20240101.NamespacesEventhub), + new(eventhub_v20240101.NamespacesEventhubsAuthorizationRule), + new(eventhub_v20240101.NamespacesEventhubsConsumerGroup)) + result = append( + result, + new(eventhub_v20240101s.Namespace), + new(eventhub_v20240101s.NamespacesAuthorizationRule), + new(eventhub_v20240101s.NamespacesEventhub), + new(eventhub_v20240101s.NamespacesEventhubsAuthorizationRule), + new(eventhub_v20240101s.NamespacesEventhubsConsumerGroup)) result = append(result, new(insights_v20180301.MetricAlert)) result = append(result, new(insights_v20180301s.MetricAlert)) result = append(result, new(insights_v20180501p.Webtest)) @@ -1834,6 +1850,8 @@ func createScheme() *runtime.Scheme { _ = eventgrid_v20200601s.AddToScheme(scheme) _ = eventhub_v20211101.AddToScheme(scheme) _ = eventhub_v20211101s.AddToScheme(scheme) + _ = eventhub_v20240101.AddToScheme(scheme) + _ = eventhub_v20240101s.AddToScheme(scheme) _ = insights_v20180301.AddToScheme(scheme) _ = insights_v20180301s.AddToScheme(scheme) _ = insights_v20180501p.AddToScheme(scheme) diff --git a/v2/internal/controllers/crd_eventhub_namespace_test.go b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go similarity index 57% rename from v2/internal/controllers/crd_eventhub_namespace_test.go rename to v2/internal/controllers/crd_eventhub_namespace_20211101_test.go index 38a1d9cbd22..14f52cafcd7 100644 --- a/v2/internal/controllers/crd_eventhub_namespace_test.go +++ b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go @@ -14,9 +14,10 @@ import ( eventhub "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" "github.com/Azure/azure-service-operator/v2/internal/testcommon" "github.com/Azure/azure-service-operator/v2/internal/util/to" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) -func Test_EventHub_Namespace_CRUD(t *testing.T) { +func Test_EventHub_Namespace_20211101_CRUD(t *testing.T) { t.Parallel() tc := globalTestContext.ForTest(t) @@ -51,6 +52,16 @@ func Test_EventHub_Namespace_CRUD(t *testing.T) { tc.PatchResourceAndWait(old, namespace) tc.Expect(namespace.Status.MaximumThroughputUnits).To(Equal(to.Ptr(2))) + // Run secret sub tests + tc.RunSubtests( + testcommon.Subtest{ + Name: "Namespace_SecretsWrittenToSameKubeSecret", + Test: func(tc *testcommon.KubePerTestContext) { + Namespace_SecretsWrittenToSameKubeSecret(tc, namespace) + }, + }, + ) + // Run sub tests tc.RunParallelSubtests( testcommon.Subtest{ @@ -73,6 +84,22 @@ func Test_EventHub_Namespace_CRUD(t *testing.T) { tc.ExpectResourceIsDeletedInAzure(armId, string(eventhub.APIVersion_Value)) } +func Namespace_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.Namespace) { + old := ns.DeepCopy() + namespaceKeysSecret := "namespacekeys" + ns.Spec.OperatorSpec = &eventhub.NamespaceOperatorSpec{ + Secrets: &eventhub.NamespaceOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + }, + } + tc.PatchResourceAndWait(old, ns) + + tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") +} + func EventHub_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { eh := &eventhub.NamespacesEventhub{ ObjectMeta: tc.MakeObjectMeta("eventhub"), @@ -132,10 +159,36 @@ func Namespace_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, namesp tc.Expect(rule.Status.Id).ToNot(BeNil()) + // Run secret sub tests + tc.RunSubtests( + testcommon.Subtest{ + Name: "NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret", + Test: func(tc *testcommon.KubePerTestContext) { + NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret(tc, rule) + }, + }, + ) + // a basic assertion on a property tc.Expect(rule.Status.Rights).To(HaveLen(2)) } +func NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesAuthorizationRule) { + old := ns.DeepCopy() + namespaceKeysSecret := "namespaceauthrulekeys" + ns.Spec.OperatorSpec = &eventhub.NamespacesAuthorizationRuleOperatorSpec{ + Secrets: &eventhub.NamespacesAuthorizationRuleOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + }, + } + tc.PatchResourceAndWait(old, ns) + + tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") +} + func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { rule := &eventhub.NamespacesEventhubsAuthorizationRule{ ObjectMeta: tc.MakeObjectMeta("eventhub"), @@ -153,10 +206,36 @@ func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh clie tc.Expect(rule.Status.Id).ToNot(BeNil()) + // Run secret sub tests + tc.RunSubtests( + testcommon.Subtest{ + Name: "EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret", + Test: func(tc *testcommon.KubePerTestContext) { + EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret(tc, rule) + }, + }, + ) + // a basic assertion on a property tc.Expect(rule.Status.Rights).To(HaveLen(2)) } +func EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesEventhubsAuthorizationRule) { + old := ns.DeepCopy() + namespaceKeysSecret := "eventhubauthrulekeys" + ns.Spec.OperatorSpec = &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSpec{ + Secrets: &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + }, + } + tc.PatchResourceAndWait(old, ns) + + tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") +} + func EventHub_ConsumerGroup_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { userMetadata := to.Ptr("This is some fun metadata") consumerGroup := &eventhub.NamespacesEventhubsConsumerGroup{ diff --git a/v2/internal/controllers/crd_eventhub_namespace_20240101_test.go b/v2/internal/controllers/crd_eventhub_namespace_20240101_test.go new file mode 100644 index 00000000000..e7fe0889061 --- /dev/null +++ b/v2/internal/controllers/crd_eventhub_namespace_20240101_test.go @@ -0,0 +1,257 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +package controllers_test + +import ( + "testing" + + . "github.com/onsi/gomega" + "sigs.k8s.io/controller-runtime/pkg/client" + + eventhub "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/internal/util/to" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_EventHub_Namespace_20240101_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + skuTier := eventhub.Sku_Tier_Standard + skuName := eventhub.Sku_Name_Standard + namespace := &eventhub.Namespace{ + ObjectMeta: tc.MakeObjectMeta("namespace"), + Spec: eventhub.Namespace_Spec{ + // Fails with NoRegisteredProviderFound error in westus2 + Location: tc.AzureRegion, + Owner: testcommon.AsOwner(rg), + Sku: &eventhub.Sku{ + Name: &skuName, + Tier: &skuTier, + }, + IsAutoInflateEnabled: to.Ptr(true), + MaximumThroughputUnits: to.Ptr(1), + }, + } + + tc.CreateResourceAndWait(namespace) + + tc.Expect(namespace.Status.Id).ToNot(BeNil()) + tc.Expect(namespace.Status.MaximumThroughputUnits).To(Equal(to.Ptr(1))) + armId := *namespace.Status.Id + + // Perform a simple patch + old := namespace.DeepCopy() + namespace.Spec.MaximumThroughputUnits = to.Ptr(2) + tc.PatchResourceAndWait(old, namespace) + tc.Expect(namespace.Status.MaximumThroughputUnits).To(Equal(to.Ptr(2))) + + // Run secret sub tests + tc.RunSubtests( + testcommon.Subtest{ + Name: "Namespace_SecretsWrittenToSameKubeSecret", + Test: func(tc *testcommon.KubePerTestContext) { + Namespace_20240101_SecretsWrittenToSameKubeSecret(tc, namespace) + }, + }, + ) + + // Run sub tests + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "EventHub CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + EventHub_20240101_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "EventHub namespace auth rule CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + Namespace_AuthorizationRules_20240101_CRUD(tc, namespace) + }, + }, + ) + + tc.DeleteResourceAndWait(namespace) + + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(eventhub.APIVersion_Value)) +} + +func Namespace_20240101_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.Namespace) { + old := ns.DeepCopy() + namespaceKeysSecret := "namespacekeys" + ns.Spec.OperatorSpec = &eventhub.NamespaceOperatorSpec{ + Secrets: &eventhub.NamespaceOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + }, + } + tc.PatchResourceAndWait(old, ns) + + tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") +} + +func EventHub_20240101_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { + eh := &eventhub.NamespacesEventhub{ + ObjectMeta: tc.MakeObjectMeta("eventhub"), + Spec: eventhub.Namespaces_Eventhub_Spec{ + Owner: testcommon.AsOwner(namespace), + MessageRetentionInDays: to.Ptr(7), + PartitionCount: to.Ptr(1), + }, + } + + tc.CreateResourceAndWait(eh) + defer tc.DeleteResourceAndWait(eh) + + tc.Expect(eh.Status.Id).ToNot(BeNil()) + + // a basic assertion on a property + tc.Expect(eh.Status.MessageRetentionInDays).ToNot(BeNil()) + tc.Expect(*eh.Status.MessageRetentionInDays).To(Equal(7)) + + // Run sub tests + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "EventHub auth rule CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + EventHub_AuthorizationRules_20240101_CRUD(tc, eh) + }, + }, + testcommon.Subtest{ + Name: "EventHub consumer group CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + EventHub_ConsumerGroup_20240101_CRUD(tc, eh) + }, + }, + ) + + // Perform a simple patch + old := eh.DeepCopy() + eh.Spec.MessageRetentionInDays = to.Ptr(3) + tc.PatchResourceAndWait(old, eh) + tc.Expect(eh.Status.MessageRetentionInDays).To(Equal(to.Ptr(3))) +} + +func Namespace_AuthorizationRules_20240101_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { + rule := &eventhub.NamespacesAuthorizationRule{ + ObjectMeta: tc.MakeObjectMeta("eventhub"), + Spec: eventhub.Namespaces_AuthorizationRule_Spec{ + Owner: testcommon.AsOwner(namespace), + Rights: []eventhub.Namespaces_AuthorizationRule_Properties_Rights_Spec{ + eventhub.Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, + eventhub.Namespaces_AuthorizationRule_Properties_Rights_Spec_Send, + }, + }, + } + + tc.CreateResourceAndWait(rule) + defer tc.DeleteResourceAndWait(rule) + + tc.Expect(rule.Status.Id).ToNot(BeNil()) + + // Run secret sub tests + tc.RunSubtests( + testcommon.Subtest{ + Name: "NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret", + Test: func(tc *testcommon.KubePerTestContext) { + NamespacesAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc, rule) + }, + }, + ) + + // a basic assertion on a property + tc.Expect(rule.Status.Rights).To(HaveLen(2)) +} + +func NamespacesAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesAuthorizationRule) { + old := ns.DeepCopy() + namespaceKeysSecret := "namespaceauthrulekeys" + ns.Spec.OperatorSpec = &eventhub.NamespacesAuthorizationRuleOperatorSpec{ + Secrets: &eventhub.NamespacesAuthorizationRuleOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + }, + } + tc.PatchResourceAndWait(old, ns) + + tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") +} + +func EventHub_AuthorizationRules_20240101_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { + rule := &eventhub.NamespacesEventhubsAuthorizationRule{ + ObjectMeta: tc.MakeObjectMeta("eventhub"), + Spec: eventhub.Namespaces_Eventhubs_AuthorizationRule_Spec{ + Owner: testcommon.AsOwner(eh), + Rights: []eventhub.Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec{ + eventhub.Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen, + eventhub.Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send, + }, + }, + } + + tc.CreateResourceAndWait(rule) + defer tc.DeleteResourceAndWait(rule) + + tc.Expect(rule.Status.Id).ToNot(BeNil()) + + // Run secret sub tests + tc.RunSubtests( + testcommon.Subtest{ + Name: "EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret", + Test: func(tc *testcommon.KubePerTestContext) { + EventHubAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc, rule) + }, + }, + ) + + // a basic assertion on a property + tc.Expect(rule.Status.Rights).To(HaveLen(2)) +} + +func EventHubAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesEventhubsAuthorizationRule) { + old := ns.DeepCopy() + namespaceKeysSecret := "eventhubauthrulekeys" + ns.Spec.OperatorSpec = &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSpec{ + Secrets: &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + }, + } + tc.PatchResourceAndWait(old, ns) + + tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") +} + +func EventHub_ConsumerGroup_20240101_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { + userMetadata := to.Ptr("This is some fun metadata") + consumerGroup := &eventhub.NamespacesEventhubsConsumerGroup{ + ObjectMeta: tc.MakeObjectMeta("eventhub"), + Spec: eventhub.Namespaces_Eventhubs_Consumergroup_Spec{ + Owner: testcommon.AsOwner(eh), + UserMetadata: to.Ptr("This is some fun metadata"), + }, + } + + tc.CreateResourceAndWait(consumerGroup) + defer tc.DeleteResourceAndWait(consumerGroup) + + tc.Expect(consumerGroup.Status.Id).ToNot(BeNil()) + + // a basic assertion on a property + tc.Expect(consumerGroup.Status.UserMetadata).To(Equal(userMetadata)) +} diff --git a/v2/internal/controllers/recordings/Test_EventHub_Namespace_20211101_CRUD.yaml b/v2/internal/controllers/recordings/Test_EventHub_Namespace_20211101_CRUD.yaml new file mode 100644 index 00000000000..61644d015b0 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_EventHub_Namespace_20211101_CRUD.yaml @@ -0,0 +1,2337 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-rg-qyjaak","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "93" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - a255ace0b71a44f1d1e6b48b46ee01727e42d66790e7a9718cd6e40ad68ebaf0 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak?api-version=2020-06-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak","name":"asotest-rg-qyjaak","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-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: 182D2A05D63045B4A7AAC369E5E5D770 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:13:41Z' + status: 201 Created + code: 201 + duration: 3.789428666s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak?api-version=2020-06-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak","name":"asotest-rg-qyjaak","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-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: 0CF22FCB390C4C61BC55949BE58DBF3B Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:13:48Z' + status: 200 OK + code: 200 + duration: 63.62325ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 170 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-namespace-vulxms","properties":{"isAutoInflateEnabled":true,"maximumThroughputUnits":1},"sku":{"name":"Standard","tier":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "170" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - c94790ae2a1c4c60b26130173586fccaa81f1a1f297642871b1a8c1fc54f47fd + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 752 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "752" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 3bd28271-1161-4bf1-860f-c9bfe6d5ca66 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2024-03-19T21:13:54 + X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: + - "49" + X-Msedge-Ref: + - 'Ref A: 337983EAF21B492EA2552D4B3D7057A3 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:13:50Z' + status: 201 Created + code: 201 + duration: 3.604117583s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 784 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "784" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 25e10d5c-1969-4bc8-881a-605a6eac764f + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2024-03-19T21:14:01 + X-Msedge-Ref: + - 'Ref A: 5EB690BF1CFA44CB84FF0E85BFBEAD55 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:00Z' + status: 200 OK + code: 200 + duration: 1.291455541s + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 784 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "784" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 813b0249-75e1-4e72-9a8f-e21569d0654e + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2024-03-19T21:14:07 + X-Msedge-Ref: + - 'Ref A: DD89CC7167684D179F101565F9D77E73 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:06Z' + status: 200 OK + code: 200 + duration: 1.244776916s + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 783 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "783" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 7bdb8b20-4cfc-4ad6-a388-453a70f622d2 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G10|2024-03-19T21:14:18 + X-Msedge-Ref: + - 'Ref A: B6593122037F457685C74EE2451EC63A Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:17Z' + status: 200 OK + code: 200 + duration: 1.403149167s + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 783 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "783" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 2ce8c496-98cc-4dfb-a3c8-2fb7df96695f + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2024-03-19T21:14:21 + X-Msedge-Ref: + - 'Ref A: 4AF3C15F87E8415C8AFF6A5D1C1C7093 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:20Z' + status: 200 OK + code: 200 + duration: 1.234804375s + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 170 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-namespace-vulxms","properties":{"isAutoInflateEnabled":true,"maximumThroughputUnits":2},"sku":{"name":"Standard","tier":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "170" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 5d2d02256e051b41527bdf031de86cc5d21eab5398a01b835d4d3258aa10937f + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 752 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Updating","status":"Updating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "752" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 1fd7844f-9a9b-44bd-887c-2628d6ce2a7e + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2024-03-19T21:14:27 + X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: + - "49" + X-Msedge-Ref: + - 'Ref A: 2D335F1135F042FB9096A18E317591CA Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:25Z' + status: 200 OK + code: 200 + duration: 2.865317833s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 784 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Updating","status":"Updating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "784" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - f308d442-b058-4ef5-b933-608c98600e5b + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2024-03-19T21:14:33 + X-Msedge-Ref: + - 'Ref A: AB486DFDCDDE43F5924F01420EF66091 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:31Z' + status: 200 OK + code: 200 + duration: 1.605605958s + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 783 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "783" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - b35870f5-0c80-4a61-bcac-71ce0bd9c8d1 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G11|2024-03-19T21:14:41 + X-Msedge-Ref: + - 'Ref A: 95DBC48729A041A3944F7C47EDF81186 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:37Z' + status: 200 OK + code: 200 + duration: 4.254659s + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "6" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 783 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "783" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 586b6bfe-8081-489e-88fa-720742375ac5 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G10|2024-03-19T21:14:46 + X-Msedge-Ref: + - 'Ref A: E5D81A4CB9E943AAAE495296230A6E9D Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:45Z' + status: 200 OK + code: 200 + duration: 1.379428791s + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 170 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-namespace-vulxms","properties":{"isAutoInflateEnabled":true,"maximumThroughputUnits":2},"sku":{"name":"Standard","tier":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "170" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + Test-Request-Hash: + - 5d2d02256e051b41527bdf031de86cc5d21eab5398a01b835d4d3258aa10937f + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 751 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "751" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 80e0cefd-3ff9-4c77-80ef-b23d21661e66 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G14|2024-03-19T21:14:51 + X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: + - "49" + X-Msedge-Ref: + - 'Ref A: 3DDA4F3BA3D042FD9C06AB9ED5F55856 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:50Z' + status: 200 OK + code: 200 + duration: 1.897641542s + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "7" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 783 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms","name":"asotest-namespace-vulxms","type":"Microsoft.EventHub/Namespaces","location":"westus2","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vulxms","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vulxms.servicebus.windows.net:443/","isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "783" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - e9c420d5-303b-4d6d-856f-7c4b92a78fde + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G1|2024-03-19T21:14:55 + X-Msedge-Ref: + - 'Ref A: 9416DB43BC1444A5A1E6D450912637EB Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:54Z' + status: 200 OK + code: 200 + duration: 1.244844417s + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 559 + uncompressed: false + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-vulxms.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-vulxms.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "559" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 9a316e12-ea3a-4c98-b0f4-1df46d9920fd + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G4|2024-03-19T21:14:57 + X-Msedge-Ref: + - 'Ref A: 2D914E575E184755852ED979D3D926F7 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:14:56Z' + status: 200 OK + code: 200 + duration: 1.606002167s + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 95 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-eventhub-rujomk","properties":{"messageRetentionInDays":7,"partitionCount":1}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "95" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 6f573d87d1e9f28a3cf6b7f2221f9079f3dc957e159b7b5e9cd36c042dd02001 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 472 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk","name":"asotest-eventhub-rujomk","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westus2","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","partitionIds":["0"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "472" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - ea93543b-2ba4-42ff-b8b3-8f347cccf004 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G9|2024-03-19T21:15:03 + X-Msedge-Ref: + - 'Ref A: 4AC91E08330745B394FD56A486D9AEFE Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:01Z' + status: 200 OK + code: 200 + duration: 2.466788417s + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 470 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk","name":"asotest-eventhub-rujomk","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westus2","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2024-03-19T21:15:02.963","updatedAt":"2024-03-19T21:15:03.13","partitionIds":["0"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "470" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 34584fbf-4d0f-401a-b5d4-e967ae8532b7 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2024-03-19T21:15:07 + X-Msedge-Ref: + - 'Ref A: D3EDEA1FD1F740589933ABAEDEAFABA0 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:06Z' + status: 200 OK + code: 200 + duration: 1.258770834s + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 76 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-eventhub-oereyc","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "76" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 5817fb882e68e30bb160398424b8ca4bedec63e0d14f2b0493fcab29acd271cd + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 355 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc","name":"asotest-eventhub-oereyc","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "355" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - fa2b1cec-ed09-4a6d-b9e2-9179ebb87b6c + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G11|2024-03-19T21:15:07 + X-Msedge-Ref: + - 'Ref A: FCDA59203D004BE99883AF90989DF6DA Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:01Z' + status: 200 OK + code: 200 + duration: 6.645820916s + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 76 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-eventhub-weicol","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "76" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - b1186fdd68fa2cc2873517088fd711f7c187f8c153b1d228a6a09ee9d3106f2a + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 378 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol","name":"asotest-eventhub-weicol","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "378" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 0549b876-8e4a-4f01-a793-6f6e11c43c1f + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2024-03-19T21:15:12 + X-Msedge-Ref: + - 'Ref A: 834799F6FC534960BCCB92D21A1B2EF9 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:11Z' + status: 200 OK + code: 200 + duration: 1.684514333s + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 92 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-eventhub-eymons","properties":{"userMetadata":"This is some fun metadata"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "92" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 9d34ceca8961642bf3020a82bde5dcb7f965c0619a1c9c7338eb08c4cf01eb7f + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/consumergroups/asotest-eventhub-eymons?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 493 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/consumergroups/asotest-eventhub-eymons","name":"asotest-eventhub-eymons","type":"Microsoft.EventHub/namespaces/eventhubs/consumergroups","location":"westus2","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"This is some fun metadata"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "493" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - acb0674d-b253-4a7a-8acd-36587eab3c33 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2024-03-19T21:15:13 + X-Msedge-Ref: + - 'Ref A: C3382FAFF5A14DABB09D3D81074A7134 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:11Z' + status: 200 OK + code: 200 + duration: 2.489833125s + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 355 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationrules/asotest-eventhub-oereyc","name":"asotest-eventhub-oereyc","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "355" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 5fc79b86-63f3-40e2-9daf-cf353e74967b + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2024-03-19T21:15:15 + X-Msedge-Ref: + - 'Ref A: 7A21F618EB504F079754AB5D661039C0 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:14Z' + status: 200 OK + code: 200 + duration: 747.790125ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 399 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationrules/asotest-eventhub-weicol","name":"asotest-eventhub-weicol","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "399" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - ed1053c9-6c58-4b77-aede-f852cace4e5b + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G4|2024-03-19T21:15:15 + X-Msedge-Ref: + - 'Ref A: 48BBA5F3E0FB446AAC2C9E6FD6AC7952 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:14Z' + status: 200 OK + code: 200 + duration: 738.774375ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/consumergroups/asotest-eventhub-eymons?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 485 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/consumergroups/asotest-eventhub-eymons","name":"asotest-eventhub-eymons","type":"Microsoft.EventHub/namespaces/eventhubs/consumergroups","location":"westus2","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"This is some fun metadata"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "485" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - dae59f33-9c36-4516-9799-cf0b8e8b3a78 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G4|2024-03-19T21:15:16 + X-Msedge-Ref: + - 'Ref A: 74BBE5842A474E608931F5743A9F485A Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:16Z' + status: 200 OK + code: 200 + duration: 403.774ms + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/consumergroups/asotest-eventhub-eymons?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000012092 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2024-03-19T21:15:21 + X-Msedge-Ref: + - 'Ref A: 9A24DF9FB041407A98AB6B1E95A2AFD8 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:20Z' + status: 200 OK + code: 200 + duration: 1.340401833s + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 76 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-eventhub-oereyc","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "76" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + Test-Request-Hash: + - 5817fb882e68e30bb160398424b8ca4bedec63e0d14f2b0493fcab29acd271cd + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 355 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc","name":"asotest-eventhub-oereyc","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "355" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - bf5775c3-5287-4639-a061-7921eaf79190 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2024-03-19T21:15:21 + X-Msedge-Ref: + - 'Ref A: 873DD81F2FC34FD68D7EF245E242302D Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:20Z' + status: 200 OK + code: 200 + duration: 1.575107625s + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 76 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-eventhub-weicol","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "76" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + Test-Request-Hash: + - b1186fdd68fa2cc2873517088fd711f7c187f8c153b1d228a6a09ee9d3106f2a + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 378 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol","name":"asotest-eventhub-weicol","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "378" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 1eeaac78-56d9-4213-917f-ddd2388a1234 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2024-03-19T21:15:21 + X-Msedge-Ref: + - 'Ref A: 17B76CB6677848FB88C7434410F4D325 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:20Z' + status: 200 OK + code: 200 + duration: 1.754137125s + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 355 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationrules/asotest-eventhub-oereyc","name":"asotest-eventhub-oereyc","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "355" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - d4147bcf-048f-441c-8d40-3e8cd157dee4 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G9|2024-03-19T21:15:24 + X-Msedge-Ref: + - 'Ref A: E2CFC771E09E4746BE01DF33787138C4 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:23Z' + status: 200 OK + code: 200 + duration: 764.264333ms + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 399 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationrules/asotest-eventhub-weicol","name":"asotest-eventhub-weicol","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "399" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - efaa6277-5dae-4e3d-8779-3798a1531f43 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G10|2024-03-19T21:15:25 + X-Msedge-Ref: + - 'Ref A: D5CF5067A4114780A0EBCF11BA122136 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:23Z' + status: 200 OK + code: 200 + duration: 1.747234458s + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc/listKeys?api-version=2021-11-01 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 553 + uncompressed: false + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-vulxms.servicebus.windows.net/;SharedAccessKeyName=asotest-eventhub-oereyc;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-vulxms.servicebus.windows.net/;SharedAccessKeyName=asotest-eventhub-oereyc;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotest-eventhub-oereyc"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "553" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - b55c114c-57df-4bb9-8bd3-bf8f74205893 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G9|2024-03-19T21:15:26 + X-Msedge-Ref: + - 'Ref A: A59B4A1050F245D5A13BD0025C7DAF9F Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:25Z' + status: 200 OK + code: 200 + duration: 1.584758083s + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol/listKeys?api-version=2021-11-01 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 623 + uncompressed: false + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-vulxms.servicebus.windows.net/;SharedAccessKeyName=asotest-eventhub-weicol;SharedAccessKey={KEY};EntityPath=asotest-eventhub-rujomk","secondaryConnectionString":"Endpoint=sb://asotest-namespace-vulxms.servicebus.windows.net/;SharedAccessKeyName=asotest-eventhub-weicol;SharedAccessKey={KEY};EntityPath=asotest-eventhub-rujomk","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotest-eventhub-weicol"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "623" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - e7308105-de17-4dea-bea4-4ede9396ae36 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2024-03-19T21:15:28 + X-Msedge-Ref: + - 'Ref A: 53CB1980EBEF4A93A2CEE7A7F7F9ED67 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:27Z' + status: 200 OK + code: 200 + duration: 1.370338375s + - id: 29 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk/authorizationRules/asotest-eventhub-weicol?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000002336 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G0|2024-03-19T21:15:31 + X-Msedge-Ref: + - 'Ref A: F90EA2D214E749328E2D01300389761E Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:30Z' + status: 200 OK + code: 200 + duration: 1.737900458s + - id: 30 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 95 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-eventhub-rujomk","properties":{"messageRetentionInDays":3,"partitionCount":1}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "95" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 387619d084b72f7a3640ccd4d80518339126123dd24a6b1c57cee1ab5bcc02a6 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 463 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk","name":"asotest-eventhub-rujomk","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westus2","properties":{"messageRetentionInDays":3,"partitionCount":1,"status":"Active","createdAt":"0001-01-01T00:00:00","updatedAt":"2001-02-03T04:05:06Z","partitionIds":[]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "463" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - bc3b52d3-6463-4c5e-b97c-5a5cf0c533df + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2024-03-19T21:15:35 + X-Msedge-Ref: + - 'Ref A: 8D2CBD171909417ABBE76C0251E5C49B Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:35Z' + status: 200 OK + code: 200 + duration: 514.645417ms + - id: 31 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 469 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk","name":"asotest-eventhub-rujomk","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westus2","properties":{"messageRetentionInDays":3,"partitionCount":1,"status":"Active","createdAt":"2024-03-19T21:15:02.963","updatedAt":"2024-03-19T21:15:35.8","partitionIds":["0"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "469" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - fee3bb0c-ee93-4013-9b3d-dd706b3d31d3 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2024-03-19T21:15:37 + X-Msedge-Ref: + - 'Ref A: E95851C1422C42CFA76966F47328012F Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:36Z' + status: 200 OK + code: 200 + duration: 1.273004166s + - id: 32 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/authorizationRules/asotest-eventhub-oereyc?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000012092 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2024-03-19T21:15:37 + X-Msedge-Ref: + - 'Ref A: 3D69C9738FF3426593BD752E567121B1 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:30Z' + status: 200 OK + code: 200 + duration: 10.032029833s + - id: 33 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms/eventhubs/asotest-eventhub-rujomk?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000002336 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G0|2024-03-19T21:15:44 + X-Msedge-Ref: + - 'Ref A: BB2F65EF235A408DAA7D2FF49C264C66 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:40Z' + status: 200 OK + code: 200 + duration: 6.729333333s + - id: 34 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Azure-Asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/locations/westus2/namespaceOperationResults/b05d2d02-d375-4f20-8d92-08147feb624e?isAsyncHeader=true&resourceName=asotest-namespace-vulxms&resourceType=namespace&api-version=2021-11-01&operationType=Deleted&t=638464797571031375&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=kg2ka5BYMdcxeLuYEAABnPVl1yUcubgC9DsnVomV_M40SN7ZqZ58QsuR1g2BCx2r9yTY7hj8MzZQ75tN7wlVPMPpkv4Hi9LxNo0zX0Q5P6AspNMg5WdwukqWhrBTHOudyuPz0HvwGD-ZgRSRBnOjADkEZpJ4cuVS4kdu9rFyLgZKmAsMBGxvRClmcZ1WCIz940n5QPckfXMJTMOlmo_D0sKYMG1A7ryjbbrBdfT2wHjHjF-7cBJ1d7vA1Ev_9NRHAOy5ZLE8gMT0bjaFdPY0G4HeE9lf0ImJNQX1w54Q6Sgg9CiM3z0reA_iGJTWpP1lBSVBNPV_K6W5iLurFMTH7w&h=VTReocG126dZNkSPQriw3xRX8ODKMa7_u1Bmyz6cqUE + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/locations/westus2/namespaceOperationResults/b05d2d02-d375-4f20-8d92-08147feb624e?isAsyncHeader=false&resourceName=asotest-namespace-vulxms&resourceType=namespace&api-version=2021-11-01&operationType=Deleted&t=638464797571031375&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=kg2ka5BYMdcxeLuYEAABnPVl1yUcubgC9DsnVomV_M40SN7ZqZ58QsuR1g2BCx2r9yTY7hj8MzZQ75tN7wlVPMPpkv4Hi9LxNo0zX0Q5P6AspNMg5WdwukqWhrBTHOudyuPz0HvwGD-ZgRSRBnOjADkEZpJ4cuVS4kdu9rFyLgZKmAsMBGxvRClmcZ1WCIz940n5QPckfXMJTMOlmo_D0sKYMG1A7ryjbbrBdfT2wHjHjF-7cBJ1d7vA1Ev_9NRHAOy5ZLE8gMT0bjaFdPY0G4HeE9lf0ImJNQX1w54Q6Sgg9CiM3z0reA_iGJTWpP1lBSVBNPV_K6W5iLurFMTH7w&h=VTReocG126dZNkSPQriw3xRX8ODKMa7_u1Bmyz6cqUE + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000012092 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2024-03-19T21:15:56 + X-Msedge-Ref: + - 'Ref A: 82D9859F1D864D4496F933872780B4A1 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:55Z' + status: 202 Accepted + code: 202 + duration: 1.664956125s + - id: 35 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/locations/westus2/namespaceOperationResults/b05d2d02-d375-4f20-8d92-08147feb624e?isAsyncHeader=true&resourceName=asotest-namespace-vulxms&resourceType=namespace&api-version=2021-11-01&operationType=Deleted&t=638464797571031375&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=kg2ka5BYMdcxeLuYEAABnPVl1yUcubgC9DsnVomV_M40SN7ZqZ58QsuR1g2BCx2r9yTY7hj8MzZQ75tN7wlVPMPpkv4Hi9LxNo0zX0Q5P6AspNMg5WdwukqWhrBTHOudyuPz0HvwGD-ZgRSRBnOjADkEZpJ4cuVS4kdu9rFyLgZKmAsMBGxvRClmcZ1WCIz940n5QPckfXMJTMOlmo_D0sKYMG1A7ryjbbrBdfT2wHjHjF-7cBJ1d7vA1Ev_9NRHAOy5ZLE8gMT0bjaFdPY0G4HeE9lf0ImJNQX1w54Q6Sgg9CiM3z0reA_iGJTWpP1lBSVBNPV_K6W5iLurFMTH7w&h=VTReocG126dZNkSPQriw3xRX8ODKMa7_u1Bmyz6cqUE + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 68 + uncompressed: false + body: '{"name":"b05d2d02-d375-4f20-8d92-08147feb624e","status":"Succeeded"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "68" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 6928b9b5-c62b-47b3-a2b3-b71887125d65 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G13|2024-03-19T21:16:00 + X-Msedge-Ref: + - 'Ref A: 3A421379399F4E90AFFB958B02216468 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:15:59Z' + status: 200 OK + code: 200 + duration: 1.239422333s + - id: 36 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "8" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak/providers/Microsoft.EventHub/namespaces/asotest-namespace-vulxms?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 97 + uncompressed: false + body: '{"error":{"code":"NamespaceNotFound","message":"Namespace ''asotest-namespace-vulxms'' not found"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "97" + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 2e24187d-b35a-4efd-bc16-17d82f9cb517 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2024-03-19T21:16:06 + X-Msedge-Ref: + - 'Ref A: 3D3B51E3EAEF4C1AB1B0B0C6FBCE2E79 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:16:05Z' + status: 404 Not Found + code: 404 + duration: 1.326955292s + - id: 37 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qyjaak?api-version=2020-06-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464797727280416&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=aQSVVNNmWNjJFy607bT1L-gJ7533HqL7qkViTf0_uXDYOWgTSxLPZUXoLKiCtMPif2yPsxEwmFL-qdC2bOj1z-BrIFvlfgl2WtJaMXdUAAB-6QmfIeb5E2CHv5DD8WPSEdjGxj6S0Qe6qAQh2oClG86PJliCTjDsWBP5Sx60qDzFtDQX5LWofU5ekCIOY_MnYikvACgnIHVayq_u4fRo3tb02oxhj09_pPsdF7JGfRf1YuDZxyxz4xUhZSHOWMobWR6rsGjx-YkLTRFL9yqsL6Wntgt67hqrJJ7fGclt6Di7DMBMdSDQ6N4HmsDNaHcuiOxlzVxxK_9iB5vXgDW-BA&h=jrAKi7Y4XV-B_WTvsPtJazc_Drx7fRAgb1ON9DlTF38 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: E465D1CE608C401E8D094ACAA82A4766 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:16:08Z' + status: 202 Accepted + code: 202 + duration: 4.690505375s + - id: 38 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464797727280416&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=aQSVVNNmWNjJFy607bT1L-gJ7533HqL7qkViTf0_uXDYOWgTSxLPZUXoLKiCtMPif2yPsxEwmFL-qdC2bOj1z-BrIFvlfgl2WtJaMXdUAAB-6QmfIeb5E2CHv5DD8WPSEdjGxj6S0Qe6qAQh2oClG86PJliCTjDsWBP5Sx60qDzFtDQX5LWofU5ekCIOY_MnYikvACgnIHVayq_u4fRo3tb02oxhj09_pPsdF7JGfRf1YuDZxyxz4xUhZSHOWMobWR6rsGjx-YkLTRFL9yqsL6Wntgt67hqrJJ7fGclt6Di7DMBMdSDQ6N4HmsDNaHcuiOxlzVxxK_9iB5vXgDW-BA&h=jrAKi7Y4XV-B_WTvsPtJazc_Drx7fRAgb1ON9DlTF38 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464797934405413&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=r2Sd65J_zuGpyGhhI9EHmZcQyOEHWhwpxRI7Oto1r3FX6GpUqGmqAxXHDlwb_wcsP8TyHaMBJ_Wr9YNEAPdyFAEWA8icLG2dSkVpuKIm9Tp9AVwkeybqkOuD058wKD0Rf3FLtocquEo_SJGBUZRqZnWIBEzJ5300IO4I3P_BACSxF_Mwgmp6I20Jj5Qmk1SOPhAWb5WqmiuMX3M2_phze4qlppbv2ZRf7Z17vGbP35t8MUaFHmXM2qtt-D9i5Ljzn4AtcBV-qYaQ5Vzk0T0CJvUxXiQAHQbH6kRGnjiEkEFc_z0VGcvNVfa13-GzFzfdu0BwKqCSVOaD9EB830HpRg&h=QnBUYOlNEZvZMBJQuId66VTJjgTv3Q9lYzoeshi9Thg + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: 630121C469DE4184B7874B8654D8625F Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:16:32Z' + status: 202 Accepted + code: 202 + duration: 961.035834ms + - id: 39 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464797727280416&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=aQSVVNNmWNjJFy607bT1L-gJ7533HqL7qkViTf0_uXDYOWgTSxLPZUXoLKiCtMPif2yPsxEwmFL-qdC2bOj1z-BrIFvlfgl2WtJaMXdUAAB-6QmfIeb5E2CHv5DD8WPSEdjGxj6S0Qe6qAQh2oClG86PJliCTjDsWBP5Sx60qDzFtDQX5LWofU5ekCIOY_MnYikvACgnIHVayq_u4fRo3tb02oxhj09_pPsdF7JGfRf1YuDZxyxz4xUhZSHOWMobWR6rsGjx-YkLTRFL9yqsL6Wntgt67hqrJJ7fGclt6Di7DMBMdSDQ6N4HmsDNaHcuiOxlzVxxK_9iB5vXgDW-BA&h=jrAKi7Y4XV-B_WTvsPtJazc_Drx7fRAgb1ON9DlTF38 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464798103737895&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=nmXXussG0LswdORmsPr2f3-NLS2bObIvgK-tkhcQW4v5UIpTsj5zuImf9cUtA5xZx9PyokZ8mLXJUdqzUR-gw6w6yMRi68MpH7w_ddkCbM51HtT0V3Rvs6aj21c5HYm06oQa-GUODEe7T3zjw3Ap32X54ObWB_g6oCP_WGujpPAQPQPcOpHSZOz9fWhO2rt8xHaQWyo1_axQ6_91gmX2HzgF9HmqribB3lsIlFVC4eJ5ROB0dTWTs5zgBhQPM7sbtT7CRmtSBL-XkuIXvQgzdl2_QvG55LjPQ43YzjedQb7bdpygMO_7weNOeLc2Tp2qfjCtbVSiCUWCb366pYjEcg&h=AeGiXlLqImAkm3b9CqzgNOSK0d6yefPx5VN0QO7Czr8 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: C32BD1EAEBDE430C85D23665CE1D7A2C Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:16:49Z' + status: 202 Accepted + code: 202 + duration: 893.86275ms + - id: 40 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464797727280416&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=aQSVVNNmWNjJFy607bT1L-gJ7533HqL7qkViTf0_uXDYOWgTSxLPZUXoLKiCtMPif2yPsxEwmFL-qdC2bOj1z-BrIFvlfgl2WtJaMXdUAAB-6QmfIeb5E2CHv5DD8WPSEdjGxj6S0Qe6qAQh2oClG86PJliCTjDsWBP5Sx60qDzFtDQX5LWofU5ekCIOY_MnYikvACgnIHVayq_u4fRo3tb02oxhj09_pPsdF7JGfRf1YuDZxyxz4xUhZSHOWMobWR6rsGjx-YkLTRFL9yqsL6Wntgt67hqrJJ7fGclt6Di7DMBMdSDQ6N4HmsDNaHcuiOxlzVxxK_9iB5vXgDW-BA&h=jrAKi7Y4XV-B_WTvsPtJazc_Drx7fRAgb1ON9DlTF38 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464798272128659&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=W0vpz8lYDFo0hioQE9f2v7nEZXIjKi8w6XXgQewnuo8-UufRlxKANozQWg_Gi_n6cokXYGlmvQDuhdlew0ZfY5jQHcvomNsyekcRqAIDnc4l8ZYxZoXm2PAnDO8_H_J5YzAq39DPFSck8niedJNclEi0d-zkwXGRxKQG7G8GwLnwLyt9yTWhmOvK8L1dWp4u3Qy3hYB3Wyp-xO149lbusb4Rk5yI0hZaEVAiQP1IvFTCwsNI8S--EE21EdJjxf5G7dAQWwimZQDOSLA2DXb4zCJHQva8b3V7WjSPV5ESoAHNSQfKUC1v0ZRdLcEzInjZkNfrrpS2htdxJJt-jmnhMg&h=Zn5JduAiIgPAihW5ezbMZZqffJ88ecE5UcpZ6FkdJ6A + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: ED57FABCDBEF4D98B36FCCAC39E484D2 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:17:06Z' + status: 202 Accepted + code: 202 + duration: 1.015150709s + - id: 41 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRWUpBQUstV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638464797727280416&c=MIIHADCCBeigAwIBAgITHgPrWOVrMb7qufvgEAAAA-tY5TANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDYwHhcNMjQwMjAxMDQxMjQzWhcNMjUwMTI2MDQxMjQzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOil3F8MsZdl8FeicToFLcoRyDn0Zv76EQTwG1IZtUh-z6uwzGIgy23k7GrXNU1gKVyGJp8lO3encPC02rUQkI0lvN-NUJCoJAEnGZPYOLmA9NylSyr1Ik_Qaz1_UueFRAiyVJlo0Lz27ayfzTTSUd82wyh18q-LWdG49N7fSD_fM1rsfxbY7-Eo4Z5CjxDW3OWmAYKpS0tm17o2hEKrmjeNZJQsSqQxUL-1Be4vND7XzGhGI595ogShOZHOzCBueWR2-8fa5VrwlHqtU1AgvjFk3lYmZejl898JrGFMYH-QSC1iWyRweQ_m3289K-aPeRSWqRihXIG9oHEqouTO1xkCAwEAAaOCA-0wggPpMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHLBggrBgEFBQcBAQSCAb0wggG5MGMGCCsGAQUFBzAChldodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MFMGCCsGAQUFBzAChkdodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAyLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDA2LmNydDBTBggrBgEFBQcwAoZHaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMi5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwNi5jcnQwUwYIKwYBBQUHMAKGR2h0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDIuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3J0MB0GA1UdDgQWBBTew4tn2tBCof44yM20soU6sfep6zAOBgNVHQ8BAf8EBAMCBaAwggEmBgNVHR8EggEdMIIBGTCCARWgggERoIIBDYY_aHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JshjFodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDYuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBTxRmjG8cPwKy19i2rhsvm-NfzRQTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAGBANOAsl8fyImo8IXVQ_ybox-BzCeFiAddg9Ojd61exGTea02-HjvZzuL6GZ2k21c7rEjKSBHqk50RLm2yXrMcUGc1UO7MRchaKQm1WR7osgDiXAU0rDc9-H-i8I245Y_PbyKIBewiK7UQiCjda4b__7Amrw7q4oILOsxshnN_D1NBm2nSjm-dFiDeJ9jpG9X1jDJSBtOFUQ7Ala8ShJvWPMpbCR3gFHOGS9f13ebv6qXblaf7sHxE6T0OpuEZPL10Iu5yh42IOLo8wvp1euqb61U3JWoOmBXEB3mJ0owRfBHEjuAARDUzNVgq28F6FYqgACE3nKhqDKYDEQstlJK0&s=aQSVVNNmWNjJFy607bT1L-gJ7533HqL7qkViTf0_uXDYOWgTSxLPZUXoLKiCtMPif2yPsxEwmFL-qdC2bOj1z-BrIFvlfgl2WtJaMXdUAAB-6QmfIeb5E2CHv5DD8WPSEdjGxj6S0Qe6qAQh2oClG86PJliCTjDsWBP5Sx60qDzFtDQX5LWofU5ekCIOY_MnYikvACgnIHVayq_u4fRo3tb02oxhj09_pPsdF7JGfRf1YuDZxyxz4xUhZSHOWMobWR6rsGjx-YkLTRFL9yqsL6Wntgt67hqrJJ7fGclt6Di7DMBMdSDQ6N4HmsDNaHcuiOxlzVxxK_9iB5vXgDW-BA&h=jrAKi7Y4XV-B_WTvsPtJazc_Drx7fRAgb1ON9DlTF38 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: 26EB3568140B408BBA3F005367283FF1 Ref B: SYD03EDGE1319 Ref C: 2024-03-19T21:17:23Z' + status: 200 OK + code: 200 + duration: 928.237291ms diff --git a/v2/internal/controllers/recordings/Test_EventHub_Namespace_CRUD.yaml b/v2/internal/controllers/recordings/Test_EventHub_Namespace_CRUD.yaml deleted file mode 100644 index 81d56c65825..00000000000 --- a/v2/internal/controllers/recordings/Test_EventHub_Namespace_CRUD.yaml +++ /dev/null @@ -1,1335 +0,0 @@ ---- -version: 1 -interactions: -- request: - body: '{"location":"westus2","name":"asotest-rg-jrrrwl","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-jrrrwl?api-version=2020-06-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl","name":"asotest-rg-jrrrwl","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-jrrrwl?api-version=2020-06-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl","name":"asotest-rg-jrrrwl","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: '{"location":"westus2","name":"asotest-namespace-omtjob","properties":{"isAutoInflateEnabled":true,"maximumThroughputUnits":1},"sku":{"name":"Standard","tier":"Standard"}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "170" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: PUT - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: - - "49" - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Active"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":1,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Active"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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-namespace-omtjob","properties":{"isAutoInflateEnabled":true,"maximumThroughputUnits":2},"sku":{"name":"Standard","tier":"Standard"}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "170" - Content-Type: - - application/json - Test-Request-Attempt: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: PUT - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: - - "48" - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Test-Request-Attempt: - - "5" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Active"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "6" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Active"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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-eventhub-gdwlpt","properties":{"messageRetentionInDays":7,"partitionCount":1}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "95" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt","name":"asotest-eventhub-gdwlpt","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"westus2","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","partitionIds":["0"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt","name":"asotest-eventhub-gdwlpt","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"westus2","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2022-08-16T22:10:20.34","updatedAt":"2022-08-16T22:10:20.513","partitionIds":["0"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-eventhub-vprwhz","properties":{"rights":["Listen","Send"]}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "76" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/authorizationRules/asotest-eventhub-vprwhz?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/authorizationRules/asotest-eventhub-vprwhz","name":"asotest-eventhub-vprwhz","type":"Microsoft.EventHub/Namespaces/EventHubs/AuthorizationRules","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/authorizationRules/asotest-eventhub-vprwhz?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/authorizationrules/asotest-eventhub-vprwhz","name":"asotest-eventhub-vprwhz","type":"Microsoft.EventHub/Namespaces/EventHubs/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-eventhub-xcskfl","properties":{"userMetadata":"This is - some fun metadata"}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "92" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/consumergroups/asotest-eventhub-xcskfl?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/consumergroups/asotest-eventhub-xcskfl","name":"asotest-eventhub-xcskfl","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"westus2","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"This - is some fun metadata"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-eventhub-ehitov","properties":{"rights":["Listen","Send"]}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "76" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/authorizationRules/asotest-eventhub-ehitov?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/authorizationRules/asotest-eventhub-ehitov","name":"asotest-eventhub-ehitov","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"West - US 2","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/consumergroups/asotest-eventhub-xcskfl?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/consumergroups/asotest-eventhub-xcskfl","name":"asotest-eventhub-xcskfl","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"westus2","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"This - is some fun metadata"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/authorizationRules/asotest-eventhub-ehitov?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/authorizationRules/asotest-eventhub-ehitov","name":"asotest-eventhub-ehitov","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"West - US 2","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/authorizationRules/asotest-eventhub-vprwhz?api-version=2021-11-01 - method: DELETE - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/authorizationRules/asotest-eventhub-ehitov?api-version=2021-11-01 - method: DELETE - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/consumergroups/asotest-eventhub-xcskfl?api-version=2021-11-01 - method: DELETE - response: - body: '{"error":{"code":"MessagingGatewayTooManyRequests","message":"409Resource - Conflict Occurred. Another conflicting operation may be in progress. If this - is a retry for failed operation, background clean up is still pending. Try again - later. To know more visit https://aka.ms/sbResourceMgrExceptions. . TrackingId:30ecc974-5f8d-4088-ace7-aa7ef437e6c5_G4, - SystemTracker:asotest-namespace-omtjob:EventHub:asotest-eventhub-gdwlpt, Timestamp:2022-08-16T22:10:29"}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "502" - Content-Type: - - application/json - Expires: - - "-1" - Pragma: - - no-cache - Retry-After: - - "206" - Server: - - Microsoft-HTTPAPI/2.0 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - X-Content-Type-Options: - - nosniff - status: 429 Too Many Requests - code: 429 - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt/consumergroups/asotest-eventhub-xcskfl?api-version=2021-11-01 - method: DELETE - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Microsoft-HTTPAPI/2.0 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - X-Content-Type-Options: - - nosniff - status: 200 OK - code: 200 - duration: "" -- request: - body: '{"name":"asotest-eventhub-gdwlpt","properties":{"messageRetentionInDays":3,"partitionCount":1}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "95" - Content-Type: - - application/json - Test-Request-Attempt: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt","name":"asotest-eventhub-gdwlpt","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"westus2","properties":{"messageRetentionInDays":3,"partitionCount":1,"status":"Active","createdAt":"0001-01-01T00:00:00","updatedAt":"0001-01-01T00:00:00","partitionIds":[]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt","name":"asotest-eventhub-gdwlpt","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"westus2","properties":{"messageRetentionInDays":3,"partitionCount":1,"status":"Active","createdAt":"2022-08-16T22:10:20.34","updatedAt":"2022-08-16T22:13:22.84","partitionIds":["0"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/eventhubs/asotest-eventhub-gdwlpt?api-version=2021-11-01 - method: DELETE - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-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/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/operationresults/asotest-namespace-omtjob?api-version=2021-11-01 - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/CH3 - 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/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/operationresults/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Removing"}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "745" - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob/operationresults/asotest-namespace-omtjob?api-version=2021-11-01 - Pragma: - - no-cache - Retry-After: - - "54" - Server: - - Service-Bus-Resource-Provider/CH3 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/CH3 - 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: - - "7" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Removing"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "8" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Removing"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "9" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Removing"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "10" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob","name":"asotest-namespace-omtjob","type":"Microsoft.EventHub/Namespaces","location":"West - US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":true,"maximumThroughputUnits":2,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-omtjob","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-omtjob.servicebus.windows.net:443/","status":"Removing"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "11" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jrrrwl/providers/Microsoft.EventHub/namespaces/asotest-namespace-omtjob?api-version=2021-11-01 - method: GET - response: - body: '{"error":{"message":"Namespace does not exist. CorrelationId: 1bd944ab-401d-4420-9c2e-5539b7133c10","code":"NotFound"}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "119" - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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-jrrrwl?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKUlJSV0wtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Pragma: - - no-cache - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - X-Content-Type-Options: - - nosniff - status: 200 OK - code: 200 - duration: "" diff --git a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api_CreationAndDeletion.yaml b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api_CreationAndDeletion.yaml deleted file mode 100644 index 2a750d35c28..00000000000 --- a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api_CreationAndDeletion.yaml +++ /dev/null @@ -1,901 +0,0 @@ ---- -version: 1 -interactions: -- request: - body: '{"location":"westus2","name":"asotest-rg-epdyey","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-epdyey?api-version=2020-06-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey","name":"asotest-rg-epdyey","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-epdyey?api-version=2020-06-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey","name":"asotest-rg-epdyey","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: '{"location":"westcentralus","name":"asotestajtszi","sku":{"name":"Standard","tier":"Standard"}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "95" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi?api-version=2021-11-01 - method: PUT - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi","name":"asotestajtszi","type":"Microsoft.EventHub/Namespaces","location":"West - Central US","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestajtszi","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestajtszi.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: - - "49" - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi","name":"asotestajtszi","type":"Microsoft.EventHub/Namespaces","location":"West - Central US","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestajtszi","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestajtszi.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi","name":"asotestajtszi","type":"Microsoft.EventHub/Namespaces","location":"West - Central US","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestajtszi","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestajtszi.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi","name":"asotestajtszi","type":"Microsoft.EventHub/Namespaces","location":"West - Central US","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestajtszi","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestajtszi.servicebus.windows.net:443/","status":"Activating"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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: - - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi","name":"asotestajtszi","type":"Microsoft.EventHub/Namespaces","location":"West - Central US","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestajtszi","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestajtszi.servicebus.windows.net:443/","status":"Active"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi?api-version=2021-11-01 - method: GET - response: - body: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi","name":"asotestajtszi","type":"Microsoft.EventHub/Namespaces","location":"West - Central US","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestajtszi","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestajtszi.servicebus.windows.net:443/","status":"Active"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - Service-Bus-Resource-Provider/SN1 - - Microsoft-HTTPAPI/2.0 - Server-Sb: - - Service-Bus-Resource-Provider/SN1 - Strict-Transport-Security: - - max-age=31536000; includeSubDomains - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - status: 200 OK - code: 200 - duration: "" -- request: - body: '{"name":"asotestzczcxy","properties":{"messageRetentionInDays":7,"partitionCount":1}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "85" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy","name":"asotestzczcxy","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westcentralus","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","partitionIds":["0"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy","name":"asotestzczcxy","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westcentralus","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2023-03-23T23:16:08.453","updatedAt":"2023-03-23T23:16:08.57","partitionIds":["0"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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":"asotestkccfkn","properties":{"rights":["Listen","Send"]}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "66" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/authorizationRules/asotestkccfkn?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/authorizationRules/asotestkccfkn","name":"asotestkccfkn","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/authorizationRules/asotestkccfkn?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/authorizationrules/asotestkccfkn","name":"asotestkccfkn","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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":"asotestfmqpry","properties":{"rights":["Listen","Send"]}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "66" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/authorizationRules/asotestfmqpry?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/authorizationRules/asotestfmqpry","name":"asotestfmqpry","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/authorizationRules/asotestfmqpry?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/authorizationrules/asotestfmqpry","name":"asotestfmqpry","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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":"asotesthhwdlq","properties":{"userMetadata":"Some interesting - metadata"}}' - form: {} - headers: - Accept: - - application/json - Content-Length: - - "82" - Content-Type: - - application/json - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/consumergroups/asotesthhwdlq?api-version=2021-11-01 - method: PUT - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/consumergroups/asotesthhwdlq","name":"asotesthhwdlq","type":"Microsoft.EventHub/namespaces/eventhubs/consumergroups","location":"westcentralus","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"Some - interesting metadata"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/consumergroups/asotesthhwdlq?api-version=2021-11-01 - method: GET - response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/consumergroups/asotesthhwdlq","name":"asotesthhwdlq","type":"Microsoft.EventHub/namespaces/eventhubs/consumergroups","location":"westcentralus","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"Some - interesting metadata"}}' - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json; charset=utf-8 - Expires: - - "-1" - Pragma: - - no-cache - Server: - - 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-epdyey?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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: - Test-Request-Attempt: - - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRFUERZRVktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 - method: GET - response: - body: "" - headers: - Cache-Control: - - no-cache - Content-Length: - - "0" - Expires: - - "-1" - Pragma: - - no-cache - 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: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi?api-version=2021-11-01 - method: DELETE - response: - body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-epdyey'' - 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: "" -- 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy?api-version=2021-11-01 - method: DELETE - response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestajtszi'' not found."}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "154" - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/authorizationRules/asotestkccfkn?api-version=2021-11-01 - method: DELETE - response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestajtszi'' not found."}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "154" - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/authorizationRules/asotestfmqpry?api-version=2021-11-01 - method: DELETE - response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestajtszi/asotestzczcxy'' - not found."}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "168" - 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-epdyey/providers/Microsoft.EventHub/namespaces/asotestajtszi/eventhubs/asotestzczcxy/consumergroups/asotesthhwdlq?api-version=2021-11-01 - method: DELETE - response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestajtszi/asotestzczcxy'' - not found."}}' - headers: - Cache-Control: - - no-cache - Content-Length: - - "168" - 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/samples/eventhub/v1api/v1api20211101_namespace.yaml b/v2/samples/eventhub/v1api20211101/v1api20211101_namespace.yaml similarity index 100% rename from v2/samples/eventhub/v1api/v1api20211101_namespace.yaml rename to v2/samples/eventhub/v1api20211101/v1api20211101_namespace.yaml diff --git a/v2/samples/eventhub/v1api/v1api20211101_namespacesauthorizationrule.yaml b/v2/samples/eventhub/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml similarity index 100% rename from v2/samples/eventhub/v1api/v1api20211101_namespacesauthorizationrule.yaml rename to v2/samples/eventhub/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml diff --git a/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhub.yaml b/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhub.yaml similarity index 100% rename from v2/samples/eventhub/v1api/v1api20211101_namespaceseventhub.yaml rename to v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhub.yaml diff --git a/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsauthorizationrule.yaml b/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsauthorizationrule.yaml similarity index 100% rename from v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsauthorizationrule.yaml rename to v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsauthorizationrule.yaml diff --git a/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsconsumergroup.yaml b/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsconsumergroup.yaml similarity index 100% rename from v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsconsumergroup.yaml rename to v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsconsumergroup.yaml diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml new file mode 100644 index 00000000000..2ecf324e714 --- /dev/null +++ b/v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml @@ -0,0 +1,20 @@ +apiVersion: eventhub.azure.com/v1api20240101 +kind: Namespace +metadata: + name: aso-sample-namespace + namespace: default +spec: + location: westcentralus + owner: + name: aso-sample-rg + sku: + name: Standard + tier: Standard + operatorSpec: + secrets: + primaryKey: + name: my-secret + key: primary-key + primaryConnectionString: + name: my-secret + key: primary-connection-string diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml new file mode 100644 index 00000000000..d01efd513e5 --- /dev/null +++ b/v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml @@ -0,0 +1,19 @@ +apiVersion: eventhub.azure.com/v1api20240101 +kind: NamespacesAuthorizationRule +metadata: + name: sample-authrule + namespace: default +spec: + owner: + name: aso-sample-namespace + rights: + - Listen + - Send + operatorSpec: + secrets: + primaryKey: + name: my-ns-secret + key: primary-key + primaryConnectionString: + name: my-ns-secret + key: primary-connection-string \ No newline at end of file diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml new file mode 100644 index 00000000000..19927755eb0 --- /dev/null +++ b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml @@ -0,0 +1,10 @@ +apiVersion: eventhub.azure.com/v1api20240101 +kind: NamespacesEventhub +metadata: + name: sample-eventhub + namespace: default +spec: + owner: + name: aso-sample-namespace + messageRetentionInDays: 7 + partitionCount: 1 diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml new file mode 100644 index 00000000000..1f3fee6f50c --- /dev/null +++ b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml @@ -0,0 +1,19 @@ +apiVersion: eventhub.azure.com/v1api20240101 +kind: NamespacesEventhubsAuthorizationRule +metadata: + name: sample-eventhub-authrule + namespace: default +spec: + owner: + name: sample-eventhub + rights: + - Listen + - Send + operatorSpec: + secrets: + primaryKey: + name: my-eh-secret + key: primary-key + primaryConnectionString: + name: my-eh-secret + key: primary-connection-string \ No newline at end of file diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml new file mode 100644 index 00000000000..efb9e95f2c5 --- /dev/null +++ b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml @@ -0,0 +1,9 @@ +apiVersion: eventhub.azure.com/v1api20240101 +kind: NamespacesEventhubsConsumerGroup +metadata: + name: sample-consumergroup + namespace: default +spec: + owner: + name: sample-eventhub + userMetadata: Some interesting metadata From d8c837f2a9b2b6b65930e14c2febd3636071f0ee Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Wed, 20 Mar 2024 17:36:46 +1300 Subject: [PATCH 02/10] remove 2024-01-01 version --- docs/hugo/content/reference/_index.md | 26 +- .../hugo/content/reference/eventhub/_index.md | 26 +- .../customizations/namespace_extension.go | 2 +- .../namespace_extension_types_gen.go | 6 +- ...namespaces_authorization_rule_extension.go | 2 +- ..._authorization_rule_extension_types_gen.go | 6 +- ...namespaces_eventhub_extension_types_gen.go | 6 +- ..._eventhubs_authorization_rule_extension.go | 2 +- ..._authorization_rule_extension_types_gen.go | 6 +- ...hubs_consumer_group_extension_types_gen.go | 6 +- .../v1api20211101/namespace_types_gen.go | 270 +- .../v1api20211101/namespace_types_gen_test.go | 3 +- ...namespaces_authorization_rule_types_gen.go | 62 +- ...paces_authorization_rule_types_gen_test.go | 3 +- .../namespaces_eventhub_types_gen.go | 163 +- .../namespaces_eventhub_types_gen_test.go | 3 +- ..._eventhubs_authorization_rule_types_gen.go | 62 +- ...thubs_authorization_rule_types_gen_test.go | 3 +- ...aces_eventhubs_consumer_group_types_gen.go | 51 +- ...eventhubs_consumer_group_types_gen_test.go | 3 +- .../storage/namespace_types_gen.go | 2495 +---------- .../storage/namespace_types_gen_test.go | 866 +--- ...namespaces_authorization_rule_types_gen.go | 615 +-- ...paces_authorization_rule_types_gen_test.go | 254 -- .../storage/namespaces_eventhub_types_gen.go | 1019 +---- .../namespaces_eventhub_types_gen_test.go | 338 -- ..._eventhubs_authorization_rule_types_gen.go | 615 +-- ...thubs_authorization_rule_types_gen_test.go | 254 -- ...aces_eventhubs_consumer_group_types_gen.go | 405 +- ...eventhubs_consumer_group_types_gen_test.go | 170 - .../v1api20211101/storage/structure.txt | 91 +- v2/api/eventhub/v1api20240101/doc.go | 10 - .../v1api20240101/groupversion_info_gen.go | 32 - .../namespace_spec_arm_types_gen.go | 154 - .../namespace_spec_arm_types_gen_test.go | 587 --- .../namespace_status_arm_types_gen.go | 227 - .../namespace_status_arm_types_gen_test.go | 744 ---- .../v1api20240101/namespace_types_gen.go | 3811 ----------------- .../v1api20240101/namespace_types_gen_test.go | 2173 ---------- ...s_authorization_rule_spec_arm_types_gen.go | 35 - ...horization_rule_spec_arm_types_gen_test.go | 154 - ...authorization_rule_status_arm_types_gen.go | 30 - ...rization_rule_status_arm_types_gen_test.go | 158 - ...namespaces_authorization_rule_types_gen.go | 1021 ----- ...paces_authorization_rule_types_gen_test.go | 605 --- .../namespaces_eventhub_spec_arm_types_gen.go | 123 - ...spaces_eventhub_spec_arm_types_gen_test.go | 515 --- ...amespaces_eventhub_status_arm_types_gen.go | 135 - ...aces_eventhub_status_arm_types_gen_test.go | 533 --- .../namespaces_eventhub_types_gen.go | 2660 ------------ .../namespaces_eventhub_types_gen_test.go | 1322 ------ ...s_authorization_rule_spec_arm_types_gen.go | 35 - ...horization_rule_spec_arm_types_gen_test.go | 154 - ...authorization_rule_status_arm_types_gen.go | 30 - ...rization_rule_status_arm_types_gen_test.go | 158 - ..._eventhubs_authorization_rule_types_gen.go | 1021 ----- ...thubs_authorization_rule_types_gen_test.go | 605 --- ...aces_eventhubs_consumer_group_types_gen.go | 788 ---- ...eventhubs_consumer_group_types_gen_test.go | 393 -- ...nthubs_consumergroup_spec_arm_types_gen.go | 37 - ...s_consumergroup_spec_arm_types_gen_test.go | 154 - ...hubs_consumergroup_status_arm_types_gen.go | 38 - ...consumergroup_status_arm_types_gen_test.go | 160 - .../storage/groupversion_info_gen.go | 32 - .../storage/namespace_types_gen.go | 391 -- .../storage/namespace_types_gen_test.go | 1316 ------ ...namespaces_authorization_rule_types_gen.go | 228 - ...paces_authorization_rule_types_gen_test.go | 352 -- .../storage/namespaces_eventhub_types_gen.go | 313 -- .../namespaces_eventhub_types_gen_test.go | 808 ---- ..._eventhubs_authorization_rule_types_gen.go | 228 - ...thubs_authorization_rule_types_gen_test.go | 352 -- ...aces_eventhubs_consumer_group_types_gen.go | 213 - ...eventhubs_consumer_group_types_gen_test.go | 224 - .../v1api20240101/storage/structure.txt | 283 -- .../storage/zz_generated.deepcopy.go | 2082 --------- v2/api/eventhub/v1api20240101/structure.txt | 669 --- .../v1api20240101/zz_generated.deepcopy.go | 3318 -------------- v2/api/eventhub/versions_matrix.md | 142 +- v2/azure-arm.yaml | 43 - .../controllers/controller_resources_gen.go | 28 +- .../crd_eventhub_namespace_20240101_test.go | 257 -- ...hub_v1api20211101_CreationAndDeletion.yaml | 1627 +++++++ .../v1api20240101_namespace.yaml | 20 - ...i20240101_namespacesauthorizationrule.yaml | 19 - .../v1api20240101_namespaceseventhub.yaml | 10 - ..._namespaceseventhubsauthorizationrule.yaml | 19 - ...0101_namespaceseventhubsconsumergroup.yaml | 9 - 88 files changed, 2460 insertions(+), 36958 deletions(-) delete mode 100644 v2/api/eventhub/v1api20240101/doc.go delete mode 100644 v2/api/eventhub/v1api20240101/groupversion_info_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespace_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespace_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespace_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go delete mode 100644 v2/api/eventhub/v1api20240101/storage/structure.txt delete mode 100644 v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go delete mode 100644 v2/api/eventhub/v1api20240101/structure.txt delete mode 100644 v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go delete mode 100644 v2/internal/controllers/crd_eventhub_namespace_20240101_test.go create mode 100644 v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api20211101_CreationAndDeletion.yaml delete mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml delete mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml delete mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml delete mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml delete mode 100644 v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index 56765cdb339..e567acfb06a 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -387,29 +387,17 @@ These resource(s) are available for use in the current release of ASO. Different To install the CRDs for these resources, your ASO configuration must include `eventhub.azure.com/*` as a one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations. -### Next Release - -Development of these new resources is complete and they will be available in the next release of ASO. - -| Resource | ARM Version | CRD Version | Supported From | Sample | -|--------------------------------------|-------------|---------------|----------------|--------| -| Namespace | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesEventhub | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesEventhubsAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesEventhubsConsumerGroup | 2024-01-01 | v1api20240101 | v2.7.0 | - | - ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. -| Resource | ARM Version | CRD Version | Supported From | Sample | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|---------------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| -| [Namespace](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.Namespace) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespace.yaml) | -| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespacesauthorizationrule.yaml) | -| [NamespacesEventhub](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhub) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhub.yaml) | -| [NamespacesEventhubsAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsauthorizationrule.yaml) | -| [NamespacesEventhubsConsumerGroup](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsConsumerGroup) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsconsumergroup.yaml) | +| Resource | ARM Version | CRD Version | Supported From | Sample | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|---------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Namespace](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.Namespace) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespace.yaml) | +| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml) | +| [NamespacesEventhub](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhub) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhub.yaml) | +| [NamespacesEventhubsAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsauthorizationrule.yaml) | +| [NamespacesEventhubsConsumerGroup](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsConsumerGroup) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsconsumergroup.yaml) | ## Insights diff --git a/docs/hugo/content/reference/eventhub/_index.md b/docs/hugo/content/reference/eventhub/_index.md index 2ae1e949d5c..c58de7742ed 100644 --- a/docs/hugo/content/reference/eventhub/_index.md +++ b/docs/hugo/content/reference/eventhub/_index.md @@ -5,27 +5,15 @@ no_list: true --- To install the CRDs for these resources, your ASO configuration must include `eventhub.azure.com/*` as a one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations. -### Next Release - -Development of these new resources is complete and they will be available in the next release of ASO. - -| Resource | ARM Version | CRD Version | Supported From | Sample | -|--------------------------------------|-------------|---------------|----------------|--------| -| Namespace | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesEventhub | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesEventhubsAuthorizationRule | 2024-01-01 | v1api20240101 | v2.7.0 | - | -| NamespacesEventhubsConsumerGroup | 2024-01-01 | v1api20240101 | v2.7.0 | - | - ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. -| Resource | ARM Version | CRD Version | Supported From | Sample | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|---------------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| -| [Namespace](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.Namespace) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespace.yaml) | -| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespacesauthorizationrule.yaml) | -| [NamespacesEventhub](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhub) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhub.yaml) | -| [NamespacesEventhubsAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsauthorizationrule.yaml) | -| [NamespacesEventhubsConsumerGroup](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsConsumerGroup) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api/v1api20211101_namespaceseventhubsconsumergroup.yaml) | +| Resource | ARM Version | CRD Version | Supported From | Sample | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|---------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Namespace](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.Namespace) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespace.yaml) | +| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml) | +| [NamespacesEventhub](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhub) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhub.yaml) | +| [NamespacesEventhubsAuthorizationRule](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsAuthorizationRule) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsauthorizationrule.yaml) | +| [NamespacesEventhubsConsumerGroup](https://azure.github.io/azure-service-operator/reference/eventhub/v1api20211101/#eventhub.azure.com/v1api20211101.NamespacesEventhubsConsumerGroup) | 2021-11-01 | v1api20211101 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/eventhub/v1api20211101/v1api20211101_namespaceseventhubsconsumergroup.yaml) | diff --git a/v2/api/eventhub/customizations/namespace_extension.go b/v2/api/eventhub/customizations/namespace_extension.go index d2e9e39b7d6..fe412313e04 100644 --- a/v2/api/eventhub/customizations/namespace_extension.go +++ b/v2/api/eventhub/customizations/namespace_extension.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/conversion" - "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" "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" diff --git a/v2/api/eventhub/customizations/namespace_extension_types_gen.go b/v2/api/eventhub/customizations/namespace_extension_types_gen.go index 042ff7939bf..b83e3d7878c 100644 --- a/v2/api/eventhub/customizations/namespace_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespace_extension_types_gen.go @@ -6,8 +6,6 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -18,7 +16,5 @@ type NamespaceExtension struct { func (extension *NamespaceExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.Namespace{}, - &v20211101s.Namespace{}, - &v20240101.Namespace{}, - &v20240101s.Namespace{}} + &v20211101s.Namespace{}} } diff --git a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go index 54c84522118..238e51fef0c 100644 --- a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go +++ b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/conversion" - "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" "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" diff --git a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go index befcc3cd3f8..a625e2fdacc 100644 --- a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension_types_gen.go @@ -6,8 +6,6 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -18,7 +16,5 @@ type NamespacesAuthorizationRuleExtension struct { func (extension *NamespacesAuthorizationRuleExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesAuthorizationRule{}, - &v20211101s.NamespacesAuthorizationRule{}, - &v20240101.NamespacesAuthorizationRule{}, - &v20240101s.NamespacesAuthorizationRule{}} + &v20211101s.NamespacesAuthorizationRule{}} } diff --git a/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go index 59dbe19a9a4..51d80422dc9 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_eventhub_extension_types_gen.go @@ -6,8 +6,6 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -18,7 +16,5 @@ type NamespacesEventhubExtension struct { func (extension *NamespacesEventhubExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesEventhub{}, - &v20211101s.NamespacesEventhub{}, - &v20240101.NamespacesEventhub{}, - &v20240101s.NamespacesEventhub{}} + &v20211101s.NamespacesEventhub{}} } diff --git a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go index 22557311c01..3ed2db41733 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go +++ b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/conversion" - "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" "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" diff --git a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go index 85c5785440e..06a7276a861 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension_types_gen.go @@ -6,8 +6,6 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -18,7 +16,5 @@ type NamespacesEventhubsAuthorizationRuleExtension struct { func (extension *NamespacesEventhubsAuthorizationRuleExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesEventhubsAuthorizationRule{}, - &v20211101s.NamespacesEventhubsAuthorizationRule{}, - &v20240101.NamespacesEventhubsAuthorizationRule{}, - &v20240101s.NamespacesEventhubsAuthorizationRule{}} + &v20211101s.NamespacesEventhubsAuthorizationRule{}} } diff --git a/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go b/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go index 8d8b70ce884..6c071470275 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go +++ b/v2/api/eventhub/customizations/namespaces_eventhubs_consumer_group_extension_types_gen.go @@ -6,8 +6,6 @@ package customizations import ( v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -18,7 +16,5 @@ type NamespacesEventhubsConsumerGroupExtension struct { func (extension *NamespacesEventhubsConsumerGroupExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20211101.NamespacesEventhubsConsumerGroup{}, - &v20211101s.NamespacesEventhubsConsumerGroup{}, - &v20240101.NamespacesEventhubsConsumerGroup{}, - &v20240101s.NamespacesEventhubsConsumerGroup{}} + &v20211101s.NamespacesEventhubsConsumerGroup{}} } diff --git a/v2/api/eventhub/v1api20211101/namespace_types_gen.go b/v2/api/eventhub/v1api20211101/namespace_types_gen.go index d0054136bef..4f6d7cd8414 100644 --- a/v2/api/eventhub/v1api20211101/namespace_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespace_types_gen.go @@ -49,36 +49,22 @@ var _ conversion.Convertible = &Namespace{} // ConvertFrom populates our Namespace from the provided hub Namespace func (namespace *Namespace) ConvertFrom(hub conversion.Hub) error { - // intermediate variable for conversion - var source v20211101s.Namespace - - err := source.ConvertFrom(hub) - if err != nil { - return errors.Wrap(err, "converting from hub to source") - } - - err = namespace.AssignProperties_From_Namespace(&source) - if err != nil { - return errors.Wrap(err, "converting from source to namespace") + source, ok := hub.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/Namespace but received %T instead", hub) } - return nil + return namespace.AssignProperties_From_Namespace(source) } // ConvertTo populates the provided hub Namespace from our Namespace func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { - // intermediate variable for conversion - var destination v20211101s.Namespace - err := namespace.AssignProperties_To_Namespace(&destination) - if err != nil { - return errors.Wrap(err, "converting to destination from namespace") - } - err = destination.ConvertTo(hub) - if err != nil { - return errors.Wrap(err, "converting from destination to hub") + destination, ok := hub.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/Namespace but received %T instead", hub) } - return nil + return namespace.AssignProperties_To_Namespace(destination) } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaces,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaces.eventhub.azure.com,admissionReviewVersions=v1 @@ -104,6 +90,17 @@ func (namespace *Namespace) defaultAzureName() { // defaultImpl applies the code generated defaults to the Namespace resource func (namespace *Namespace) defaultImpl() { namespace.defaultAzureName() } +var _ genruntime.ImportableResource = &Namespace{} + +// InitializeSpec initializes the spec for this resource from the given status +func (namespace *Namespace) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespace_STATUS); ok { + return namespace.Spec.Initialize_From_Namespace_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespace_STATUS but received %T instead", status) +} + var _ genruntime.KubernetesResource = &Namespace{} // AzureName returns the Azure name of the resource @@ -939,6 +936,101 @@ func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination return nil } +// Initialize_From_Namespace_STATUS populates our Namespace_Spec from the provided source Namespace_STATUS +func (namespace *Namespace_Spec) Initialize_From_Namespace_STATUS(source *Namespace_STATUS) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // ClusterArmReference + if source.ClusterArmId != nil { + clusterArmReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterArmId) + namespace.ClusterArmReference = &clusterArmReference + } else { + namespace.ClusterArmReference = nil + } + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + disableLocalAuth := *source.DisableLocalAuth + namespace.DisableLocalAuth = &disableLocalAuth + } else { + namespace.DisableLocalAuth = nil + } + + // Encryption + if source.Encryption != nil { + var encryption Encryption + err := encryption.Initialize_From_Encryption_STATUS(source.Encryption) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Encryption_STATUS() to populate field Encryption") + } + namespace.Encryption = &encryption + } else { + namespace.Encryption = nil + } + + // Identity + if source.Identity != nil { + var identity Identity + err := identity.Initialize_From_Identity_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Identity_STATUS() to populate field Identity") + } + namespace.Identity = &identity + } else { + namespace.Identity = nil + } + + // IsAutoInflateEnabled + if source.IsAutoInflateEnabled != nil { + isAutoInflateEnabled := *source.IsAutoInflateEnabled + namespace.IsAutoInflateEnabled = &isAutoInflateEnabled + } else { + namespace.IsAutoInflateEnabled = nil + } + + // KafkaEnabled + if source.KafkaEnabled != nil { + kafkaEnabled := *source.KafkaEnabled + namespace.KafkaEnabled = &kafkaEnabled + } else { + namespace.KafkaEnabled = nil + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MaximumThroughputUnits + namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) + + // Sku + if source.Sku != nil { + var sku Sku + err := sku.Initialize_From_Sku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Sku_STATUS() to populate field Sku") + } + namespace.Sku = &sku + } else { + namespace.Sku = nil + } + + // Tags + namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) + + // ZoneRedundant + if source.ZoneRedundant != nil { + zoneRedundant := *source.ZoneRedundant + namespace.ZoneRedundant = &zoneRedundant + } else { + namespace.ZoneRedundant = nil + } + + // No error + return nil +} + // OriginalVersion returns the original API version used to create the resource. func (namespace *Namespace_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1784,6 +1876,47 @@ func (encryption *Encryption) AssignProperties_To_Encryption(destination *v20211 return nil } +// Initialize_From_Encryption_STATUS populates our Encryption from the provided source Encryption_STATUS +func (encryption *Encryption) Initialize_From_Encryption_STATUS(source *Encryption_STATUS) error { + + // KeySource + if source.KeySource != nil { + keySource := Encryption_KeySource(*source.KeySource) + encryption.KeySource = &keySource + } else { + encryption.KeySource = nil + } + + // KeyVaultProperties + if source.KeyVaultProperties != nil { + keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty KeyVaultProperties + err := keyVaultProperty.Initialize_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") + } + keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty + } + encryption.KeyVaultProperties = keyVaultPropertyList + } else { + encryption.KeyVaultProperties = nil + } + + // RequireInfrastructureEncryption + if source.RequireInfrastructureEncryption != nil { + requireInfrastructureEncryption := *source.RequireInfrastructureEncryption + encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption + } else { + encryption.RequireInfrastructureEncryption = nil + } + + // No error + return nil +} + // Properties to configure Encryption type Encryption_STATUS struct { // KeySource: Enumerates the possible value of keySource for Encryption @@ -2063,6 +2196,33 @@ func (identity *Identity) AssignProperties_To_Identity(destination *v20211101s.I return nil } +// Initialize_From_Identity_STATUS populates our Identity from the provided source Identity_STATUS +func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error { + + // Type + if source.Type != nil { + typeVar := Identity_Type(*source.Type) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities)) + for userAssignedIdentitiesKey := range source.UserAssignedIdentities { + userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey) + userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef}) + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + // Properties to configure Identity for Bring your Own Keys type Identity_STATUS struct { // PrincipalId: ObjectId from the KeyVault @@ -2476,6 +2636,37 @@ func (sku *Sku) AssignProperties_To_Sku(destination *v20211101s.Sku) error { return nil } +// Initialize_From_Sku_STATUS populates our Sku from the provided source Sku_STATUS +func (sku *Sku) Initialize_From_Sku_STATUS(source *Sku_STATUS) error { + + // Capacity + if source.Capacity != nil { + capacity := *source.Capacity + sku.Capacity = &capacity + } else { + sku.Capacity = nil + } + + // Name + if source.Name != nil { + name := Sku_Name(*source.Name) + sku.Name = &name + } else { + sku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := Sku_Tier(*source.Tier) + sku.Tier = &tier + } else { + sku.Tier = nil + } + + // No error + return nil +} + // SKU parameters supplied to the create namespace operation type Sku_STATUS struct { // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. @@ -2912,6 +3103,34 @@ func (properties *KeyVaultProperties) AssignProperties_To_KeyVaultProperties(des return nil } +// Initialize_From_KeyVaultProperties_STATUS populates our KeyVaultProperties from the provided source KeyVaultProperties_STATUS +func (properties *KeyVaultProperties) Initialize_From_KeyVaultProperties_STATUS(source *KeyVaultProperties_STATUS) error { + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties + err := identity.Initialize_From_UserAssignedIdentityProperties_STATUS(source.Identity) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") + } + properties.Identity = &identity + } else { + properties.Identity = nil + } + + // KeyName + properties.KeyName = genruntime.ClonePointerToString(source.KeyName) + + // KeyVaultUri + properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) + + // KeyVersion + properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) + + // No error + return nil +} + // Properties to configure keyVault Properties type KeyVaultProperties_STATUS struct { Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` @@ -3334,6 +3553,13 @@ func (properties *UserAssignedIdentityProperties) AssignProperties_To_UserAssign return nil } +// Initialize_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties_STATUS +func (properties *UserAssignedIdentityProperties) Initialize_From_UserAssignedIdentityProperties_STATUS(source *UserAssignedIdentityProperties_STATUS) error { + + // No error + return nil +} + type UserAssignedIdentityProperties_STATUS struct { // UserAssignedIdentity: ARM ID of user Identity selected for encryption UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` diff --git a/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go index 9d7d49712d1..a2fa8cf6637 100644 --- a/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespace_types_gen_test.go @@ -6,7 +6,6 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +36,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub v20240101s.Namespace + var hub v20211101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go index 2cdabf3fa14..096a19e9ffa 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen.go @@ -49,36 +49,22 @@ var _ conversion.Convertible = &NamespacesAuthorizationRule{} // ConvertFrom populates our NamespacesAuthorizationRule from the provided hub NamespacesAuthorizationRule func (rule *NamespacesAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - // intermediate variable for conversion - var source v20211101s.NamespacesAuthorizationRule - - err := source.ConvertFrom(hub) - if err != nil { - return errors.Wrap(err, "converting from hub to source") - } - - err = rule.AssignProperties_From_NamespacesAuthorizationRule(&source) - if err != nil { - return errors.Wrap(err, "converting from source to rule") + source, ok := hub.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) } - return nil + return rule.AssignProperties_From_NamespacesAuthorizationRule(source) } // ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { - // intermediate variable for conversion - var destination v20211101s.NamespacesAuthorizationRule - err := rule.AssignProperties_To_NamespacesAuthorizationRule(&destination) - if err != nil { - return errors.Wrap(err, "converting to destination from rule") - } - err = destination.ConvertTo(hub) - if err != nil { - return errors.Wrap(err, "converting from destination to hub") + destination, ok := hub.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) } - return nil + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespacesauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 @@ -104,6 +90,17 @@ func (rule *NamespacesAuthorizationRule) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesAuthorizationRule resource func (rule *NamespacesAuthorizationRule) defaultImpl() { rule.defaultAzureName() } +var _ genruntime.ImportableResource = &NamespacesAuthorizationRule{} + +// InitializeSpec initializes the spec for this resource from the given status +func (rule *NamespacesAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { + return rule.Spec.Initialize_From_Namespaces_AuthorizationRule_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_AuthorizationRule_STATUS but received %T instead", status) +} + var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -573,6 +570,27 @@ func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_Au return nil } +// Initialize_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_STATUS +func (rule *Namespaces_AuthorizationRule_Spec) Initialize_From_Namespaces_AuthorizationRule_STATUS(source *Namespaces_AuthorizationRule_STATUS) error { + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + right := Namespaces_AuthorizationRule_Properties_Rights_Spec(rightItem) + rightList[rightIndex] = right + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // No error + return nil +} + // OriginalVersion returns the original API version used to create the resource. func (rule *Namespaces_AuthorizationRule_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go index c365e980caa..0e000b88853 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_authorization_rule_types_gen_test.go @@ -6,7 +6,6 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +36,7 @@ func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Convert to our hub version - var hub v20240101s.NamespacesAuthorizationRule + var hub v20211101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go index 75057a677ff..5ade92cd52f 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen.go @@ -49,36 +49,22 @@ var _ conversion.Convertible = &NamespacesEventhub{} // ConvertFrom populates our NamespacesEventhub from the provided hub NamespacesEventhub func (eventhub *NamespacesEventhub) ConvertFrom(hub conversion.Hub) error { - // intermediate variable for conversion - var source v20211101s.NamespacesEventhub - - err := source.ConvertFrom(hub) - if err != nil { - return errors.Wrap(err, "converting from hub to source") - } - - err = eventhub.AssignProperties_From_NamespacesEventhub(&source) - if err != nil { - return errors.Wrap(err, "converting from source to eventhub") + source, ok := hub.(*v20211101s.NamespacesEventhub) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhub but received %T instead", hub) } - return nil + return eventhub.AssignProperties_From_NamespacesEventhub(source) } // ConvertTo populates the provided hub NamespacesEventhub from our NamespacesEventhub func (eventhub *NamespacesEventhub) ConvertTo(hub conversion.Hub) error { - // intermediate variable for conversion - var destination v20211101s.NamespacesEventhub - err := eventhub.AssignProperties_To_NamespacesEventhub(&destination) - if err != nil { - return errors.Wrap(err, "converting to destination from eventhub") - } - err = destination.ConvertTo(hub) - if err != nil { - return errors.Wrap(err, "converting from destination to hub") + destination, ok := hub.(*v20211101s.NamespacesEventhub) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhub but received %T instead", hub) } - return nil + return eventhub.AssignProperties_To_NamespacesEventhub(destination) } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespaceseventhub,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaceseventhubs.eventhub.azure.com,admissionReviewVersions=v1 @@ -104,6 +90,17 @@ func (eventhub *NamespacesEventhub) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesEventhub resource func (eventhub *NamespacesEventhub) defaultImpl() { eventhub.defaultAzureName() } +var _ genruntime.ImportableResource = &NamespacesEventhub{} + +// InitializeSpec initializes the spec for this resource from the given status +func (eventhub *NamespacesEventhub) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Eventhub_STATUS); ok { + return eventhub.Spec.Initialize_From_Namespaces_Eventhub_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Eventhub_STATUS but received %T instead", status) +} + var _ genruntime.KubernetesResource = &NamespacesEventhub{} // AzureName returns the Azure name of the resource @@ -600,6 +597,41 @@ func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_To_Namespaces_Eventhu return nil } +// Initialize_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_STATUS +func (eventhub *Namespaces_Eventhub_Spec) Initialize_From_Namespaces_Eventhub_STATUS(source *Namespaces_Eventhub_STATUS) error { + + // CaptureDescription + if source.CaptureDescription != nil { + var captureDescription CaptureDescription + err := captureDescription.Initialize_From_CaptureDescription_STATUS(source.CaptureDescription) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_CaptureDescription_STATUS() to populate field CaptureDescription") + } + eventhub.CaptureDescription = &captureDescription + } else { + eventhub.CaptureDescription = nil + } + + // MessageRetentionInDays + if source.MessageRetentionInDays != nil { + messageRetentionInDay := *source.MessageRetentionInDays + eventhub.MessageRetentionInDays = &messageRetentionInDay + } else { + eventhub.MessageRetentionInDays = nil + } + + // PartitionCount + if source.PartitionCount != nil { + partitionCount := *source.PartitionCount + eventhub.PartitionCount = &partitionCount + } else { + eventhub.PartitionCount = nil + } + + // No error + return nil +} + // OriginalVersion returns the original API version used to create the resource. func (eventhub *Namespaces_Eventhub_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1210,6 +1242,55 @@ func (description *CaptureDescription) AssignProperties_To_CaptureDescription(de return nil } +// Initialize_From_CaptureDescription_STATUS populates our CaptureDescription from the provided source CaptureDescription_STATUS +func (description *CaptureDescription) Initialize_From_CaptureDescription_STATUS(source *CaptureDescription_STATUS) error { + + // Destination + if source.Destination != nil { + var destination Destination + err := destination.Initialize_From_Destination_STATUS(source.Destination) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Destination_STATUS() to populate field Destination") + } + description.Destination = &destination + } else { + description.Destination = nil + } + + // Enabled + if source.Enabled != nil { + enabled := *source.Enabled + description.Enabled = &enabled + } else { + description.Enabled = nil + } + + // Encoding + if source.Encoding != nil { + encoding := CaptureDescription_Encoding(*source.Encoding) + description.Encoding = &encoding + } else { + description.Encoding = nil + } + + // IntervalInSeconds + description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) + + // SizeLimitInBytes + description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) + + // SkipEmptyArchives + if source.SkipEmptyArchives != nil { + skipEmptyArchive := *source.SkipEmptyArchives + description.SkipEmptyArchives = &skipEmptyArchive + } else { + description.SkipEmptyArchives = nil + } + + // No error + return nil +} + // Properties to configure capture description for eventhub type CaptureDescription_STATUS struct { // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) @@ -1665,6 +1746,44 @@ func (destination *Destination) AssignProperties_To_Destination(target *v2021110 return nil } +// Initialize_From_Destination_STATUS populates our Destination from the provided source Destination_STATUS +func (destination *Destination) Initialize_From_Destination_STATUS(source *Destination_STATUS) error { + + // ArchiveNameFormat + destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) + + // BlobContainer + destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) + + // DataLakeAccountName + destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) + + // DataLakeFolderPath + destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) + + // DataLakeSubscriptionId + if source.DataLakeSubscriptionId != nil { + dataLakeSubscriptionId := *source.DataLakeSubscriptionId + destination.DataLakeSubscriptionId = &dataLakeSubscriptionId + } else { + destination.DataLakeSubscriptionId = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(source.Name) + + // StorageAccountResourceReference + if source.StorageAccountResourceId != nil { + storageAccountResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.StorageAccountResourceId) + destination.StorageAccountResourceReference = &storageAccountResourceReference + } else { + destination.StorageAccountResourceReference = nil + } + + // No error + return nil +} + // Capture storage details for capture description type Destination_STATUS struct { // ArchiveNameFormat: Blob naming convention for archive, e.g. diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go index 56072f5e24b..c470b6c6d38 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhub_types_gen_test.go @@ -6,7 +6,6 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +36,7 @@ func RunResourceConversionTestForNamespacesEventhub(subject NamespacesEventhub) copied := subject.DeepCopy() // Convert to our hub version - var hub v20240101s.NamespacesEventhub + var hub v20211101s.NamespacesEventhub err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go index 9a7eb06e4f8..274c6c1f6b5 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen.go @@ -49,36 +49,22 @@ var _ conversion.Convertible = &NamespacesEventhubsAuthorizationRule{} // ConvertFrom populates our NamespacesEventhubsAuthorizationRule from the provided hub NamespacesEventhubsAuthorizationRule func (rule *NamespacesEventhubsAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - // intermediate variable for conversion - var source v20211101s.NamespacesEventhubsAuthorizationRule - - err := source.ConvertFrom(hub) - if err != nil { - return errors.Wrap(err, "converting from hub to source") - } - - err = rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(&source) - if err != nil { - return errors.Wrap(err, "converting from source to rule") + source, ok := hub.(*v20211101s.NamespacesEventhubsAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) } - return nil + return rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(source) } // ConvertTo populates the provided hub NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule func (rule *NamespacesEventhubsAuthorizationRule) ConvertTo(hub conversion.Hub) error { - // intermediate variable for conversion - var destination v20211101s.NamespacesEventhubsAuthorizationRule - err := rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(&destination) - if err != nil { - return errors.Wrap(err, "converting to destination from rule") - } - err = destination.ConvertTo(hub) - if err != nil { - return errors.Wrap(err, "converting from destination to hub") + destination, ok := hub.(*v20211101s.NamespacesEventhubsAuthorizationRule) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) } - return nil + return rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination) } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespaceseventhubsauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaceseventhubsauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 @@ -104,6 +90,17 @@ func (rule *NamespacesEventhubsAuthorizationRule) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesEventhubsAuthorizationRule resource func (rule *NamespacesEventhubsAuthorizationRule) defaultImpl() { rule.defaultAzureName() } +var _ genruntime.ImportableResource = &NamespacesEventhubsAuthorizationRule{} + +// InitializeSpec initializes the spec for this resource from the given status +func (rule *NamespacesEventhubsAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { + return rule.Spec.Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Eventhubs_AuthorizationRule_STATUS but received %T instead", status) +} + var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -573,6 +570,27 @@ func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_To_Nam return nil } +// Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS +func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *Namespaces_Eventhubs_AuthorizationRule_STATUS) error { + + // Rights + if source.Rights != nil { + rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) + for rightIndex, rightItem := range source.Rights { + // Shadow the loop variable to avoid aliasing + rightItem := rightItem + right := Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec(rightItem) + rightList[rightIndex] = right + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // No error + return nil +} + // OriginalVersion returns the original API version used to create the resource. func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go index 3baf1f796c1..a7dd700472d 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_authorization_rule_types_gen_test.go @@ -6,7 +6,6 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +36,7 @@ func RunResourceConversionTestForNamespacesEventhubsAuthorizationRule(subject Na copied := subject.DeepCopy() // Convert to our hub version - var hub v20240101s.NamespacesEventhubsAuthorizationRule + var hub v20211101s.NamespacesEventhubsAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go index 8a06488b5aa..80d5b7f0094 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen.go @@ -49,36 +49,22 @@ var _ conversion.Convertible = &NamespacesEventhubsConsumerGroup{} // ConvertFrom populates our NamespacesEventhubsConsumerGroup from the provided hub NamespacesEventhubsConsumerGroup func (group *NamespacesEventhubsConsumerGroup) ConvertFrom(hub conversion.Hub) error { - // intermediate variable for conversion - var source v20211101s.NamespacesEventhubsConsumerGroup - - err := source.ConvertFrom(hub) - if err != nil { - return errors.Wrap(err, "converting from hub to source") - } - - err = group.AssignProperties_From_NamespacesEventhubsConsumerGroup(&source) - if err != nil { - return errors.Wrap(err, "converting from source to group") + source, ok := hub.(*v20211101s.NamespacesEventhubsConsumerGroup) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) } - return nil + return group.AssignProperties_From_NamespacesEventhubsConsumerGroup(source) } // ConvertTo populates the provided hub NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup func (group *NamespacesEventhubsConsumerGroup) ConvertTo(hub conversion.Hub) error { - // intermediate variable for conversion - var destination v20211101s.NamespacesEventhubsConsumerGroup - err := group.AssignProperties_To_NamespacesEventhubsConsumerGroup(&destination) - if err != nil { - return errors.Wrap(err, "converting to destination from group") - } - err = destination.ConvertTo(hub) - if err != nil { - return errors.Wrap(err, "converting from destination to hub") + destination, ok := hub.(*v20211101s.NamespacesEventhubsConsumerGroup) + if !ok { + return fmt.Errorf("expected eventhub/v1api20211101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) } - return nil + return group.AssignProperties_To_NamespacesEventhubsConsumerGroup(destination) } // +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20211101-namespaceseventhubsconsumergroup,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaceseventhubsconsumergroups.eventhub.azure.com,admissionReviewVersions=v1 @@ -104,6 +90,17 @@ func (group *NamespacesEventhubsConsumerGroup) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesEventhubsConsumerGroup resource func (group *NamespacesEventhubsConsumerGroup) defaultImpl() { group.defaultAzureName() } +var _ genruntime.ImportableResource = &NamespacesEventhubsConsumerGroup{} + +// InitializeSpec initializes the spec for this resource from the given status +func (group *NamespacesEventhubsConsumerGroup) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { + return group.Spec.Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Eventhubs_Consumergroup_STATUS but received %T instead", status) +} + var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} // AzureName returns the Azure name of the resource @@ -507,6 +504,16 @@ func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_T return nil } +// Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_STATUS +func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *Namespaces_Eventhubs_Consumergroup_STATUS) error { + + // UserMetadata + consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) + + // No error + return nil +} + // OriginalVersion returns the original API version used to create the resource. func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go index 23986396ec5..ff0a3ab57ed 100644 --- a/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/namespaces_eventhubs_consumer_group_types_gen_test.go @@ -6,7 +6,6 @@ package v1api20211101 import ( "encoding/json" v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +36,7 @@ func RunResourceConversionTestForNamespacesEventhubsConsumerGroup(subject Namesp copied := subject.DeepCopy() // Convert to our hub version - var hub v20240101s.NamespacesEventhubsConsumerGroup + var hub v20211101s.NamespacesEventhubsConsumerGroup err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go index a913c2cf6fa..d6948ea1550 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen.go @@ -4,18 +4,19 @@ package storage import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaces,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaces/status,namespaces/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" @@ -43,28 +44,6 @@ func (namespace *Namespace) SetConditions(conditions conditions.Conditions) { namespace.Status.Conditions = conditions } -var _ conversion.Convertible = &Namespace{} - -// ConvertFrom populates our Namespace from the provided hub Namespace -func (namespace *Namespace) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.Namespace) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) - } - - return namespace.AssignProperties_From_Namespace(source) -} - -// ConvertTo populates the provided hub Namespace from our Namespace -func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.Namespace) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) - } - - return namespace.AssignProperties_To_Namespace(destination) -} - var _ genruntime.KubernetesResource = &Namespace{} // AzureName returns the Azure name of the resource @@ -136,75 +115,8 @@ func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error return nil } -// AssignProperties_From_Namespace populates our Namespace from the provided source Namespace -func (namespace *Namespace) AssignProperties_From_Namespace(source *v20240101s.Namespace) error { - - // ObjectMeta - namespace.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespace_Spec - err := spec.AssignProperties_From_Namespace_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespace_Spec() to populate field Spec") - } - namespace.Spec = spec - - // Status - var status Namespace_STATUS - err = status.AssignProperties_From_Namespace_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespace_STATUS() to populate field Status") - } - namespace.Status = status - - // Invoke the augmentConversionForNamespace interface (if implemented) to customize the conversion - var namespaceAsAny any = namespace - if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace); ok { - err := augmentedNamespace.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespace populates the provided destination Namespace from our Namespace -func (namespace *Namespace) AssignProperties_To_Namespace(destination *v20240101s.Namespace) error { - - // ObjectMeta - destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespace_Spec - err := namespace.Spec.AssignProperties_To_Namespace_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespace_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespace_STATUS - err = namespace.Status.AssignProperties_To_Namespace_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespace_STATUS() to populate field Status") - } - destination.Status = status - - // Invoke the augmentConversionForNamespace interface (if implemented) to customize the conversion - var namespaceAsAny any = namespace - if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace); ok { - err := augmentedNamespace.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} +// Hub marks that this Namespace is the hub type for conversion +func (namespace *Namespace) Hub() {} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { @@ -232,11 +144,6 @@ type APIVersion string const APIVersion_Value = APIVersion("2021-11-01") -type augmentConversionForNamespace interface { - AssignPropertiesFrom(src *v20240101s.Namespace) error - AssignPropertiesTo(dst *v20240101s.Namespace) error -} - // Storage version of v1api20211101.Namespace_Spec type Namespace_Spec struct { AlternateName *string `json:"alternateName,omitempty"` @@ -272,368 +179,20 @@ var _ genruntime.ConvertibleSpec = &Namespace_Spec{} // ConvertSpecFrom populates our Namespace_Spec from the provided source func (namespace *Namespace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespace_Spec) - if ok { - // Populate our instance from source - return namespace.AssignProperties_From_Namespace_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespace_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + if source == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // Update our instance from src - err = namespace.AssignProperties_From_Namespace_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil + return source.ConvertSpecTo(namespace) } // ConvertSpecTo populates the provided destination from our Namespace_Spec func (namespace *Namespace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespace_Spec) - if ok { - // Populate destination from our instance - return namespace.AssignProperties_To_Namespace_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespace_Spec{} - err := namespace.AssignProperties_To_Namespace_Spec(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 -} - -// AssignProperties_From_Namespace_Spec populates our Namespace_Spec from the provided source Namespace_Spec -func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *v20240101s.Namespace_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // AlternateName - namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) - - // AzureName - namespace.AzureName = source.AzureName - - // ClusterArmReference - if source.ClusterArmReference != nil { - clusterArmReference := source.ClusterArmReference.Copy() - namespace.ClusterArmReference = &clusterArmReference - } else { - namespace.ClusterArmReference = nil - } - - // DisableLocalAuth - if source.DisableLocalAuth != nil { - disableLocalAuth := *source.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } else { - namespace.DisableLocalAuth = nil - } - - // Encryption - if source.Encryption != nil { - var encryption Encryption - err := encryption.AssignProperties_From_Encryption(source.Encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Encryption() to populate field Encryption") - } - namespace.Encryption = &encryption - } else { - namespace.Encryption = nil - } - - // Identity - if source.Identity != nil { - var identity Identity - err := identity.AssignProperties_From_Identity(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Identity() to populate field Identity") - } - namespace.Identity = &identity - } else { - namespace.Identity = nil - } - - // IsAutoInflateEnabled - if source.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *source.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - namespace.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if source.KafkaEnabled != nil { - kafkaEnabled := *source.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } else { - namespace.KafkaEnabled = nil - } - - // Location - namespace.Location = genruntime.ClonePointerToString(source.Location) - - // MaximumThroughputUnits - namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) - - // MinimumTlsVersion - if source.MinimumTlsVersion != nil { - propertyBag.Add("MinimumTlsVersion", *source.MinimumTlsVersion) - } else { - propertyBag.Remove("MinimumTlsVersion") - } - - // OperatorSpec - if source.OperatorSpec != nil { - var operatorSpec NamespaceOperatorSpec - err := operatorSpec.AssignProperties_From_NamespaceOperatorSpec(source.OperatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSpec() to populate field OperatorSpec") - } - namespace.OperatorSpec = &operatorSpec - } else { - namespace.OperatorSpec = nil - } - - // OriginalVersion - namespace.OriginalVersion = source.OriginalVersion - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - namespace.Owner = &owner - } else { - namespace.Owner = nil - } - - // PublicNetworkAccess - if source.PublicNetworkAccess != nil { - propertyBag.Add("PublicNetworkAccess", *source.PublicNetworkAccess) - } else { - propertyBag.Remove("PublicNetworkAccess") - } - - // Sku - if source.Sku != nil { - var sku Sku - err := sku.AssignProperties_From_Sku(source.Sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Sku() to populate field Sku") - } - namespace.Sku = &sku - } else { - namespace.Sku = nil - } - - // Tags - namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) - - // ZoneRedundant - if source.ZoneRedundant != nil { - zoneRedundant := *source.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } else { - namespace.ZoneRedundant = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - namespace.PropertyBag = propertyBag - } else { - namespace.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespace_Spec interface (if implemented) to customize the conversion - var namespaceAsAny any = namespace - if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_Spec); ok { - err := augmentedNamespace.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespace_Spec populates the provided destination Namespace_Spec from our Namespace_Spec -func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination *v20240101s.Namespace_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(namespace.PropertyBag) - - // AlternateName - destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) - - // AzureName - destination.AzureName = namespace.AzureName - - // ClusterArmReference - if namespace.ClusterArmReference != nil { - clusterArmReference := namespace.ClusterArmReference.Copy() - destination.ClusterArmReference = &clusterArmReference - } else { - destination.ClusterArmReference = nil - } - - // DisableLocalAuth - if namespace.DisableLocalAuth != nil { - disableLocalAuth := *namespace.DisableLocalAuth - destination.DisableLocalAuth = &disableLocalAuth - } else { - destination.DisableLocalAuth = nil - } - - // Encryption - if namespace.Encryption != nil { - var encryption v20240101s.Encryption - err := namespace.Encryption.AssignProperties_To_Encryption(&encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Encryption() to populate field Encryption") - } - destination.Encryption = &encryption - } else { - destination.Encryption = nil - } - - // Identity - if namespace.Identity != nil { - var identity v20240101s.Identity - err := namespace.Identity.AssignProperties_To_Identity(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Identity() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // IsAutoInflateEnabled - if namespace.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *namespace.IsAutoInflateEnabled - destination.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - destination.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if namespace.KafkaEnabled != nil { - kafkaEnabled := *namespace.KafkaEnabled - destination.KafkaEnabled = &kafkaEnabled - } else { - destination.KafkaEnabled = nil - } - - // Location - destination.Location = genruntime.ClonePointerToString(namespace.Location) - - // MaximumThroughputUnits - destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits) - - // MinimumTlsVersion - if propertyBag.Contains("MinimumTlsVersion") { - var minimumTlsVersion string - err := propertyBag.Pull("MinimumTlsVersion", &minimumTlsVersion) - if err != nil { - return errors.Wrap(err, "pulling 'MinimumTlsVersion' from propertyBag") - } - - destination.MinimumTlsVersion = &minimumTlsVersion - } else { - destination.MinimumTlsVersion = nil - } - - // OperatorSpec - if namespace.OperatorSpec != nil { - var operatorSpec v20240101s.NamespaceOperatorSpec - err := namespace.OperatorSpec.AssignProperties_To_NamespaceOperatorSpec(&operatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSpec() to populate field OperatorSpec") - } - destination.OperatorSpec = &operatorSpec - } else { - destination.OperatorSpec = nil - } - - // OriginalVersion - destination.OriginalVersion = namespace.OriginalVersion - - // Owner - if namespace.Owner != nil { - owner := namespace.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // PublicNetworkAccess - if propertyBag.Contains("PublicNetworkAccess") { - var publicNetworkAccess string - err := propertyBag.Pull("PublicNetworkAccess", &publicNetworkAccess) - if err != nil { - return errors.Wrap(err, "pulling 'PublicNetworkAccess' from propertyBag") - } - - destination.PublicNetworkAccess = &publicNetworkAccess - } else { - destination.PublicNetworkAccess = nil - } - - // Sku - if namespace.Sku != nil { - var sku v20240101s.Sku - err := namespace.Sku.AssignProperties_To_Sku(&sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Sku() to populate field Sku") - } - destination.Sku = &sku - } else { - destination.Sku = nil - } - - // Tags - destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) - - // ZoneRedundant - if namespace.ZoneRedundant != nil { - zoneRedundant := *namespace.ZoneRedundant - destination.ZoneRedundant = &zoneRedundant - } else { - destination.ZoneRedundant = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespace_Spec interface (if implemented) to customize the conversion - var namespaceAsAny any = namespace - if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_Spec); ok { - err := augmentedNamespace.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } + if destination == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // No error - return nil + return destination.ConvertSpecFrom(namespace) } // Storage version of v1api20211101.Namespace_STATUS @@ -669,1811 +228,145 @@ var _ genruntime.ConvertibleStatus = &Namespace_STATUS{} // ConvertStatusFrom populates our Namespace_STATUS from the provided source func (namespace *Namespace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespace_STATUS) - if ok { - // Populate our instance from source - return namespace.AssignProperties_From_Namespace_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespace_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + if source == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Update our instance from src - err = namespace.AssignProperties_From_Namespace_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil + return source.ConvertStatusTo(namespace) } // ConvertStatusTo populates the provided destination from our Namespace_STATUS func (namespace *Namespace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespace_STATUS) - if ok { - // Populate destination from our instance - return namespace.AssignProperties_To_Namespace_STATUS(dst) + if destination == namespace { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Convert to an intermediate form - dst = &v20240101s.Namespace_STATUS{} - err := namespace.AssignProperties_To_Namespace_STATUS(dst) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") - } + return destination.ConvertStatusFrom(namespace) +} - // Update dst from our instance - err = dst.ConvertStatusTo(destination) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusTo()") - } +// Storage version of v1api20211101.Encryption +// Properties to configure Encryption +type Encryption struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} - return nil +// Storage version of v1api20211101.Encryption_STATUS +// Properties to configure Encryption +type Encryption_STATUS struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` } -// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS -func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *v20240101s.Namespace_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) +// Storage version of v1api20211101.Identity +// Properties to configure Identity for Bring your Own Keys +type Identity struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Type *string `json:"type,omitempty"` + UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} - // AlternateName - namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) +// Storage version of v1api20211101.Identity_STATUS +// Properties to configure Identity for Bring your Own Keys +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"` +} - // ClusterArmId - namespace.ClusterArmId = genruntime.ClonePointerToString(source.ClusterArmId) +// Storage version of v1api20211101.NamespaceOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespaceOperatorSpec struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` +} - // Conditions - namespace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) +// Storage version of v1api20211101.PrivateEndpointConnection_STATUS +// Properties of the PrivateEndpointConnection. +type PrivateEndpointConnection_STATUS struct { + Id *string `json:"id,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} - // CreatedAt - namespace.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) +// Storage version of v1api20211101.Sku +// SKU parameters supplied to the create namespace operation +type Sku struct { + Capacity *int `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} - // DisableLocalAuth - if source.DisableLocalAuth != nil { - disableLocalAuth := *source.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } else { - namespace.DisableLocalAuth = nil - } +// Storage version of v1api20211101.Sku_STATUS +// SKU parameters supplied to the create namespace operation +type Sku_STATUS struct { + Capacity *int `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} - // Encryption - if source.Encryption != nil { - var encryption Encryption_STATUS - err := encryption.AssignProperties_From_Encryption_STATUS(source.Encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Encryption_STATUS() to populate field Encryption") - } - namespace.Encryption = &encryption - } else { - namespace.Encryption = nil - } +// Storage version of v1api20211101.SystemData_STATUS +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByType *string `json:"createdByType,omitempty"` + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedByType *string `json:"lastModifiedByType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} - // Id - namespace.Id = genruntime.ClonePointerToString(source.Id) +// Storage version of v1api20211101.KeyVaultProperties +// Properties to configure keyVault Properties +type KeyVaultProperties struct { + Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} - // Identity - if source.Identity != nil { - var identity Identity_STATUS - err := identity.AssignProperties_From_Identity_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Identity_STATUS() to populate field Identity") - } - namespace.Identity = &identity - } else { - namespace.Identity = nil - } +// Storage version of v1api20211101.KeyVaultProperties_STATUS +// Properties to configure keyVault Properties +type KeyVaultProperties_STATUS struct { + Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} - // IsAutoInflateEnabled - if source.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *source.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - namespace.IsAutoInflateEnabled = nil - } +// Storage version of v1api20211101.NamespaceOperatorSecrets +type NamespaceOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} - // KafkaEnabled - if source.KafkaEnabled != nil { - kafkaEnabled := *source.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } else { - namespace.KafkaEnabled = nil - } +// Storage version of v1api20211101.UserAssignedIdentity_STATUS +// Recognized Dictionary value. +type UserAssignedIdentity_STATUS struct { + ClientId *string `json:"clientId,omitempty"` + PrincipalId *string `json:"principalId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} - // Location - namespace.Location = genruntime.ClonePointerToString(source.Location) - - // MaximumThroughputUnits - namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) - - // MetricId - namespace.MetricId = genruntime.ClonePointerToString(source.MetricId) - - // MinimumTlsVersion - if source.MinimumTlsVersion != nil { - propertyBag.Add("MinimumTlsVersion", *source.MinimumTlsVersion) - } else { - propertyBag.Remove("MinimumTlsVersion") - } - - // Name - namespace.Name = genruntime.ClonePointerToString(source.Name) - - // PrivateEndpointConnections - if source.PrivateEndpointConnections != nil { - privateEndpointConnectionList := make([]PrivateEndpointConnection_STATUS, len(source.PrivateEndpointConnections)) - for privateEndpointConnectionIndex, privateEndpointConnectionItem := range source.PrivateEndpointConnections { - // Shadow the loop variable to avoid aliasing - privateEndpointConnectionItem := privateEndpointConnectionItem - var privateEndpointConnection PrivateEndpointConnection_STATUS - err := privateEndpointConnection.AssignProperties_From_PrivateEndpointConnection_STATUS(&privateEndpointConnectionItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") - } - privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection - } - namespace.PrivateEndpointConnections = privateEndpointConnectionList - } else { - namespace.PrivateEndpointConnections = nil - } - - // ProvisioningState - namespace.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState) - - // PublicNetworkAccess - if source.PublicNetworkAccess != nil { - propertyBag.Add("PublicNetworkAccess", *source.PublicNetworkAccess) - } else { - propertyBag.Remove("PublicNetworkAccess") - } - - // ServiceBusEndpoint - namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) - - // Sku - if source.Sku != nil { - var sku Sku_STATUS - err := sku.AssignProperties_From_Sku_STATUS(source.Sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Sku_STATUS() to populate field Sku") - } - namespace.Sku = &sku - } else { - namespace.Sku = nil - } - - // Status - namespace.Status = genruntime.ClonePointerToString(source.Status) - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - namespace.SystemData = &systemDatum - } else { - namespace.SystemData = nil - } - - // Tags - namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) - - // Type - namespace.Type = genruntime.ClonePointerToString(source.Type) - - // UpdatedAt - namespace.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) - - // ZoneRedundant - if source.ZoneRedundant != nil { - zoneRedundant := *source.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } else { - namespace.ZoneRedundant = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - namespace.PropertyBag = propertyBag - } else { - namespace.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespace_STATUS interface (if implemented) to customize the conversion - var namespaceAsAny any = namespace - if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_STATUS); ok { - err := augmentedNamespace.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespace_STATUS populates the provided destination Namespace_STATUS from our Namespace_STATUS -func (namespace *Namespace_STATUS) AssignProperties_To_Namespace_STATUS(destination *v20240101s.Namespace_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(namespace.PropertyBag) - - // AlternateName - destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) - - // ClusterArmId - destination.ClusterArmId = genruntime.ClonePointerToString(namespace.ClusterArmId) - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(namespace.Conditions) - - // CreatedAt - destination.CreatedAt = genruntime.ClonePointerToString(namespace.CreatedAt) - - // DisableLocalAuth - if namespace.DisableLocalAuth != nil { - disableLocalAuth := *namespace.DisableLocalAuth - destination.DisableLocalAuth = &disableLocalAuth - } else { - destination.DisableLocalAuth = nil - } - - // Encryption - if namespace.Encryption != nil { - var encryption v20240101s.Encryption_STATUS - err := namespace.Encryption.AssignProperties_To_Encryption_STATUS(&encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Encryption_STATUS() to populate field Encryption") - } - destination.Encryption = &encryption - } else { - destination.Encryption = nil - } - - // Id - destination.Id = genruntime.ClonePointerToString(namespace.Id) - - // Identity - if namespace.Identity != nil { - var identity v20240101s.Identity_STATUS - err := namespace.Identity.AssignProperties_To_Identity_STATUS(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Identity_STATUS() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // IsAutoInflateEnabled - if namespace.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *namespace.IsAutoInflateEnabled - destination.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - destination.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if namespace.KafkaEnabled != nil { - kafkaEnabled := *namespace.KafkaEnabled - destination.KafkaEnabled = &kafkaEnabled - } else { - destination.KafkaEnabled = nil - } - - // Location - destination.Location = genruntime.ClonePointerToString(namespace.Location) - - // MaximumThroughputUnits - destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits) - - // MetricId - destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) - - // MinimumTlsVersion - if propertyBag.Contains("MinimumTlsVersion") { - var minimumTlsVersion string - err := propertyBag.Pull("MinimumTlsVersion", &minimumTlsVersion) - if err != nil { - return errors.Wrap(err, "pulling 'MinimumTlsVersion' from propertyBag") - } - - destination.MinimumTlsVersion = &minimumTlsVersion - } else { - destination.MinimumTlsVersion = nil - } - - // Name - destination.Name = genruntime.ClonePointerToString(namespace.Name) - - // PrivateEndpointConnections - if namespace.PrivateEndpointConnections != nil { - privateEndpointConnectionList := make([]v20240101s.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) - for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { - // Shadow the loop variable to avoid aliasing - privateEndpointConnectionItem := privateEndpointConnectionItem - var privateEndpointConnection v20240101s.PrivateEndpointConnection_STATUS - err := privateEndpointConnectionItem.AssignProperties_To_PrivateEndpointConnection_STATUS(&privateEndpointConnection) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") - } - privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection - } - destination.PrivateEndpointConnections = privateEndpointConnectionList - } else { - destination.PrivateEndpointConnections = nil - } - - // ProvisioningState - destination.ProvisioningState = genruntime.ClonePointerToString(namespace.ProvisioningState) - - // PublicNetworkAccess - if propertyBag.Contains("PublicNetworkAccess") { - var publicNetworkAccess string - err := propertyBag.Pull("PublicNetworkAccess", &publicNetworkAccess) - if err != nil { - return errors.Wrap(err, "pulling 'PublicNetworkAccess' from propertyBag") - } - - destination.PublicNetworkAccess = &publicNetworkAccess - } else { - destination.PublicNetworkAccess = nil - } - - // ServiceBusEndpoint - destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) - - // Sku - if namespace.Sku != nil { - var sku v20240101s.Sku_STATUS - err := namespace.Sku.AssignProperties_To_Sku_STATUS(&sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Sku_STATUS() to populate field Sku") - } - destination.Sku = &sku - } else { - destination.Sku = nil - } - - // Status - destination.Status = genruntime.ClonePointerToString(namespace.Status) - - // SystemData - if namespace.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := namespace.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Tags - destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) - - // Type - destination.Type = genruntime.ClonePointerToString(namespace.Type) - - // UpdatedAt - destination.UpdatedAt = genruntime.ClonePointerToString(namespace.UpdatedAt) - - // ZoneRedundant - if namespace.ZoneRedundant != nil { - zoneRedundant := *namespace.ZoneRedundant - destination.ZoneRedundant = &zoneRedundant - } else { - destination.ZoneRedundant = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespace_STATUS interface (if implemented) to customize the conversion - var namespaceAsAny any = namespace - if augmentedNamespace, ok := namespaceAsAny.(augmentConversionForNamespace_STATUS); ok { - err := augmentedNamespace.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespace_Spec interface { - AssignPropertiesFrom(src *v20240101s.Namespace_Spec) error - AssignPropertiesTo(dst *v20240101s.Namespace_Spec) error -} - -type augmentConversionForNamespace_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Namespace_STATUS) error - AssignPropertiesTo(dst *v20240101s.Namespace_STATUS) error -} - -// Storage version of v1api20211101.Encryption -// Properties to configure Encryption -type Encryption struct { - KeySource *string `json:"keySource,omitempty"` - KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -// AssignProperties_From_Encryption populates our Encryption from the provided source Encryption -func (encryption *Encryption) AssignProperties_From_Encryption(source *v20240101s.Encryption) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // KeySource - encryption.KeySource = genruntime.ClonePointerToString(source.KeySource) - - // KeyVaultProperties - if source.KeyVaultProperties != nil { - keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty KeyVaultProperties - err := keyVaultProperty.AssignProperties_From_KeyVaultProperties(&keyVaultPropertyItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - encryption.KeyVaultProperties = keyVaultPropertyList - } else { - encryption.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if source.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *source.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - encryption.RequireInfrastructureEncryption = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - encryption.PropertyBag = propertyBag - } else { - encryption.PropertyBag = nil - } - - // Invoke the augmentConversionForEncryption interface (if implemented) to customize the conversion - var encryptionAsAny any = encryption - if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption); ok { - err := augmentedEncryption.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Encryption populates the provided destination Encryption from our Encryption -func (encryption *Encryption) AssignProperties_To_Encryption(destination *v20240101s.Encryption) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(encryption.PropertyBag) - - // KeySource - destination.KeySource = genruntime.ClonePointerToString(encryption.KeySource) - - // KeyVaultProperties - if encryption.KeyVaultProperties != nil { - keyVaultPropertyList := make([]v20240101s.KeyVaultProperties, len(encryption.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty v20240101s.KeyVaultProperties - err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties(&keyVaultProperty) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - destination.KeyVaultProperties = keyVaultPropertyList - } else { - destination.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if encryption.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption - destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - destination.RequireInfrastructureEncryption = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForEncryption interface (if implemented) to customize the conversion - var encryptionAsAny any = encryption - if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption); ok { - err := augmentedEncryption.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.Encryption_STATUS -// Properties to configure Encryption -type Encryption_STATUS struct { - KeySource *string `json:"keySource,omitempty"` - KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -// AssignProperties_From_Encryption_STATUS populates our Encryption_STATUS from the provided source Encryption_STATUS -func (encryption *Encryption_STATUS) AssignProperties_From_Encryption_STATUS(source *v20240101s.Encryption_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // KeySource - encryption.KeySource = genruntime.ClonePointerToString(source.KeySource) - - // KeyVaultProperties - if source.KeyVaultProperties != nil { - keyVaultPropertyList := make([]KeyVaultProperties_STATUS, len(source.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty KeyVaultProperties_STATUS - err := keyVaultProperty.AssignProperties_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - encryption.KeyVaultProperties = keyVaultPropertyList - } else { - encryption.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if source.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *source.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - encryption.RequireInfrastructureEncryption = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - encryption.PropertyBag = propertyBag - } else { - encryption.PropertyBag = nil - } - - // Invoke the augmentConversionForEncryption_STATUS interface (if implemented) to customize the conversion - var encryptionAsAny any = encryption - if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption_STATUS); ok { - err := augmentedEncryption.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Encryption_STATUS populates the provided destination Encryption_STATUS from our Encryption_STATUS -func (encryption *Encryption_STATUS) AssignProperties_To_Encryption_STATUS(destination *v20240101s.Encryption_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(encryption.PropertyBag) - - // KeySource - destination.KeySource = genruntime.ClonePointerToString(encryption.KeySource) - - // KeyVaultProperties - if encryption.KeyVaultProperties != nil { - keyVaultPropertyList := make([]v20240101s.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty v20240101s.KeyVaultProperties_STATUS - err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - destination.KeyVaultProperties = keyVaultPropertyList - } else { - destination.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if encryption.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption - destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - destination.RequireInfrastructureEncryption = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForEncryption_STATUS interface (if implemented) to customize the conversion - var encryptionAsAny any = encryption - if augmentedEncryption, ok := encryptionAsAny.(augmentConversionForEncryption_STATUS); ok { - err := augmentedEncryption.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.Identity -// Properties to configure Identity for Bring your Own Keys -type Identity struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Type *string `json:"type,omitempty"` - UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` -} - -// AssignProperties_From_Identity populates our Identity from the provided source Identity -func (identity *Identity) AssignProperties_From_Identity(source *v20240101s.Identity) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Type - identity.Type = genruntime.ClonePointerToString(source.Type) - - // UserAssignedIdentities - if source.UserAssignedIdentities != nil { - userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities)) - for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities { - // Shadow the loop variable to avoid aliasing - userAssignedIdentityItem := userAssignedIdentityItem - var userAssignedIdentity UserAssignedIdentityDetails - err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") - } - userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity - } - identity.UserAssignedIdentities = userAssignedIdentityList - } else { - identity.UserAssignedIdentities = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - identity.PropertyBag = propertyBag - } else { - identity.PropertyBag = nil - } - - // Invoke the augmentConversionForIdentity interface (if implemented) to customize the conversion - var identityAsAny any = identity - if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity); ok { - err := augmentedIdentity.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Identity populates the provided destination Identity from our Identity -func (identity *Identity) AssignProperties_To_Identity(destination *v20240101s.Identity) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(identity.PropertyBag) - - // Type - destination.Type = genruntime.ClonePointerToString(identity.Type) - - // UserAssignedIdentities - if identity.UserAssignedIdentities != nil { - userAssignedIdentityList := make([]v20240101s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) - for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { - // Shadow the loop variable to avoid aliasing - userAssignedIdentityItem := userAssignedIdentityItem - var userAssignedIdentity v20240101s.UserAssignedIdentityDetails - err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") - } - userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity - } - destination.UserAssignedIdentities = userAssignedIdentityList - } else { - destination.UserAssignedIdentities = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForIdentity interface (if implemented) to customize the conversion - var identityAsAny any = identity - if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity); ok { - err := augmentedIdentity.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.Identity_STATUS -// Properties to configure Identity for Bring your Own Keys -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"` -} - -// AssignProperties_From_Identity_STATUS populates our Identity_STATUS from the provided source Identity_STATUS -func (identity *Identity_STATUS) AssignProperties_From_Identity_STATUS(source *v20240101s.Identity_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // PrincipalId - identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) - - // TenantId - identity.TenantId = genruntime.ClonePointerToString(source.TenantId) - - // Type - identity.Type = genruntime.ClonePointerToString(source.Type) - - // 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.AssignProperties_From_UserAssignedIdentity_STATUS(&userAssignedIdentityValue) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") - } - userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity - } - identity.UserAssignedIdentities = userAssignedIdentityMap - } else { - identity.UserAssignedIdentities = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - identity.PropertyBag = propertyBag - } else { - identity.PropertyBag = nil - } - - // Invoke the augmentConversionForIdentity_STATUS interface (if implemented) to customize the conversion - var identityAsAny any = identity - if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity_STATUS); ok { - err := augmentedIdentity.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Identity_STATUS populates the provided destination Identity_STATUS from our Identity_STATUS -func (identity *Identity_STATUS) AssignProperties_To_Identity_STATUS(destination *v20240101s.Identity_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(identity.PropertyBag) - - // PrincipalId - destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId) - - // TenantId - destination.TenantId = genruntime.ClonePointerToString(identity.TenantId) - - // Type - destination.Type = genruntime.ClonePointerToString(identity.Type) - - // UserAssignedIdentities - if identity.UserAssignedIdentities != nil { - userAssignedIdentityMap := make(map[string]v20240101s.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) - for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { - // Shadow the loop variable to avoid aliasing - userAssignedIdentityValue := userAssignedIdentityValue - var userAssignedIdentity v20240101s.UserAssignedIdentity_STATUS - err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") - } - userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity - } - destination.UserAssignedIdentities = userAssignedIdentityMap - } else { - destination.UserAssignedIdentities = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForIdentity_STATUS interface (if implemented) to customize the conversion - var identityAsAny any = identity - if augmentedIdentity, ok := identityAsAny.(augmentConversionForIdentity_STATUS); ok { - err := augmentedIdentity.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.NamespaceOperatorSpec -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type NamespaceOperatorSpec struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` -} - -// AssignProperties_From_NamespaceOperatorSpec populates our NamespaceOperatorSpec from the provided source NamespaceOperatorSpec -func (operator *NamespaceOperatorSpec) AssignProperties_From_NamespaceOperatorSpec(source *v20240101s.NamespaceOperatorSpec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Secrets - if source.Secrets != nil { - var secret NamespaceOperatorSecrets - err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSecrets() to populate field Secrets") - } - operator.Secrets = &secret - } else { - operator.Secrets = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - operator.PropertyBag = propertyBag - } else { - operator.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaceOperatorSpec interface (if implemented) to customize the conversion - var operatorAsAny any = operator - if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespaceOperatorSpec); ok { - err := augmentedOperator.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespaceOperatorSpec populates the provided destination NamespaceOperatorSpec from our NamespaceOperatorSpec -func (operator *NamespaceOperatorSpec) AssignProperties_To_NamespaceOperatorSpec(destination *v20240101s.NamespaceOperatorSpec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) - - // Secrets - if operator.Secrets != nil { - var secret v20240101s.NamespaceOperatorSecrets - err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSecrets() to populate field Secrets") - } - destination.Secrets = &secret - } else { - destination.Secrets = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaceOperatorSpec interface (if implemented) to customize the conversion - var operatorAsAny any = operator - if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespaceOperatorSpec); ok { - err := augmentedOperator.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.PrivateEndpointConnection_STATUS -// Properties of the PrivateEndpointConnection. -type PrivateEndpointConnection_STATUS struct { - Id *string `json:"id,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// AssignProperties_From_PrivateEndpointConnection_STATUS populates our PrivateEndpointConnection_STATUS from the provided source PrivateEndpointConnection_STATUS -func (connection *PrivateEndpointConnection_STATUS) AssignProperties_From_PrivateEndpointConnection_STATUS(source *v20240101s.PrivateEndpointConnection_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Id - connection.Id = genruntime.ClonePointerToString(source.Id) - - // Update the property bag - if len(propertyBag) > 0 { - connection.PropertyBag = propertyBag - } else { - connection.PropertyBag = nil - } - - // Invoke the augmentConversionForPrivateEndpointConnection_STATUS interface (if implemented) to customize the conversion - var connectionAsAny any = connection - if augmentedConnection, ok := connectionAsAny.(augmentConversionForPrivateEndpointConnection_STATUS); ok { - err := augmentedConnection.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_PrivateEndpointConnection_STATUS populates the provided destination PrivateEndpointConnection_STATUS from our PrivateEndpointConnection_STATUS -func (connection *PrivateEndpointConnection_STATUS) AssignProperties_To_PrivateEndpointConnection_STATUS(destination *v20240101s.PrivateEndpointConnection_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(connection.PropertyBag) - - // Id - destination.Id = genruntime.ClonePointerToString(connection.Id) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForPrivateEndpointConnection_STATUS interface (if implemented) to customize the conversion - var connectionAsAny any = connection - if augmentedConnection, ok := connectionAsAny.(augmentConversionForPrivateEndpointConnection_STATUS); ok { - err := augmentedConnection.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.Sku -// SKU parameters supplied to the create namespace operation -type Sku struct { - Capacity *int `json:"capacity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Tier *string `json:"tier,omitempty"` -} - -// AssignProperties_From_Sku populates our Sku from the provided source Sku -func (sku *Sku) AssignProperties_From_Sku(source *v20240101s.Sku) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Capacity - sku.Capacity = genruntime.ClonePointerToInt(source.Capacity) - - // Name - sku.Name = genruntime.ClonePointerToString(source.Name) - - // Tier - sku.Tier = genruntime.ClonePointerToString(source.Tier) - - // Update the property bag - if len(propertyBag) > 0 { - sku.PropertyBag = propertyBag - } else { - sku.PropertyBag = nil - } - - // Invoke the augmentConversionForSku interface (if implemented) to customize the conversion - var skuAsAny any = sku - if augmentedSku, ok := skuAsAny.(augmentConversionForSku); ok { - err := augmentedSku.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Sku populates the provided destination Sku from our Sku -func (sku *Sku) AssignProperties_To_Sku(destination *v20240101s.Sku) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(sku.PropertyBag) - - // Capacity - destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity) - - // 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 - } - - // Invoke the augmentConversionForSku interface (if implemented) to customize the conversion - var skuAsAny any = sku - if augmentedSku, ok := skuAsAny.(augmentConversionForSku); ok { - err := augmentedSku.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.Sku_STATUS -// SKU parameters supplied to the create namespace operation -type Sku_STATUS struct { - Capacity *int `json:"capacity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Tier *string `json:"tier,omitempty"` -} - -// AssignProperties_From_Sku_STATUS populates our Sku_STATUS from the provided source Sku_STATUS -func (sku *Sku_STATUS) AssignProperties_From_Sku_STATUS(source *v20240101s.Sku_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Capacity - sku.Capacity = genruntime.ClonePointerToInt(source.Capacity) - - // Name - sku.Name = genruntime.ClonePointerToString(source.Name) - - // Tier - sku.Tier = genruntime.ClonePointerToString(source.Tier) - - // Update the property bag - if len(propertyBag) > 0 { - sku.PropertyBag = propertyBag - } else { - sku.PropertyBag = nil - } - - // Invoke the augmentConversionForSku_STATUS interface (if implemented) to customize the conversion - var skuAsAny any = sku - if augmentedSku, ok := skuAsAny.(augmentConversionForSku_STATUS); ok { - err := augmentedSku.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Sku_STATUS populates the provided destination Sku_STATUS from our Sku_STATUS -func (sku *Sku_STATUS) AssignProperties_To_Sku_STATUS(destination *v20240101s.Sku_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(sku.PropertyBag) - - // Capacity - destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity) - - // 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 - } - - // Invoke the augmentConversionForSku_STATUS interface (if implemented) to customize the conversion - var skuAsAny any = sku - if augmentedSku, ok := skuAsAny.(augmentConversionForSku_STATUS); ok { - err := augmentedSku.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.SystemData_STATUS -// Metadata pertaining to creation and last modification of the resource. -type SystemData_STATUS struct { - CreatedAt *string `json:"createdAt,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - CreatedByType *string `json:"createdByType,omitempty"` - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedByType *string `json:"lastModifiedByType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS -func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *v20240101s.SystemData_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // CreatedAt - data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) - - // CreatedBy - data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) - - // CreatedByType - data.CreatedByType = genruntime.ClonePointerToString(source.CreatedByType) - - // LastModifiedAt - data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt) - - // LastModifiedBy - data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) - - // LastModifiedByType - data.LastModifiedByType = genruntime.ClonePointerToString(source.LastModifiedByType) - - // Update the property bag - if len(propertyBag) > 0 { - data.PropertyBag = propertyBag - } else { - data.PropertyBag = nil - } - - // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion - var dataAsAny any = data - if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { - err := augmentedData.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS -func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *v20240101s.SystemData_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(data.PropertyBag) - - // CreatedAt - destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt) - - // CreatedBy - destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy) - - // CreatedByType - destination.CreatedByType = genruntime.ClonePointerToString(data.CreatedByType) - - // LastModifiedAt - destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt) - - // LastModifiedBy - destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy) - - // LastModifiedByType - destination.LastModifiedByType = genruntime.ClonePointerToString(data.LastModifiedByType) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion - var dataAsAny any = data - if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { - err := augmentedData.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForEncryption interface { - AssignPropertiesFrom(src *v20240101s.Encryption) error - AssignPropertiesTo(dst *v20240101s.Encryption) error -} - -type augmentConversionForEncryption_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Encryption_STATUS) error - AssignPropertiesTo(dst *v20240101s.Encryption_STATUS) error -} - -type augmentConversionForIdentity interface { - AssignPropertiesFrom(src *v20240101s.Identity) error - AssignPropertiesTo(dst *v20240101s.Identity) error -} - -type augmentConversionForIdentity_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Identity_STATUS) error - AssignPropertiesTo(dst *v20240101s.Identity_STATUS) error -} - -type augmentConversionForNamespaceOperatorSpec interface { - AssignPropertiesFrom(src *v20240101s.NamespaceOperatorSpec) error - AssignPropertiesTo(dst *v20240101s.NamespaceOperatorSpec) error -} - -type augmentConversionForPrivateEndpointConnection_STATUS interface { - AssignPropertiesFrom(src *v20240101s.PrivateEndpointConnection_STATUS) error - AssignPropertiesTo(dst *v20240101s.PrivateEndpointConnection_STATUS) error -} - -type augmentConversionForSku interface { - AssignPropertiesFrom(src *v20240101s.Sku) error - AssignPropertiesTo(dst *v20240101s.Sku) error -} - -type augmentConversionForSku_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Sku_STATUS) error - AssignPropertiesTo(dst *v20240101s.Sku_STATUS) error -} - -type augmentConversionForSystemData_STATUS interface { - AssignPropertiesFrom(src *v20240101s.SystemData_STATUS) error - AssignPropertiesTo(dst *v20240101s.SystemData_STATUS) error -} - -// Storage version of v1api20211101.KeyVaultProperties -// Properties to configure keyVault Properties -type KeyVaultProperties struct { - Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// AssignProperties_From_KeyVaultProperties populates our KeyVaultProperties from the provided source KeyVaultProperties -func (properties *KeyVaultProperties) AssignProperties_From_KeyVaultProperties(source *v20240101s.KeyVaultProperties) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Identity - if source.Identity != nil { - var identity UserAssignedIdentityProperties - err := identity.AssignProperties_From_UserAssignedIdentityProperties(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties() to populate field Identity") - } - properties.Identity = &identity - } else { - properties.Identity = nil - } - - // KeyName - properties.KeyName = genruntime.ClonePointerToString(source.KeyName) - - // KeyVaultUri - properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) - - // KeyVersion - properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) - - // Update the property bag - if len(propertyBag) > 0 { - properties.PropertyBag = propertyBag - } else { - properties.PropertyBag = nil - } - - // Invoke the augmentConversionForKeyVaultProperties interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties); ok { - err := augmentedProperties.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_KeyVaultProperties populates the provided destination KeyVaultProperties from our KeyVaultProperties -func (properties *KeyVaultProperties) AssignProperties_To_KeyVaultProperties(destination *v20240101s.KeyVaultProperties) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) - - // Identity - if properties.Identity != nil { - var identity v20240101s.UserAssignedIdentityProperties - err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // KeyName - destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) - - // KeyVaultUri - destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) - - // KeyVersion - destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForKeyVaultProperties interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties); ok { - err := augmentedProperties.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.KeyVaultProperties_STATUS -// Properties to configure keyVault Properties -type KeyVaultProperties_STATUS struct { - Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// AssignProperties_From_KeyVaultProperties_STATUS populates our KeyVaultProperties_STATUS from the provided source KeyVaultProperties_STATUS -func (properties *KeyVaultProperties_STATUS) AssignProperties_From_KeyVaultProperties_STATUS(source *v20240101s.KeyVaultProperties_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Identity - if source.Identity != nil { - var identity UserAssignedIdentityProperties_STATUS - err := identity.AssignProperties_From_UserAssignedIdentityProperties_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") - } - properties.Identity = &identity - } else { - properties.Identity = nil - } - - // KeyName - properties.KeyName = genruntime.ClonePointerToString(source.KeyName) - - // KeyVaultUri - properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) - - // KeyVersion - properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) - - // Update the property bag - if len(propertyBag) > 0 { - properties.PropertyBag = propertyBag - } else { - properties.PropertyBag = nil - } - - // Invoke the augmentConversionForKeyVaultProperties_STATUS interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties_STATUS); ok { - err := augmentedProperties.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_KeyVaultProperties_STATUS populates the provided destination KeyVaultProperties_STATUS from our KeyVaultProperties_STATUS -func (properties *KeyVaultProperties_STATUS) AssignProperties_To_KeyVaultProperties_STATUS(destination *v20240101s.KeyVaultProperties_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) - - // Identity - if properties.Identity != nil { - var identity v20240101s.UserAssignedIdentityProperties_STATUS - err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties_STATUS() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // KeyName - destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) - - // KeyVaultUri - destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) - - // KeyVersion - destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForKeyVaultProperties_STATUS interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForKeyVaultProperties_STATUS); ok { - err := augmentedProperties.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.NamespaceOperatorSecrets -type NamespaceOperatorSecrets struct { - PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -// AssignProperties_From_NamespaceOperatorSecrets populates our NamespaceOperatorSecrets from the provided source NamespaceOperatorSecrets -func (secrets *NamespaceOperatorSecrets) AssignProperties_From_NamespaceOperatorSecrets(source *v20240101s.NamespaceOperatorSecrets) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // PrimaryConnectionString - if source.PrimaryConnectionString != nil { - primaryConnectionString := source.PrimaryConnectionString.Copy() - secrets.PrimaryConnectionString = &primaryConnectionString - } else { - secrets.PrimaryConnectionString = nil - } - - // PrimaryKey - if source.PrimaryKey != nil { - primaryKey := source.PrimaryKey.Copy() - secrets.PrimaryKey = &primaryKey - } else { - secrets.PrimaryKey = nil - } - - // SecondaryConnectionString - if source.SecondaryConnectionString != nil { - secondaryConnectionString := source.SecondaryConnectionString.Copy() - secrets.SecondaryConnectionString = &secondaryConnectionString - } else { - secrets.SecondaryConnectionString = nil - } - - // SecondaryKey - if source.SecondaryKey != nil { - secondaryKey := source.SecondaryKey.Copy() - secrets.SecondaryKey = &secondaryKey - } else { - secrets.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - secrets.PropertyBag = propertyBag - } else { - secrets.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaceOperatorSecrets interface (if implemented) to customize the conversion - var secretsAsAny any = secrets - if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespaceOperatorSecrets); ok { - err := augmentedSecrets.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespaceOperatorSecrets populates the provided destination NamespaceOperatorSecrets from our NamespaceOperatorSecrets -func (secrets *NamespaceOperatorSecrets) AssignProperties_To_NamespaceOperatorSecrets(destination *v20240101s.NamespaceOperatorSecrets) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) - - // PrimaryConnectionString - if secrets.PrimaryConnectionString != nil { - primaryConnectionString := secrets.PrimaryConnectionString.Copy() - destination.PrimaryConnectionString = &primaryConnectionString - } else { - destination.PrimaryConnectionString = nil - } - - // PrimaryKey - if secrets.PrimaryKey != nil { - primaryKey := secrets.PrimaryKey.Copy() - destination.PrimaryKey = &primaryKey - } else { - destination.PrimaryKey = nil - } - - // SecondaryConnectionString - if secrets.SecondaryConnectionString != nil { - secondaryConnectionString := secrets.SecondaryConnectionString.Copy() - destination.SecondaryConnectionString = &secondaryConnectionString - } else { - destination.SecondaryConnectionString = nil - } - - // SecondaryKey - if secrets.SecondaryKey != nil { - secondaryKey := secrets.SecondaryKey.Copy() - destination.SecondaryKey = &secondaryKey - } else { - destination.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaceOperatorSecrets interface (if implemented) to customize the conversion - var secretsAsAny any = secrets - if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespaceOperatorSecrets); ok { - err := augmentedSecrets.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.UserAssignedIdentity_STATUS -// Recognized Dictionary value. -type UserAssignedIdentity_STATUS struct { - ClientId *string `json:"clientId,omitempty"` - PrincipalId *string `json:"principalId,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// AssignProperties_From_UserAssignedIdentity_STATUS populates our UserAssignedIdentity_STATUS from the provided source UserAssignedIdentity_STATUS -func (identity *UserAssignedIdentity_STATUS) AssignProperties_From_UserAssignedIdentity_STATUS(source *v20240101s.UserAssignedIdentity_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // ClientId - identity.ClientId = genruntime.ClonePointerToString(source.ClientId) - - // PrincipalId - identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) - - // Update the property bag - if len(propertyBag) > 0 { - identity.PropertyBag = propertyBag - } else { - identity.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentity_STATUS interface (if implemented) to customize the conversion - var identityAsAny any = identity - if augmentedIdentity, ok := identityAsAny.(augmentConversionForUserAssignedIdentity_STATUS); ok { - err := augmentedIdentity.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentity_STATUS populates the provided destination UserAssignedIdentity_STATUS from our UserAssignedIdentity_STATUS -func (identity *UserAssignedIdentity_STATUS) AssignProperties_To_UserAssignedIdentity_STATUS(destination *v20240101s.UserAssignedIdentity_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(identity.PropertyBag) - - // ClientId - destination.ClientId = genruntime.ClonePointerToString(identity.ClientId) - - // PrincipalId - destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentity_STATUS interface (if implemented) to customize the conversion - var identityAsAny any = identity - if augmentedIdentity, ok := identityAsAny.(augmentConversionForUserAssignedIdentity_STATUS); ok { - err := augmentedIdentity.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -// Storage version of v1api20211101.UserAssignedIdentityDetails -// Information about the user assigned identity for the resource -type UserAssignedIdentityDetails struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` -} - -// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails -func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *v20240101s.UserAssignedIdentityDetails) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Reference - details.Reference = source.Reference.Copy() - - // Update the property bag - if len(propertyBag) > 0 { - details.PropertyBag = propertyBag - } else { - details.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentityDetails interface (if implemented) to customize the conversion - var detailsAsAny any = details - if augmentedDetails, ok := detailsAsAny.(augmentConversionForUserAssignedIdentityDetails); ok { - err := augmentedDetails.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentityDetails populates the provided destination UserAssignedIdentityDetails from our UserAssignedIdentityDetails -func (details *UserAssignedIdentityDetails) AssignProperties_To_UserAssignedIdentityDetails(destination *v20240101s.UserAssignedIdentityDetails) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(details.PropertyBag) - - // Reference - destination.Reference = details.Reference.Copy() - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentityDetails interface (if implemented) to customize the conversion - var detailsAsAny any = details - if augmentedDetails, ok := detailsAsAny.(augmentConversionForUserAssignedIdentityDetails); ok { - err := augmentedDetails.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForKeyVaultProperties interface { - AssignPropertiesFrom(src *v20240101s.KeyVaultProperties) error - AssignPropertiesTo(dst *v20240101s.KeyVaultProperties) error -} - -type augmentConversionForKeyVaultProperties_STATUS interface { - AssignPropertiesFrom(src *v20240101s.KeyVaultProperties_STATUS) error - AssignPropertiesTo(dst *v20240101s.KeyVaultProperties_STATUS) error -} - -type augmentConversionForNamespaceOperatorSecrets interface { - AssignPropertiesFrom(src *v20240101s.NamespaceOperatorSecrets) error - AssignPropertiesTo(dst *v20240101s.NamespaceOperatorSecrets) error -} - -type augmentConversionForUserAssignedIdentity_STATUS interface { - AssignPropertiesFrom(src *v20240101s.UserAssignedIdentity_STATUS) error - AssignPropertiesTo(dst *v20240101s.UserAssignedIdentity_STATUS) error -} - -type augmentConversionForUserAssignedIdentityDetails interface { - AssignPropertiesFrom(src *v20240101s.UserAssignedIdentityDetails) error - AssignPropertiesTo(dst *v20240101s.UserAssignedIdentityDetails) error -} +// Storage version of v1api20211101.UserAssignedIdentityDetails +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` +} // Storage version of v1api20211101.UserAssignedIdentityProperties type UserAssignedIdentityProperties struct { @@ -2483,144 +376,12 @@ type UserAssignedIdentityProperties struct { UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` } -// AssignProperties_From_UserAssignedIdentityProperties populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties -func (properties *UserAssignedIdentityProperties) AssignProperties_From_UserAssignedIdentityProperties(source *v20240101s.UserAssignedIdentityProperties) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // UserAssignedIdentityReference - if source.UserAssignedIdentityReference != nil { - userAssignedIdentityReference := source.UserAssignedIdentityReference.Copy() - properties.UserAssignedIdentityReference = &userAssignedIdentityReference - } else { - properties.UserAssignedIdentityReference = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - properties.PropertyBag = propertyBag - } else { - properties.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentityProperties interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties); ok { - err := augmentedProperties.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentityProperties populates the provided destination UserAssignedIdentityProperties from our UserAssignedIdentityProperties -func (properties *UserAssignedIdentityProperties) AssignProperties_To_UserAssignedIdentityProperties(destination *v20240101s.UserAssignedIdentityProperties) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) - - // UserAssignedIdentityReference - if properties.UserAssignedIdentityReference != nil { - userAssignedIdentityReference := properties.UserAssignedIdentityReference.Copy() - destination.UserAssignedIdentityReference = &userAssignedIdentityReference - } else { - destination.UserAssignedIdentityReference = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentityProperties interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties); ok { - err := augmentedProperties.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - // Storage version of v1api20211101.UserAssignedIdentityProperties_STATUS type UserAssignedIdentityProperties_STATUS struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` } -// AssignProperties_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties_STATUS from the provided source UserAssignedIdentityProperties_STATUS -func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_From_UserAssignedIdentityProperties_STATUS(source *v20240101s.UserAssignedIdentityProperties_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // UserAssignedIdentity - properties.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) - - // Update the property bag - if len(propertyBag) > 0 { - properties.PropertyBag = propertyBag - } else { - properties.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentityProperties_STATUS interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties_STATUS); ok { - err := augmentedProperties.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentityProperties_STATUS populates the provided destination UserAssignedIdentityProperties_STATUS from our UserAssignedIdentityProperties_STATUS -func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_To_UserAssignedIdentityProperties_STATUS(destination *v20240101s.UserAssignedIdentityProperties_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) - - // UserAssignedIdentity - destination.UserAssignedIdentity = genruntime.ClonePointerToString(properties.UserAssignedIdentity) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForUserAssignedIdentityProperties_STATUS interface (if implemented) to customize the conversion - var propertiesAsAny any = properties - if augmentedProperties, ok := propertiesAsAny.(augmentConversionForUserAssignedIdentityProperties_STATUS); ok { - err := augmentedProperties.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForUserAssignedIdentityProperties interface { - AssignPropertiesFrom(src *v20240101s.UserAssignedIdentityProperties) error - AssignPropertiesTo(dst *v20240101s.UserAssignedIdentityProperties) error -} - -type augmentConversionForUserAssignedIdentityProperties_STATUS interface { - AssignPropertiesFrom(src *v20240101s.UserAssignedIdentityProperties_STATUS) error - AssignPropertiesTo(dst *v20240101s.UserAssignedIdentityProperties_STATUS) error -} - func init() { SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go index ed90eefc437..20d9df9d7a3 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespace_types_gen_test.go @@ -5,7 +5,6 @@ package storage import ( "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -18,91 +17,6 @@ import ( "testing" ) -func Test_Namespace_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespace, NamespaceGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespace tests if a specific instance of Namespace round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespace(subject Namespace) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.Namespace - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual Namespace - 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_Namespace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace to Namespace via AssignProperties_To_Namespace & AssignProperties_From_Namespace returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespace, NamespaceGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespace tests if a specific instance of Namespace can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespace(subject Namespace) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Namespace - err := copied.AssignProperties_To_Namespace(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespace - err = actual.AssignProperties_From_Namespace(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -164,48 +78,6 @@ func AddRelatedPropertyGeneratorsForNamespace(gens map[string]gopter.Gen) { gens["Status"] = Namespace_STATUSGenerator() } -func Test_Namespace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace_Spec to Namespace_Spec via AssignProperties_To_Namespace_Spec & AssignProperties_From_Namespace_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespace_Spec, Namespace_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespace_Spec tests if a specific instance of Namespace_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_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 v20240101s.Namespace_Spec - err := copied.AssignProperties_To_Namespace_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespace_Spec - err = actual.AssignProperties_From_Namespace_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespace_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -292,48 +164,6 @@ func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { gens["Sku"] = gen.PtrOf(SkuGenerator()) } -func Test_Namespace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace_STATUS to Namespace_STATUS via AssignProperties_To_Namespace_STATUS & AssignProperties_From_Namespace_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespace_STATUS, Namespace_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespace_STATUS tests if a specific instance of Namespace_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_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 v20240101s.Namespace_STATUS - err := copied.AssignProperties_To_Namespace_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespace_STATUS - err = actual.AssignProperties_From_Namespace_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -429,48 +259,6 @@ func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } -func Test_Encryption_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Encryption to Encryption via AssignProperties_To_Encryption & AssignProperties_From_Encryption returns original", - prop.ForAll(RunPropertyAssignmentTestForEncryption, EncryptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForEncryption tests if a specific instance of Encryption can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForEncryption(subject Encryption) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Encryption - err := copied.AssignProperties_To_Encryption(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Encryption - err = actual.AssignProperties_From_Encryption(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Encryption_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -546,48 +334,6 @@ func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) } -func Test_Encryption_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Encryption_STATUS to Encryption_STATUS via AssignProperties_To_Encryption_STATUS & AssignProperties_From_Encryption_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForEncryption_STATUS, Encryption_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForEncryption_STATUS tests if a specific instance of Encryption_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_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 v20240101s.Encryption_STATUS - err := copied.AssignProperties_To_Encryption_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Encryption_STATUS - err = actual.AssignProperties_From_Encryption_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Encryption_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -663,48 +409,6 @@ func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) } -func Test_Identity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Identity to Identity via AssignProperties_To_Identity & AssignProperties_From_Identity returns original", - prop.ForAll(RunPropertyAssignmentTestForIdentity, IdentityGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForIdentity tests if a specific instance of Identity can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForIdentity(subject Identity) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Identity - err := copied.AssignProperties_To_Identity(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Identity - err = actual.AssignProperties_From_Identity(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -779,48 +483,6 @@ func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) } -func Test_Identity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Identity_STATUS to Identity_STATUS via AssignProperties_To_Identity_STATUS & AssignProperties_From_Identity_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForIdentity_STATUS, Identity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForIdentity_STATUS tests if a specific instance of Identity_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Identity_STATUS - err := copied.AssignProperties_To_Identity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Identity_STATUS - err = actual.AssignProperties_From_Identity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -897,48 +559,6 @@ func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUSGenerator()) } -func Test_NamespaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespaceOperatorSpec to NamespaceOperatorSpec via AssignProperties_To_NamespaceOperatorSpec & AssignProperties_From_NamespaceOperatorSpec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaceOperatorSpec tests if a specific instance of NamespaceOperatorSpec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespaceOperatorSpec - err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespaceOperatorSpec - err = actual.AssignProperties_From_NamespaceOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1000,71 +620,29 @@ func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) } -func Test_PrivateEndpointConnection_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { +func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 properties := gopter.NewProperties(parameters) properties.Property( - "Round trip from PrivateEndpointConnection_STATUS to PrivateEndpointConnection_STATUS via AssignProperties_To_PrivateEndpointConnection_STATUS & AssignProperties_From_PrivateEndpointConnection_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) + "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) } -// RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS tests if a specific instance of PrivateEndpointConnection_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_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 v20240101s.PrivateEndpointConnection_STATUS - err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) +// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) if err != nil { return err.Error() } - // Use AssignPropertiesFrom() to convert back to our original type + // Deserialize back into memory var actual PrivateEndpointConnection_STATUS - err = actual.AssignProperties_From_PrivateEndpointConnection_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual PrivateEndpointConnection_STATUS - err = json.Unmarshal(bin, &actual) + err = json.Unmarshal(bin, &actual) if err != nil { return err.Error() } @@ -1103,48 +681,6 @@ func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens ma gens["Id"] = gen.PtrOf(gen.AlphaString()) } -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 AssignProperties_To_Sku & AssignProperties_From_Sku 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 storage 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 v20240101s.Sku - err := copied.AssignProperties_To_Sku(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Sku - err = actual.AssignProperties_From_Sku(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1207,48 +743,6 @@ func AddIndependentPropertyGeneratorsForSku(gens map[string]gopter.Gen) { 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 AssignProperties_To_Sku_STATUS & AssignProperties_From_Sku_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForSku_STATUS, Sku_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForSku_STATUS tests if a specific instance of Sku_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForSku_STATUS(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 v20240101s.Sku_STATUS - err := copied.AssignProperties_To_Sku_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Sku_STATUS - err = actual.AssignProperties_From_Sku_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Sku_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1311,48 +805,6 @@ func AddIndependentPropertyGeneratorsForSku_STATUS(gens map[string]gopter.Gen) { gens["Tier"] = gen.PtrOf(gen.AlphaString()) } -func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.SystemData_STATUS - err := copied.AssignProperties_To_SystemData_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual SystemData_STATUS - err = actual.AssignProperties_From_SystemData_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1418,48 +870,6 @@ func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter gens["LastModifiedByType"] = 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 AssignProperties_To_KeyVaultProperties & AssignProperties_From_KeyVaultProperties 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 storage 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 v20240101s.KeyVaultProperties - err := copied.AssignProperties_To_KeyVaultProperties(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual KeyVaultProperties - err = actual.AssignProperties_From_KeyVaultProperties(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1536,48 +946,6 @@ func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Ge gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) } -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 AssignProperties_To_KeyVaultProperties_STATUS & AssignProperties_From_KeyVaultProperties_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForKeyVaultProperties_STATUS tests if a specific instance of KeyVaultProperties_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(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 v20240101s.KeyVaultProperties_STATUS - err := copied.AssignProperties_To_KeyVaultProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual KeyVaultProperties_STATUS - err = actual.AssignProperties_From_KeyVaultProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_KeyVaultProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1655,48 +1023,6 @@ func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]go gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) } -func Test_NamespaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespaceOperatorSecrets to NamespaceOperatorSecrets via AssignProperties_To_NamespaceOperatorSecrets & AssignProperties_From_NamespaceOperatorSecrets returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaceOperatorSecrets tests if a specific instance of NamespaceOperatorSecrets can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespaceOperatorSecrets - err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespaceOperatorSecrets - err = actual.AssignProperties_From_NamespaceOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1752,48 +1078,6 @@ func NamespaceOperatorSecretsGenerator() gopter.Gen { return namespaceOperatorSecretsGenerator } -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 AssignProperties_To_UserAssignedIdentity_STATUS & AssignProperties_From_UserAssignedIdentity_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentity_STATUS tests if a specific instance of UserAssignedIdentity_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(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 v20240101s.UserAssignedIdentity_STATUS - err := copied.AssignProperties_To_UserAssignedIdentity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentity_STATUS - err = actual.AssignProperties_From_UserAssignedIdentity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_UserAssignedIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1856,48 +1140,6 @@ func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(gens map[str gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) } -func Test_UserAssignedIdentityDetails_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from UserAssignedIdentityDetails to UserAssignedIdentityDetails via AssignProperties_To_UserAssignedIdentityDetails & AssignProperties_From_UserAssignedIdentityDetails returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentityDetails tests if a specific instance of UserAssignedIdentityDetails can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.UserAssignedIdentityDetails - err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentityDetails - err = actual.AssignProperties_From_UserAssignedIdentityDetails(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1953,48 +1195,6 @@ func UserAssignedIdentityDetailsGenerator() gopter.Gen { return userAssignedIdentityDetailsGenerator } -func Test_UserAssignedIdentityProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from UserAssignedIdentityProperties to UserAssignedIdentityProperties via AssignProperties_To_UserAssignedIdentityProperties & AssignProperties_From_UserAssignedIdentityProperties returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentityProperties tests if a specific instance of UserAssignedIdentityProperties can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.UserAssignedIdentityProperties - err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentityProperties - err = actual.AssignProperties_From_UserAssignedIdentityProperties(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_UserAssignedIdentityProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -2050,48 +1250,6 @@ func UserAssignedIdentityPropertiesGenerator() gopter.Gen { return userAssignedIdentityPropertiesGenerator } -func Test_UserAssignedIdentityProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from UserAssignedIdentityProperties_STATUS to UserAssignedIdentityProperties_STATUS via AssignProperties_To_UserAssignedIdentityProperties_STATUS & AssignProperties_From_UserAssignedIdentityProperties_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS tests if a specific instance of UserAssignedIdentityProperties_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_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 v20240101s.UserAssignedIdentityProperties_STATUS - err := copied.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentityProperties_STATUS - err = actual.AssignProperties_From_UserAssignedIdentityProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_UserAssignedIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go index a0bcb7913bc..ec9dccd3b9e 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen.go @@ -4,18 +4,19 @@ package storage import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespacesauthorizationrules/status,namespacesauthorizationrules/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" @@ -43,28 +44,6 @@ func (rule *NamespacesAuthorizationRule) SetConditions(conditions conditions.Con rule.Status.Conditions = conditions } -var _ conversion.Convertible = &NamespacesAuthorizationRule{} - -// ConvertFrom populates our NamespacesAuthorizationRule from the provided hub NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_From_NamespacesAuthorizationRule(source) -} - -// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) -} - var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -136,75 +115,8 @@ func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.Convertible return nil } -// AssignProperties_From_NamespacesAuthorizationRule populates our NamespacesAuthorizationRule from the provided source NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) AssignProperties_From_NamespacesAuthorizationRule(source *v20240101s.NamespacesAuthorizationRule) error { - - // ObjectMeta - rule.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_AuthorizationRule_Spec - err := spec.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_Spec() to populate field Spec") - } - rule.Spec = spec - - // Status - var status Namespaces_AuthorizationRule_STATUS - err = status.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_STATUS() to populate field Status") - } - rule.Status = status - - // Invoke the augmentConversionForNamespacesAuthorizationRule interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule); ok { - err := augmentedRule.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesAuthorizationRule populates the provided destination NamespacesAuthorizationRule from our NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) AssignProperties_To_NamespacesAuthorizationRule(destination *v20240101s.NamespacesAuthorizationRule) error { - - // ObjectMeta - destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_AuthorizationRule_Spec - err := rule.Spec.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_AuthorizationRule_STATUS - err = rule.Status.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_STATUS() to populate field Status") - } - destination.Status = status - - // Invoke the augmentConversionForNamespacesAuthorizationRule interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule); ok { - err := augmentedRule.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} +// Hub marks that this NamespacesAuthorizationRule is the hub type for conversion +func (rule *NamespacesAuthorizationRule) Hub() {} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { @@ -226,11 +138,6 @@ type NamespacesAuthorizationRuleList struct { Items []NamespacesAuthorizationRule `json:"items"` } -type augmentConversionForNamespacesAuthorizationRule interface { - AssignPropertiesFrom(src *v20240101s.NamespacesAuthorizationRule) error - AssignPropertiesTo(dst *v20240101s.NamespacesAuthorizationRule) error -} - // Storage version of v1api20211101.Namespaces_AuthorizationRule_Spec type Namespaces_AuthorizationRule_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 @@ -252,158 +159,20 @@ var _ genruntime.ConvertibleSpec = &Namespaces_AuthorizationRule_Spec{} // ConvertSpecFrom populates our Namespaces_AuthorizationRule_Spec from the provided source func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_Spec) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_AuthorizationRule_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil + return source.ConvertSpecTo(rule) } // ConvertSpecTo populates the provided destination from our Namespaces_AuthorizationRule_Spec func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_Spec) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_AuthorizationRule_Spec{} - err := rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()") + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // Update dst from our instance - err = dst.ConvertSpecTo(destination) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecTo()") - } - - return nil -} - -// AssignProperties_From_Namespaces_AuthorizationRule_Spec populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_Spec -func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_From_Namespaces_AuthorizationRule_Spec(source *v20240101s.Namespaces_AuthorizationRule_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // AzureName - rule.AzureName = source.AzureName - - // OperatorSpec - if source.OperatorSpec != nil { - var operatorSpec NamespacesAuthorizationRuleOperatorSpec - err := operatorSpec.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source.OperatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - rule.OperatorSpec = &operatorSpec - } else { - rule.OperatorSpec = nil - } - - // OriginalVersion - rule.OriginalVersion = source.OriginalVersion - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - rule.Owner = &owner - } else { - rule.Owner = nil - } - - // Rights - rule.Rights = genruntime.CloneSliceOfString(source.Rights) - - // Update the property bag - if len(propertyBag) > 0 { - rule.PropertyBag = propertyBag - } else { - rule.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_AuthorizationRule_Spec interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_Spec); ok { - err := augmentedRule.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_AuthorizationRule_Spec populates the provided destination Namespaces_AuthorizationRule_Spec from our Namespaces_AuthorizationRule_Spec -func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_AuthorizationRule_Spec(destination *v20240101s.Namespaces_AuthorizationRule_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) - - // AzureName - destination.AzureName = rule.AzureName - - // OperatorSpec - if rule.OperatorSpec != nil { - var operatorSpec v20240101s.NamespacesAuthorizationRuleOperatorSpec - err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - destination.OperatorSpec = &operatorSpec - } else { - destination.OperatorSpec = nil - } - - // OriginalVersion - destination.OriginalVersion = rule.OriginalVersion - - // Owner - if rule.Owner != nil { - owner := rule.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // Rights - destination.Rights = genruntime.CloneSliceOfString(rule.Rights) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_AuthorizationRule_Spec interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_Spec); ok { - err := augmentedRule.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil + return destination.ConvertSpecFrom(rule) } // Storage version of v1api20211101.Namespaces_AuthorizationRule_STATUS @@ -422,170 +191,20 @@ var _ genruntime.ConvertibleStatus = &Namespaces_AuthorizationRule_STATUS{} // ConvertStatusFrom populates our Namespaces_AuthorizationRule_STATUS from the provided source func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_STATUS) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_AuthorizationRule_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil + return source.ConvertStatusTo(rule) } // ConvertStatusTo populates the provided destination from our Namespaces_AuthorizationRule_STATUS func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_STATUS) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Convert to an intermediate form - dst = &v20240101s.Namespaces_AuthorizationRule_STATUS{} - err := rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(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 -} - -// AssignProperties_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_STATUS from the provided source Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_AuthorizationRule_STATUS(source *v20240101s.Namespaces_AuthorizationRule_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Conditions - rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // Id - rule.Id = genruntime.ClonePointerToString(source.Id) - - // Location - rule.Location = genruntime.ClonePointerToString(source.Location) - - // Name - rule.Name = genruntime.ClonePointerToString(source.Name) - - // Rights - rule.Rights = genruntime.CloneSliceOfString(source.Rights) - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - rule.SystemData = &systemDatum - } else { - rule.SystemData = nil - } - - // Type - rule.Type = genruntime.ClonePointerToString(source.Type) - - // Update the property bag - if len(propertyBag) > 0 { - rule.PropertyBag = propertyBag - } else { - rule.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_AuthorizationRule_STATUS interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_STATUS); ok { - err := augmentedRule.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_AuthorizationRule_STATUS populates the provided destination Namespaces_AuthorizationRule_STATUS from our Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_AuthorizationRule_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) - - // Id - destination.Id = genruntime.ClonePointerToString(rule.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(rule.Location) - - // Name - destination.Name = genruntime.ClonePointerToString(rule.Name) - - // Rights - destination.Rights = genruntime.CloneSliceOfString(rule.Rights) - - // SystemData - if rule.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(rule.Type) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_AuthorizationRule_STATUS interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_STATUS); ok { - err := augmentedRule.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespaces_AuthorizationRule_Spec interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_AuthorizationRule_Spec) error - AssignPropertiesTo(dst *v20240101s.Namespaces_AuthorizationRule_Spec) error -} - -type augmentConversionForNamespaces_AuthorizationRule_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_AuthorizationRule_STATUS) error - AssignPropertiesTo(dst *v20240101s.Namespaces_AuthorizationRule_STATUS) error + return destination.ConvertStatusFrom(rule) } // Storage version of v1api20211101.NamespacesAuthorizationRuleOperatorSpec @@ -595,85 +214,6 @@ type NamespacesAuthorizationRuleOperatorSpec struct { Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` } -// AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec populates our NamespacesAuthorizationRuleOperatorSpec from the provided source NamespacesAuthorizationRuleOperatorSpec -func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Secrets - if source.Secrets != nil { - var secret NamespacesAuthorizationRuleOperatorSecrets - err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets") - } - operator.Secrets = &secret - } else { - operator.Secrets = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - operator.PropertyBag = propertyBag - } else { - operator.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion - var operatorAsAny any = operator - if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSpec); ok { - err := augmentedOperator.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec populates the provided destination NamespacesAuthorizationRuleOperatorSpec from our NamespacesAuthorizationRuleOperatorSpec -func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) - - // Secrets - if operator.Secrets != nil { - var secret v20240101s.NamespacesAuthorizationRuleOperatorSecrets - err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets") - } - destination.Secrets = &secret - } else { - destination.Secrets = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion - var operatorAsAny any = operator - if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSpec); ok { - err := augmentedOperator.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface { - AssignPropertiesFrom(src *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error - AssignPropertiesTo(dst *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error -} - // Storage version of v1api20211101.NamespacesAuthorizationRuleOperatorSecrets type NamespacesAuthorizationRuleOperatorSecrets struct { PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` @@ -683,125 +223,6 @@ type NamespacesAuthorizationRuleOperatorSecrets struct { SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` } -// AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets populates our NamespacesAuthorizationRuleOperatorSecrets from the provided source NamespacesAuthorizationRuleOperatorSecrets -func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // PrimaryConnectionString - if source.PrimaryConnectionString != nil { - primaryConnectionString := source.PrimaryConnectionString.Copy() - secrets.PrimaryConnectionString = &primaryConnectionString - } else { - secrets.PrimaryConnectionString = nil - } - - // PrimaryKey - if source.PrimaryKey != nil { - primaryKey := source.PrimaryKey.Copy() - secrets.PrimaryKey = &primaryKey - } else { - secrets.PrimaryKey = nil - } - - // SecondaryConnectionString - if source.SecondaryConnectionString != nil { - secondaryConnectionString := source.SecondaryConnectionString.Copy() - secrets.SecondaryConnectionString = &secondaryConnectionString - } else { - secrets.SecondaryConnectionString = nil - } - - // SecondaryKey - if source.SecondaryKey != nil { - secondaryKey := source.SecondaryKey.Copy() - secrets.SecondaryKey = &secondaryKey - } else { - secrets.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - secrets.PropertyBag = propertyBag - } else { - secrets.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion - var secretsAsAny any = secrets - if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSecrets); ok { - err := augmentedSecrets.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets populates the provided destination NamespacesAuthorizationRuleOperatorSecrets from our NamespacesAuthorizationRuleOperatorSecrets -func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) - - // PrimaryConnectionString - if secrets.PrimaryConnectionString != nil { - primaryConnectionString := secrets.PrimaryConnectionString.Copy() - destination.PrimaryConnectionString = &primaryConnectionString - } else { - destination.PrimaryConnectionString = nil - } - - // PrimaryKey - if secrets.PrimaryKey != nil { - primaryKey := secrets.PrimaryKey.Copy() - destination.PrimaryKey = &primaryKey - } else { - destination.PrimaryKey = nil - } - - // SecondaryConnectionString - if secrets.SecondaryConnectionString != nil { - secondaryConnectionString := secrets.SecondaryConnectionString.Copy() - destination.SecondaryConnectionString = &secondaryConnectionString - } else { - destination.SecondaryConnectionString = nil - } - - // SecondaryKey - if secrets.SecondaryKey != nil { - secondaryKey := secrets.SecondaryKey.Copy() - destination.SecondaryKey = &secondaryKey - } else { - destination.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion - var secretsAsAny any = secrets - if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSecrets); ok { - err := augmentedSecrets.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface { - AssignPropertiesFrom(src *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error - AssignPropertiesTo(dst *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error -} - func init() { SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go index cb1d68dba27..bffb499b5ec 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go @@ -5,7 +5,6 @@ package storage import ( "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -18,91 +17,6 @@ import ( "testing" ) -func Test_NamespacesAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRule to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesAuthorizationRule - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesAuthorizationRule - 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_NamespacesAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRule to NamespacesAuthorizationRule via AssignProperties_To_NamespacesAuthorizationRule & AssignProperties_From_NamespacesAuthorizationRule returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesAuthorizationRule - err := copied.AssignProperties_To_NamespacesAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesAuthorizationRule - err = actual.AssignProperties_From_NamespacesAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -165,48 +79,6 @@ func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(gens map[string] gens["Status"] = Namespaces_AuthorizationRule_STATUSGenerator() } -func Test_Namespaces_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_AuthorizationRule_Spec to Namespaces_AuthorizationRule_Spec via AssignProperties_To_Namespaces_AuthorizationRule_Spec & AssignProperties_From_Namespaces_AuthorizationRule_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec tests if a specific instance of Namespaces_AuthorizationRule_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_Spec - err := copied.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_AuthorizationRule_Spec - err = actual.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -284,48 +156,6 @@ func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[s gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) } -func Test_Namespaces_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_AuthorizationRule_STATUS to Namespaces_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_AuthorizationRule_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS tests if a specific instance of Namespaces_AuthorizationRule_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_STATUS - err := copied.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_AuthorizationRule_STATUS - err = actual.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -405,48 +235,6 @@ func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } -func Test_NamespacesAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRuleOperatorSpec to NamespacesAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesAuthorizationRuleOperatorSpec - err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesAuthorizationRuleOperatorSpec - err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -508,48 +296,6 @@ func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) } -func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRuleOperatorSecrets to NamespacesAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesAuthorizationRuleOperatorSecrets - err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesAuthorizationRuleOperatorSecrets - err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go index b0eccd0e4df..97bec1cec9e 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen.go @@ -4,18 +4,19 @@ package storage import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubs/status,namespaceseventhubs/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" @@ -43,28 +44,6 @@ func (eventhub *NamespacesEventhub) SetConditions(conditions conditions.Conditio eventhub.Status.Conditions = conditions } -var _ conversion.Convertible = &NamespacesEventhub{} - -// ConvertFrom populates our NamespacesEventhub from the provided hub NamespacesEventhub -func (eventhub *NamespacesEventhub) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesEventhub) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) - } - - return eventhub.AssignProperties_From_NamespacesEventhub(source) -} - -// ConvertTo populates the provided hub NamespacesEventhub from our NamespacesEventhub -func (eventhub *NamespacesEventhub) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesEventhub) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) - } - - return eventhub.AssignProperties_To_NamespacesEventhub(destination) -} - var _ genruntime.KubernetesResource = &NamespacesEventhub{} // AzureName returns the Azure name of the resource @@ -136,75 +115,8 @@ func (eventhub *NamespacesEventhub) SetStatus(status genruntime.ConvertibleStatu return nil } -// AssignProperties_From_NamespacesEventhub populates our NamespacesEventhub from the provided source NamespacesEventhub -func (eventhub *NamespacesEventhub) AssignProperties_From_NamespacesEventhub(source *v20240101s.NamespacesEventhub) error { - - // ObjectMeta - eventhub.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_Eventhub_Spec - err := spec.AssignProperties_From_Namespaces_Eventhub_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_Spec() to populate field Spec") - } - eventhub.Spec = spec - - // Status - var status Namespaces_Eventhub_STATUS - err = status.AssignProperties_From_Namespaces_Eventhub_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_STATUS() to populate field Status") - } - eventhub.Status = status - - // Invoke the augmentConversionForNamespacesEventhub interface (if implemented) to customize the conversion - var eventhubAsAny any = eventhub - if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespacesEventhub); ok { - err := augmentedEventhub.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhub populates the provided destination NamespacesEventhub from our NamespacesEventhub -func (eventhub *NamespacesEventhub) AssignProperties_To_NamespacesEventhub(destination *v20240101s.NamespacesEventhub) error { - - // ObjectMeta - destination.ObjectMeta = *eventhub.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_Eventhub_Spec - err := eventhub.Spec.AssignProperties_To_Namespaces_Eventhub_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_Eventhub_STATUS - err = eventhub.Status.AssignProperties_To_Namespaces_Eventhub_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_STATUS() to populate field Status") - } - destination.Status = status - - // Invoke the augmentConversionForNamespacesEventhub interface (if implemented) to customize the conversion - var eventhubAsAny any = eventhub - if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespacesEventhub); ok { - err := augmentedEventhub.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} +// Hub marks that this NamespacesEventhub is the hub type for conversion +func (eventhub *NamespacesEventhub) Hub() {} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (eventhub *NamespacesEventhub) OriginalGVK() *schema.GroupVersionKind { @@ -226,11 +138,6 @@ type NamespacesEventhubList struct { Items []NamespacesEventhub `json:"items"` } -type augmentConversionForNamespacesEventhub interface { - AssignPropertiesFrom(src *v20240101s.NamespacesEventhub) error - AssignPropertiesTo(dst *v20240101s.NamespacesEventhub) error -} - // Storage version of v1api20211101.Namespaces_Eventhub_Spec type Namespaces_Eventhub_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 @@ -253,184 +160,20 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Eventhub_Spec{} // ConvertSpecFrom populates our Namespaces_Eventhub_Spec from the provided source func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_Eventhub_Spec) - if ok { - // Populate our instance from source - return eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) + if source == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhub_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") - } - - // Update our instance from src - err = eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil + return source.ConvertSpecTo(eventhub) } // ConvertSpecTo populates the provided destination from our Namespaces_Eventhub_Spec func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhub_Spec) - if ok { - // Populate destination from our instance - return eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhub_Spec{} - err := eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(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 -} - -// AssignProperties_From_Namespaces_Eventhub_Spec populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_Spec -func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_From_Namespaces_Eventhub_Spec(source *v20240101s.Namespaces_Eventhub_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // AzureName - eventhub.AzureName = source.AzureName - - // CaptureDescription - if source.CaptureDescription != nil { - var captureDescription CaptureDescription - err := captureDescription.AssignProperties_From_CaptureDescription(source.CaptureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription() to populate field CaptureDescription") - } - eventhub.CaptureDescription = &captureDescription - } else { - eventhub.CaptureDescription = nil - } - - // MessageRetentionInDays - eventhub.MessageRetentionInDays = genruntime.ClonePointerToInt(source.MessageRetentionInDays) - - // OriginalVersion - eventhub.OriginalVersion = source.OriginalVersion - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - eventhub.Owner = &owner - } else { - eventhub.Owner = nil - } - - // PartitionCount - eventhub.PartitionCount = genruntime.ClonePointerToInt(source.PartitionCount) - - // RetentionDescription - if source.RetentionDescription != nil { - propertyBag.Add("RetentionDescription", *source.RetentionDescription) - } else { - propertyBag.Remove("RetentionDescription") - } - - // Update the property bag - if len(propertyBag) > 0 { - eventhub.PropertyBag = propertyBag - } else { - eventhub.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhub_Spec interface (if implemented) to customize the conversion - var eventhubAsAny any = eventhub - if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_Spec); ok { - err := augmentedEventhub.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } + if destination == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhub_Spec populates the provided destination Namespaces_Eventhub_Spec from our Namespaces_Eventhub_Spec -func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_To_Namespaces_Eventhub_Spec(destination *v20240101s.Namespaces_Eventhub_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(eventhub.PropertyBag) - - // AzureName - destination.AzureName = eventhub.AzureName - - // CaptureDescription - if eventhub.CaptureDescription != nil { - var captureDescription v20240101s.CaptureDescription - err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription(&captureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription() to populate field CaptureDescription") - } - destination.CaptureDescription = &captureDescription - } else { - destination.CaptureDescription = nil - } - - // MessageRetentionInDays - destination.MessageRetentionInDays = genruntime.ClonePointerToInt(eventhub.MessageRetentionInDays) - - // OriginalVersion - destination.OriginalVersion = eventhub.OriginalVersion - - // Owner - if eventhub.Owner != nil { - owner := eventhub.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // PartitionCount - destination.PartitionCount = genruntime.ClonePointerToInt(eventhub.PartitionCount) - - // RetentionDescription - if propertyBag.Contains("RetentionDescription") { - var retentionDescription v20240101s.RetentionDescription - err := propertyBag.Pull("RetentionDescription", &retentionDescription) - if err != nil { - return errors.Wrap(err, "pulling 'RetentionDescription' from propertyBag") - } - - destination.RetentionDescription = &retentionDescription - } else { - destination.RetentionDescription = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhub_Spec interface (if implemented) to customize the conversion - var eventhubAsAny any = eventhub - if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_Spec); ok { - err := augmentedEventhub.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil + return destination.ConvertSpecFrom(eventhub) } // Storage version of v1api20211101.Namespaces_Eventhub_STATUS @@ -455,244 +198,20 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Eventhub_STATUS{} // ConvertStatusFrom populates our Namespaces_Eventhub_STATUS from the provided source func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_Eventhub_STATUS) - if ok { - // Populate our instance from source - return eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) + if source == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhub_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") - } - - // Update our instance from src - err = eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil + return source.ConvertStatusTo(eventhub) } // ConvertStatusTo populates the provided destination from our Namespaces_Eventhub_STATUS func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhub_STATUS) - if ok { - // Populate destination from our instance - return eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhub_STATUS{} - err := eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(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 -} - -// AssignProperties_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_STATUS from the provided source Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_From_Namespaces_Eventhub_STATUS(source *v20240101s.Namespaces_Eventhub_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // CaptureDescription - if source.CaptureDescription != nil { - var captureDescription CaptureDescription_STATUS - err := captureDescription.AssignProperties_From_CaptureDescription_STATUS(source.CaptureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription_STATUS() to populate field CaptureDescription") - } - eventhub.CaptureDescription = &captureDescription - } else { - eventhub.CaptureDescription = nil - } - - // Conditions - eventhub.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // CreatedAt - eventhub.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) - - // Id - eventhub.Id = genruntime.ClonePointerToString(source.Id) - - // Location - eventhub.Location = genruntime.ClonePointerToString(source.Location) - - // MessageRetentionInDays - eventhub.MessageRetentionInDays = genruntime.ClonePointerToInt(source.MessageRetentionInDays) - - // Name - eventhub.Name = genruntime.ClonePointerToString(source.Name) - - // PartitionCount - eventhub.PartitionCount = genruntime.ClonePointerToInt(source.PartitionCount) - - // PartitionIds - eventhub.PartitionIds = genruntime.CloneSliceOfString(source.PartitionIds) - - // RetentionDescription - if source.RetentionDescription != nil { - propertyBag.Add("RetentionDescription", *source.RetentionDescription) - } else { - propertyBag.Remove("RetentionDescription") - } - - // Status - eventhub.Status = genruntime.ClonePointerToString(source.Status) - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - eventhub.SystemData = &systemDatum - } else { - eventhub.SystemData = nil - } - - // Type - eventhub.Type = genruntime.ClonePointerToString(source.Type) - - // UpdatedAt - eventhub.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) - - // Update the property bag - if len(propertyBag) > 0 { - eventhub.PropertyBag = propertyBag - } else { - eventhub.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhub_STATUS interface (if implemented) to customize the conversion - var eventhubAsAny any = eventhub - if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_STATUS); ok { - err := augmentedEventhub.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhub_STATUS populates the provided destination Namespaces_Eventhub_STATUS from our Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_To_Namespaces_Eventhub_STATUS(destination *v20240101s.Namespaces_Eventhub_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(eventhub.PropertyBag) - - // CaptureDescription - if eventhub.CaptureDescription != nil { - var captureDescription v20240101s.CaptureDescription_STATUS - err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription_STATUS(&captureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription_STATUS() to populate field CaptureDescription") - } - destination.CaptureDescription = &captureDescription - } else { - destination.CaptureDescription = nil - } - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(eventhub.Conditions) - - // CreatedAt - destination.CreatedAt = genruntime.ClonePointerToString(eventhub.CreatedAt) - - // Id - destination.Id = genruntime.ClonePointerToString(eventhub.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(eventhub.Location) - - // MessageRetentionInDays - destination.MessageRetentionInDays = genruntime.ClonePointerToInt(eventhub.MessageRetentionInDays) - - // Name - destination.Name = genruntime.ClonePointerToString(eventhub.Name) - - // PartitionCount - destination.PartitionCount = genruntime.ClonePointerToInt(eventhub.PartitionCount) - - // PartitionIds - destination.PartitionIds = genruntime.CloneSliceOfString(eventhub.PartitionIds) - - // RetentionDescription - if propertyBag.Contains("RetentionDescription") { - var retentionDescription v20240101s.RetentionDescription_STATUS - err := propertyBag.Pull("RetentionDescription", &retentionDescription) - if err != nil { - return errors.Wrap(err, "pulling 'RetentionDescription' from propertyBag") - } - - destination.RetentionDescription = &retentionDescription - } else { - destination.RetentionDescription = nil + if destination == eventhub { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Status - destination.Status = genruntime.ClonePointerToString(eventhub.Status) - - // SystemData - if eventhub.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := eventhub.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(eventhub.Type) - - // UpdatedAt - destination.UpdatedAt = genruntime.ClonePointerToString(eventhub.UpdatedAt) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhub_STATUS interface (if implemented) to customize the conversion - var eventhubAsAny any = eventhub - if augmentedEventhub, ok := eventhubAsAny.(augmentConversionForNamespaces_Eventhub_STATUS); ok { - err := augmentedEventhub.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespaces_Eventhub_Spec interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhub_Spec) error - AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhub_Spec) error -} - -type augmentConversionForNamespaces_Eventhub_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhub_STATUS) error - AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhub_STATUS) error + return destination.ConvertStatusFrom(eventhub) } // Storage version of v1api20211101.CaptureDescription @@ -707,130 +226,6 @@ type CaptureDescription struct { SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` } -// AssignProperties_From_CaptureDescription populates our CaptureDescription from the provided source CaptureDescription -func (description *CaptureDescription) AssignProperties_From_CaptureDescription(source *v20240101s.CaptureDescription) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Destination - if source.Destination != nil { - var destination Destination - err := destination.AssignProperties_From_Destination(source.Destination) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Destination() to populate field Destination") - } - description.Destination = &destination - } else { - description.Destination = nil - } - - // Enabled - if source.Enabled != nil { - enabled := *source.Enabled - description.Enabled = &enabled - } else { - description.Enabled = nil - } - - // Encoding - description.Encoding = genruntime.ClonePointerToString(source.Encoding) - - // IntervalInSeconds - description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) - - // SizeLimitInBytes - description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) - - // SkipEmptyArchives - if source.SkipEmptyArchives != nil { - skipEmptyArchive := *source.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchive - } else { - description.SkipEmptyArchives = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - description.PropertyBag = propertyBag - } else { - description.PropertyBag = nil - } - - // Invoke the augmentConversionForCaptureDescription interface (if implemented) to customize the conversion - var descriptionAsAny any = description - if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription); ok { - err := augmentedDescription.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_CaptureDescription populates the provided destination CaptureDescription from our CaptureDescription -func (description *CaptureDescription) AssignProperties_To_CaptureDescription(destination *v20240101s.CaptureDescription) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(description.PropertyBag) - - // Destination - if description.Destination != nil { - var destinationLocal v20240101s.Destination - err := description.Destination.AssignProperties_To_Destination(&destinationLocal) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Destination() to populate field Destination") - } - destination.Destination = &destinationLocal - } else { - destination.Destination = nil - } - - // Enabled - if description.Enabled != nil { - enabled := *description.Enabled - destination.Enabled = &enabled - } else { - destination.Enabled = nil - } - - // Encoding - destination.Encoding = genruntime.ClonePointerToString(description.Encoding) - - // IntervalInSeconds - destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) - - // SizeLimitInBytes - destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) - - // SkipEmptyArchives - if description.SkipEmptyArchives != nil { - skipEmptyArchive := *description.SkipEmptyArchives - destination.SkipEmptyArchives = &skipEmptyArchive - } else { - destination.SkipEmptyArchives = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForCaptureDescription interface (if implemented) to customize the conversion - var descriptionAsAny any = description - if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription); ok { - err := augmentedDescription.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - // Storage version of v1api20211101.CaptureDescription_STATUS // Properties to configure capture description for eventhub type CaptureDescription_STATUS struct { @@ -843,140 +238,6 @@ type CaptureDescription_STATUS struct { SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` } -// AssignProperties_From_CaptureDescription_STATUS populates our CaptureDescription_STATUS from the provided source CaptureDescription_STATUS -func (description *CaptureDescription_STATUS) AssignProperties_From_CaptureDescription_STATUS(source *v20240101s.CaptureDescription_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Destination - if source.Destination != nil { - var destination Destination_STATUS - err := destination.AssignProperties_From_Destination_STATUS(source.Destination) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Destination_STATUS() to populate field Destination") - } - description.Destination = &destination - } else { - description.Destination = nil - } - - // Enabled - if source.Enabled != nil { - enabled := *source.Enabled - description.Enabled = &enabled - } else { - description.Enabled = nil - } - - // Encoding - description.Encoding = genruntime.ClonePointerToString(source.Encoding) - - // IntervalInSeconds - description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) - - // SizeLimitInBytes - description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) - - // SkipEmptyArchives - if source.SkipEmptyArchives != nil { - skipEmptyArchive := *source.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchive - } else { - description.SkipEmptyArchives = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - description.PropertyBag = propertyBag - } else { - description.PropertyBag = nil - } - - // Invoke the augmentConversionForCaptureDescription_STATUS interface (if implemented) to customize the conversion - var descriptionAsAny any = description - if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription_STATUS); ok { - err := augmentedDescription.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_CaptureDescription_STATUS populates the provided destination CaptureDescription_STATUS from our CaptureDescription_STATUS -func (description *CaptureDescription_STATUS) AssignProperties_To_CaptureDescription_STATUS(destination *v20240101s.CaptureDescription_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(description.PropertyBag) - - // Destination - if description.Destination != nil { - var destinationLocal v20240101s.Destination_STATUS - err := description.Destination.AssignProperties_To_Destination_STATUS(&destinationLocal) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Destination_STATUS() to populate field Destination") - } - destination.Destination = &destinationLocal - } else { - destination.Destination = nil - } - - // Enabled - if description.Enabled != nil { - enabled := *description.Enabled - destination.Enabled = &enabled - } else { - destination.Enabled = nil - } - - // Encoding - destination.Encoding = genruntime.ClonePointerToString(description.Encoding) - - // IntervalInSeconds - destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) - - // SizeLimitInBytes - destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) - - // SkipEmptyArchives - if description.SkipEmptyArchives != nil { - skipEmptyArchive := *description.SkipEmptyArchives - destination.SkipEmptyArchives = &skipEmptyArchive - } else { - destination.SkipEmptyArchives = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForCaptureDescription_STATUS interface (if implemented) to customize the conversion - var descriptionAsAny any = description - if augmentedDescription, ok := descriptionAsAny.(augmentConversionForCaptureDescription_STATUS); ok { - err := augmentedDescription.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForCaptureDescription interface { - AssignPropertiesFrom(src *v20240101s.CaptureDescription) error - AssignPropertiesTo(dst *v20240101s.CaptureDescription) error -} - -type augmentConversionForCaptureDescription_STATUS interface { - AssignPropertiesFrom(src *v20240101s.CaptureDescription_STATUS) error - AssignPropertiesTo(dst *v20240101s.CaptureDescription_STATUS) error -} - // Storage version of v1api20211101.Destination // Capture storage details for capture description type Destination struct { @@ -992,128 +253,6 @@ type Destination struct { StorageAccountResourceReference *genruntime.ResourceReference `armReference:"StorageAccountResourceId" json:"storageAccountResourceReference,omitempty"` } -// AssignProperties_From_Destination populates our Destination from the provided source Destination -func (destination *Destination) AssignProperties_From_Destination(source *v20240101s.Destination) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // ArchiveNameFormat - destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) - - // BlobContainer - destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) - - // DataLakeAccountName - destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) - - // DataLakeFolderPath - destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) - - // DataLakeSubscriptionId - destination.DataLakeSubscriptionId = genruntime.ClonePointerToString(source.DataLakeSubscriptionId) - - // Identity - if source.Identity != nil { - propertyBag.Add("Identity", *source.Identity) - } else { - propertyBag.Remove("Identity") - } - - // Name - destination.Name = genruntime.ClonePointerToString(source.Name) - - // StorageAccountResourceReference - if source.StorageAccountResourceReference != nil { - storageAccountResourceReference := source.StorageAccountResourceReference.Copy() - destination.StorageAccountResourceReference = &storageAccountResourceReference - } else { - destination.StorageAccountResourceReference = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForDestination interface (if implemented) to customize the conversion - var destinationAsAny any = destination - if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination); ok { - err := augmentedDestination.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Destination populates the provided destination Destination from our Destination -func (destination *Destination) AssignProperties_To_Destination(target *v20240101s.Destination) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(destination.PropertyBag) - - // ArchiveNameFormat - target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) - - // BlobContainer - target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) - - // DataLakeAccountName - target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) - - // DataLakeFolderPath - target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) - - // DataLakeSubscriptionId - target.DataLakeSubscriptionId = genruntime.ClonePointerToString(destination.DataLakeSubscriptionId) - - // Identity - if propertyBag.Contains("Identity") { - var identity v20240101s.CaptureIdentity - err := propertyBag.Pull("Identity", &identity) - if err != nil { - return errors.Wrap(err, "pulling 'Identity' from propertyBag") - } - - target.Identity = &identity - } else { - target.Identity = nil - } - - // Name - target.Name = genruntime.ClonePointerToString(destination.Name) - - // StorageAccountResourceReference - if destination.StorageAccountResourceReference != nil { - storageAccountResourceReference := destination.StorageAccountResourceReference.Copy() - target.StorageAccountResourceReference = &storageAccountResourceReference - } else { - target.StorageAccountResourceReference = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - target.PropertyBag = propertyBag - } else { - target.PropertyBag = nil - } - - // Invoke the augmentConversionForDestination interface (if implemented) to customize the conversion - var destinationAsAny any = destination - if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination); ok { - err := augmentedDestination.AssignPropertiesTo(target) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - // Storage version of v1api20211101.Destination_STATUS // Capture storage details for capture description type Destination_STATUS struct { @@ -1127,128 +266,6 @@ type Destination_STATUS struct { StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` } -// AssignProperties_From_Destination_STATUS populates our Destination_STATUS from the provided source Destination_STATUS -func (destination *Destination_STATUS) AssignProperties_From_Destination_STATUS(source *v20240101s.Destination_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // ArchiveNameFormat - destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) - - // BlobContainer - destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) - - // DataLakeAccountName - destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) - - // DataLakeFolderPath - destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) - - // DataLakeSubscriptionId - destination.DataLakeSubscriptionId = genruntime.ClonePointerToString(source.DataLakeSubscriptionId) - - // Identity - if source.Identity != nil { - propertyBag.Add("Identity", *source.Identity) - } else { - propertyBag.Remove("Identity") - } - - // Name - destination.Name = genruntime.ClonePointerToString(source.Name) - - // StorageAccountResourceId - destination.StorageAccountResourceId = genruntime.ClonePointerToString(source.StorageAccountResourceId) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForDestination_STATUS interface (if implemented) to customize the conversion - var destinationAsAny any = destination - if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination_STATUS); ok { - err := augmentedDestination.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Destination_STATUS populates the provided destination Destination_STATUS from our Destination_STATUS -func (destination *Destination_STATUS) AssignProperties_To_Destination_STATUS(target *v20240101s.Destination_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(destination.PropertyBag) - - // ArchiveNameFormat - target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) - - // BlobContainer - target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) - - // DataLakeAccountName - target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) - - // DataLakeFolderPath - target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) - - // DataLakeSubscriptionId - target.DataLakeSubscriptionId = genruntime.ClonePointerToString(destination.DataLakeSubscriptionId) - - // Identity - if propertyBag.Contains("Identity") { - var identity v20240101s.CaptureIdentity_STATUS - err := propertyBag.Pull("Identity", &identity) - if err != nil { - return errors.Wrap(err, "pulling 'Identity' from propertyBag") - } - - target.Identity = &identity - } else { - target.Identity = nil - } - - // Name - target.Name = genruntime.ClonePointerToString(destination.Name) - - // StorageAccountResourceId - target.StorageAccountResourceId = genruntime.ClonePointerToString(destination.StorageAccountResourceId) - - // Update the property bag - if len(propertyBag) > 0 { - target.PropertyBag = propertyBag - } else { - target.PropertyBag = nil - } - - // Invoke the augmentConversionForDestination_STATUS interface (if implemented) to customize the conversion - var destinationAsAny any = destination - if augmentedDestination, ok := destinationAsAny.(augmentConversionForDestination_STATUS); ok { - err := augmentedDestination.AssignPropertiesTo(target) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForDestination interface { - AssignPropertiesFrom(src *v20240101s.Destination) error - AssignPropertiesTo(dst *v20240101s.Destination) error -} - -type augmentConversionForDestination_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Destination_STATUS) error - AssignPropertiesTo(dst *v20240101s.Destination_STATUS) error -} - func init() { SchemeBuilder.Register(&NamespacesEventhub{}, &NamespacesEventhubList{}) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go index b7b32e33b13..34b01957fe3 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhub_types_gen_test.go @@ -5,7 +5,6 @@ package storage import ( "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -18,91 +17,6 @@ import ( "testing" ) -func Test_NamespacesEventhub_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhub to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesEventhub, NamespacesEventhubGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesEventhub(subject NamespacesEventhub) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesEventhub - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesEventhub - 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_NamespacesEventhub_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhub to NamespacesEventhub via AssignProperties_To_NamespacesEventhub & AssignProperties_From_NamespacesEventhub returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhub, NamespacesEventhubGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhub(subject NamespacesEventhub) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhub - err := copied.AssignProperties_To_NamespacesEventhub(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhub - err = actual.AssignProperties_From_NamespacesEventhub(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesEventhub_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -164,48 +78,6 @@ func AddRelatedPropertyGeneratorsForNamespacesEventhub(gens map[string]gopter.Ge gens["Status"] = Namespaces_Eventhub_STATUSGenerator() } -func Test_Namespaces_Eventhub_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhub_Spec to Namespaces_Eventhub_Spec via AssignProperties_To_Namespaces_Eventhub_Spec & AssignProperties_From_Namespaces_Eventhub_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhub_Spec tests if a specific instance of Namespaces_Eventhub_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_Spec - err := copied.AssignProperties_To_Namespaces_Eventhub_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhub_Spec - err = actual.AssignProperties_From_Namespaces_Eventhub_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_Eventhub_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -284,48 +156,6 @@ func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gop gens["CaptureDescription"] = gen.PtrOf(CaptureDescriptionGenerator()) } -func Test_Namespaces_Eventhub_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhub_STATUS to Namespaces_Eventhub_STATUS via AssignProperties_To_Namespaces_Eventhub_STATUS & AssignProperties_From_Namespaces_Eventhub_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS tests if a specific instance of Namespaces_Eventhub_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_STATUS - err := copied.AssignProperties_To_Namespaces_Eventhub_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhub_STATUS - err = actual.AssignProperties_From_Namespaces_Eventhub_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_Eventhub_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -411,48 +241,6 @@ func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]g gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } -func Test_CaptureDescription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from CaptureDescription to CaptureDescription via AssignProperties_To_CaptureDescription & AssignProperties_From_CaptureDescription returns original", - prop.ForAll(RunPropertyAssignmentTestForCaptureDescription, CaptureDescriptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForCaptureDescription tests if a specific instance of CaptureDescription can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForCaptureDescription(subject CaptureDescription) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.CaptureDescription - err := copied.AssignProperties_To_CaptureDescription(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual CaptureDescription - err = actual.AssignProperties_From_CaptureDescription(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_CaptureDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -531,48 +319,6 @@ func AddRelatedPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Ge gens["Destination"] = gen.PtrOf(DestinationGenerator()) } -func Test_CaptureDescription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from CaptureDescription_STATUS to CaptureDescription_STATUS via AssignProperties_To_CaptureDescription_STATUS & AssignProperties_From_CaptureDescription_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForCaptureDescription_STATUS tests if a specific instance of CaptureDescription_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForCaptureDescription_STATUS(subject CaptureDescription_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 v20240101s.CaptureDescription_STATUS - err := copied.AssignProperties_To_CaptureDescription_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual CaptureDescription_STATUS - err = actual.AssignProperties_From_CaptureDescription_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_CaptureDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -652,48 +398,6 @@ func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]go gens["Destination"] = gen.PtrOf(Destination_STATUSGenerator()) } -func Test_Destination_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Destination to Destination via AssignProperties_To_Destination & AssignProperties_From_Destination returns original", - prop.ForAll(RunPropertyAssignmentTestForDestination, DestinationGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForDestination tests if a specific instance of Destination can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForDestination(subject Destination) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Destination - err := copied.AssignProperties_To_Destination(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Destination - err = actual.AssignProperties_From_Destination(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Destination_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -759,48 +463,6 @@ func AddIndependentPropertyGeneratorsForDestination(gens map[string]gopter.Gen) gens["Name"] = gen.PtrOf(gen.AlphaString()) } -func Test_Destination_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Destination_STATUS to Destination_STATUS via AssignProperties_To_Destination_STATUS & AssignProperties_From_Destination_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForDestination_STATUS, Destination_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForDestination_STATUS tests if a specific instance of Destination_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForDestination_STATUS(subject Destination_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 v20240101s.Destination_STATUS - err := copied.AssignProperties_To_Destination_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Destination_STATUS - err = actual.AssignProperties_From_Destination_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Destination_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go index 00c0cd79cc0..2024f470e27 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen.go @@ -4,18 +4,19 @@ package storage import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsauthorizationrules/status,namespaceseventhubsauthorizationrules/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" @@ -43,28 +44,6 @@ func (rule *NamespacesEventhubsAuthorizationRule) SetConditions(conditions condi rule.Status.Conditions = conditions } -var _ conversion.Convertible = &NamespacesEventhubsAuthorizationRule{} - -// ConvertFrom populates our NamespacesEventhubsAuthorizationRule from the provided hub NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(source) -} - -// ConvertTo populates the provided hub NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination) -} - var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -136,75 +115,8 @@ func (rule *NamespacesEventhubsAuthorizationRule) SetStatus(status genruntime.Co return nil } -// AssignProperties_From_NamespacesEventhubsAuthorizationRule populates our NamespacesEventhubsAuthorizationRule from the provided source NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_From_NamespacesEventhubsAuthorizationRule(source *v20240101s.NamespacesEventhubsAuthorizationRule) error { - - // ObjectMeta - rule.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_Eventhubs_AuthorizationRule_Spec - err := spec.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") - } - rule.Spec = spec - - // Status - var status Namespaces_Eventhubs_AuthorizationRule_STATUS - err = status.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") - } - rule.Status = status - - // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRule interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRule); ok { - err := augmentedRule.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsAuthorizationRule populates the provided destination NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination *v20240101s.NamespacesEventhubsAuthorizationRule) error { - - // ObjectMeta - destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec - err := rule.Spec.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS - err = rule.Status.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") - } - destination.Status = status - - // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRule interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRule); ok { - err := augmentedRule.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} +// Hub marks that this NamespacesEventhubsAuthorizationRule is the hub type for conversion +func (rule *NamespacesEventhubsAuthorizationRule) Hub() {} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (rule *NamespacesEventhubsAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { @@ -226,11 +138,6 @@ type NamespacesEventhubsAuthorizationRuleList struct { Items []NamespacesEventhubsAuthorizationRule `json:"items"` } -type augmentConversionForNamespacesEventhubsAuthorizationRule interface { - AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsAuthorizationRule) error - AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsAuthorizationRule) error -} - // Storage version of v1api20211101.Namespaces_Eventhubs_AuthorizationRule_Spec type Namespaces_Eventhubs_AuthorizationRule_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 @@ -252,158 +159,20 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec{ // ConvertSpecFrom populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil + return source.ConvertSpecTo(rule) } // ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_Spec func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} - err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(dst) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()") + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // Update dst from our instance - err = dst.ConvertSpecTo(destination) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecTo()") - } - - return nil -} - -// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_Spec -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // AzureName - rule.AzureName = source.AzureName - - // OperatorSpec - if source.OperatorSpec != nil { - var operatorSpec NamespacesEventhubsAuthorizationRuleOperatorSpec - err := operatorSpec.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source.OperatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - rule.OperatorSpec = &operatorSpec - } else { - rule.OperatorSpec = nil - } - - // OriginalVersion - rule.OriginalVersion = source.OriginalVersion - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - rule.Owner = &owner - } else { - rule.Owner = nil - } - - // Rights - rule.Rights = genruntime.CloneSliceOfString(source.Rights) - - // Update the property bag - if len(propertyBag) > 0 { - rule.PropertyBag = propertyBag - } else { - rule.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec); ok { - err := augmentedRule.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec populates the provided destination Namespaces_Eventhubs_AuthorizationRule_Spec from our Namespaces_Eventhubs_AuthorizationRule_Spec -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) - - // AzureName - destination.AzureName = rule.AzureName - - // OperatorSpec - if rule.OperatorSpec != nil { - var operatorSpec v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec - err := rule.OperatorSpec.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&operatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - destination.OperatorSpec = &operatorSpec - } else { - destination.OperatorSpec = nil - } - - // OriginalVersion - destination.OriginalVersion = rule.OriginalVersion - - // Owner - if rule.Owner != nil { - owner := rule.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // Rights - destination.Rights = genruntime.CloneSliceOfString(rule.Rights) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec); ok { - err := augmentedRule.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil + return destination.ConvertSpecFrom(rule) } // Storage version of v1api20211101.Namespaces_Eventhubs_AuthorizationRule_STATUS @@ -422,170 +191,20 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_AuthorizationRule_STA // ConvertStatusFrom populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + if source == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil + return source.ConvertStatusTo(rule) } // ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_STATUS func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(dst) + if destination == rule { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} - err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(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 -} - -// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Conditions - rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // Id - rule.Id = genruntime.ClonePointerToString(source.Id) - - // Location - rule.Location = genruntime.ClonePointerToString(source.Location) - - // Name - rule.Name = genruntime.ClonePointerToString(source.Name) - - // Rights - rule.Rights = genruntime.CloneSliceOfString(source.Rights) - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - rule.SystemData = &systemDatum - } else { - rule.SystemData = nil - } - - // Type - rule.Type = genruntime.ClonePointerToString(source.Type) - - // Update the property bag - if len(propertyBag) > 0 { - rule.PropertyBag = propertyBag - } else { - rule.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS); ok { - err := augmentedRule.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS populates the provided destination Namespaces_Eventhubs_AuthorizationRule_STATUS from our Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) - - // Id - destination.Id = genruntime.ClonePointerToString(rule.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(rule.Location) - - // Name - destination.Name = genruntime.ClonePointerToString(rule.Name) - - // Rights - destination.Rights = genruntime.CloneSliceOfString(rule.Rights) - - // SystemData - if rule.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(rule.Type) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS interface (if implemented) to customize the conversion - var ruleAsAny any = rule - if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS); ok { - err := augmentedRule.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error - AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error -} - -type augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error - AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error + return destination.ConvertStatusFrom(rule) } // Storage version of v1api20211101.NamespacesEventhubsAuthorizationRuleOperatorSpec @@ -595,85 +214,6 @@ type NamespacesEventhubsAuthorizationRuleOperatorSpec struct { Secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` } -// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec populates our NamespacesEventhubsAuthorizationRuleOperatorSpec from the provided source NamespacesEventhubsAuthorizationRuleOperatorSpec -func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Secrets - if source.Secrets != nil { - var secret NamespacesEventhubsAuthorizationRuleOperatorSecrets - err := secret.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source.Secrets) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets() to populate field Secrets") - } - operator.Secrets = &secret - } else { - operator.Secrets = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - operator.PropertyBag = propertyBag - } else { - operator.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion - var operatorAsAny any = operator - if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec); ok { - err := augmentedOperator.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSpec from our NamespacesEventhubsAuthorizationRuleOperatorSpec -func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) - - // Secrets - if operator.Secrets != nil { - var secret v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets - err := operator.Secrets.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&secret) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets() to populate field Secrets") - } - destination.Secrets = &secret - } else { - destination.Secrets = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion - var operatorAsAny any = operator - if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec); ok { - err := augmentedOperator.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec interface { - AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error - AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error -} - // Storage version of v1api20211101.NamespacesEventhubsAuthorizationRuleOperatorSecrets type NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` @@ -683,125 +223,6 @@ type NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` } -// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates our NamespacesEventhubsAuthorizationRuleOperatorSecrets from the provided source NamespacesEventhubsAuthorizationRuleOperatorSecrets -func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // PrimaryConnectionString - if source.PrimaryConnectionString != nil { - primaryConnectionString := source.PrimaryConnectionString.Copy() - secrets.PrimaryConnectionString = &primaryConnectionString - } else { - secrets.PrimaryConnectionString = nil - } - - // PrimaryKey - if source.PrimaryKey != nil { - primaryKey := source.PrimaryKey.Copy() - secrets.PrimaryKey = &primaryKey - } else { - secrets.PrimaryKey = nil - } - - // SecondaryConnectionString - if source.SecondaryConnectionString != nil { - secondaryConnectionString := source.SecondaryConnectionString.Copy() - secrets.SecondaryConnectionString = &secondaryConnectionString - } else { - secrets.SecondaryConnectionString = nil - } - - // SecondaryKey - if source.SecondaryKey != nil { - secondaryKey := source.SecondaryKey.Copy() - secrets.SecondaryKey = &secondaryKey - } else { - secrets.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - secrets.PropertyBag = propertyBag - } else { - secrets.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion - var secretsAsAny any = secrets - if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets); ok { - err := augmentedSecrets.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSecrets from our NamespacesEventhubsAuthorizationRuleOperatorSecrets -func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) - - // PrimaryConnectionString - if secrets.PrimaryConnectionString != nil { - primaryConnectionString := secrets.PrimaryConnectionString.Copy() - destination.PrimaryConnectionString = &primaryConnectionString - } else { - destination.PrimaryConnectionString = nil - } - - // PrimaryKey - if secrets.PrimaryKey != nil { - primaryKey := secrets.PrimaryKey.Copy() - destination.PrimaryKey = &primaryKey - } else { - destination.PrimaryKey = nil - } - - // SecondaryConnectionString - if secrets.SecondaryConnectionString != nil { - secondaryConnectionString := secrets.SecondaryConnectionString.Copy() - destination.SecondaryConnectionString = &secondaryConnectionString - } else { - destination.SecondaryConnectionString = nil - } - - // SecondaryKey - if secrets.SecondaryKey != nil { - secondaryKey := secrets.SecondaryKey.Copy() - destination.SecondaryKey = &secondaryKey - } else { - destination.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion - var secretsAsAny any = secrets - if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets); ok { - err := augmentedSecrets.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} - -type augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets interface { - AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error - AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error -} - func init() { SchemeBuilder.Register(&NamespacesEventhubsAuthorizationRule{}, &NamespacesEventhubsAuthorizationRuleList{}) } diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go index 28adc9fafdb..b8969f255e3 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go @@ -5,7 +5,6 @@ package storage import ( "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -18,91 +17,6 @@ import ( "testing" ) -func Test_NamespacesEventhubsAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRule to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesEventhubsAuthorizationRule - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesEventhubsAuthorizationRule - 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_NamespacesEventhubsAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRule to NamespacesEventhubsAuthorizationRule via AssignProperties_To_NamespacesEventhubsAuthorizationRule & AssignProperties_From_NamespacesEventhubsAuthorizationRule returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsAuthorizationRule - err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsAuthorizationRule - err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesEventhubsAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -165,48 +79,6 @@ func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(gens ma gens["Status"] = Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() } -func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_AuthorizationRule_Spec to Namespaces_Eventhubs_AuthorizationRule_Spec via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec - err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_AuthorizationRule_Spec - err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -284,48 +156,6 @@ func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec( gens["OperatorSpec"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator()) } -func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_AuthorizationRule_STATUS to Namespaces_Eventhubs_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS - err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_AuthorizationRule_STATUS - err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -405,48 +235,6 @@ func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATU gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } -func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSpec to NamespacesEventhubsAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec - err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsAuthorizationRuleOperatorSpec - err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -508,48 +296,6 @@ func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperator gens["Secrets"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator()) } -func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSecrets to NamespacesEventhubsAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets - err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets - err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go index 21b95792015..edc32df3c0f 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen.go @@ -4,18 +4,19 @@ package storage import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "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" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) +// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsconsumergroups/status,namespaceseventhubsconsumergroups/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" @@ -43,28 +44,6 @@ func (group *NamespacesEventhubsConsumerGroup) SetConditions(conditions conditio group.Status.Conditions = conditions } -var _ conversion.Convertible = &NamespacesEventhubsConsumerGroup{} - -// ConvertFrom populates our NamespacesEventhubsConsumerGroup from the provided hub NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) - } - - return group.AssignProperties_From_NamespacesEventhubsConsumerGroup(source) -} - -// ConvertTo populates the provided hub NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) - } - - return group.AssignProperties_To_NamespacesEventhubsConsumerGroup(destination) -} - var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} // AzureName returns the Azure name of the resource @@ -136,75 +115,8 @@ func (group *NamespacesEventhubsConsumerGroup) SetStatus(status genruntime.Conve return nil } -// AssignProperties_From_NamespacesEventhubsConsumerGroup populates our NamespacesEventhubsConsumerGroup from the provided source NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) AssignProperties_From_NamespacesEventhubsConsumerGroup(source *v20240101s.NamespacesEventhubsConsumerGroup) error { - - // ObjectMeta - group.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_Eventhubs_Consumergroup_Spec - err := spec.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") - } - group.Spec = spec - - // Status - var status Namespaces_Eventhubs_Consumergroup_STATUS - err = status.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") - } - group.Status = status - - // Invoke the augmentConversionForNamespacesEventhubsConsumerGroup interface (if implemented) to customize the conversion - var groupAsAny any = group - if augmentedGroup, ok := groupAsAny.(augmentConversionForNamespacesEventhubsConsumerGroup); ok { - err := augmentedGroup.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsConsumerGroup populates the provided destination NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) AssignProperties_To_NamespacesEventhubsConsumerGroup(destination *v20240101s.NamespacesEventhubsConsumerGroup) error { - - // ObjectMeta - destination.ObjectMeta = *group.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_Eventhubs_Consumergroup_Spec - err := group.Spec.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS - err = group.Status.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") - } - destination.Status = status - - // Invoke the augmentConversionForNamespacesEventhubsConsumerGroup interface (if implemented) to customize the conversion - var groupAsAny any = group - if augmentedGroup, ok := groupAsAny.(augmentConversionForNamespacesEventhubsConsumerGroup); ok { - err := augmentedGroup.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil -} +// Hub marks that this NamespacesEventhubsConsumerGroup is the hub type for conversion +func (group *NamespacesEventhubsConsumerGroup) Hub() {} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (group *NamespacesEventhubsConsumerGroup) OriginalGVK() *schema.GroupVersionKind { @@ -226,11 +138,6 @@ type NamespacesEventhubsConsumerGroupList struct { Items []NamespacesEventhubsConsumerGroup `json:"items"` } -type augmentConversionForNamespacesEventhubsConsumerGroup interface { - AssignPropertiesFrom(src *v20240101s.NamespacesEventhubsConsumerGroup) error - AssignPropertiesTo(dst *v20240101s.NamespacesEventhubsConsumerGroup) error -} - // Storage version of v1api20211101.Namespaces_Eventhubs_Consumergroup_Spec type Namespaces_Eventhubs_Consumergroup_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 @@ -251,134 +158,20 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_Consumergroup_Spec{} // ConvertSpecFrom populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) - if ok { - // Populate our instance from source - return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") - } - - // Update our instance from src - err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") + if source == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - return nil + return source.ConvertSpecTo(consumergroup) } // ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_Spec func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) - if ok { - // Populate destination from our instance - return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} - err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(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 -} - -// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_Spec -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(source *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // AzureName - consumergroup.AzureName = source.AzureName - - // OriginalVersion - consumergroup.OriginalVersion = source.OriginalVersion - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - consumergroup.Owner = &owner - } else { - consumergroup.Owner = nil - } - - // UserMetadata - consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) - - // Update the property bag - if len(propertyBag) > 0 { - consumergroup.PropertyBag = propertyBag - } else { - consumergroup.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec interface (if implemented) to customize the conversion - var consumergroupAsAny any = consumergroup - if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec); ok { - err := augmentedConsumergroup.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } + if destination == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") } - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec populates the provided destination Namespaces_Eventhubs_Consumergroup_Spec from our Namespaces_Eventhubs_Consumergroup_Spec -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(consumergroup.PropertyBag) - - // AzureName - destination.AzureName = consumergroup.AzureName - - // OriginalVersion - destination.OriginalVersion = consumergroup.OriginalVersion - - // Owner - if consumergroup.Owner != nil { - owner := consumergroup.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // UserMetadata - destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec interface (if implemented) to customize the conversion - var consumergroupAsAny any = consumergroup - if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec); ok { - err := augmentedConsumergroup.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } - } - - // No error - return nil + return destination.ConvertSpecFrom(consumergroup) } // Storage version of v1api20211101.Namespaces_Eventhubs_Consumergroup_STATUS @@ -399,182 +192,20 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_Consumergroup_STATUS{ // ConvertStatusFrom populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) - if ok { - // Populate our instance from source - return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") - } - - // Update our instance from src - err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") + if source == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - return nil + return source.ConvertStatusTo(consumergroup) } // ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_STATUS func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) - if ok { - // Populate destination from our instance - return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} - err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(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 -} - -// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(source.PropertyBag) - - // Conditions - consumergroup.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // CreatedAt - consumergroup.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) - - // Id - consumergroup.Id = genruntime.ClonePointerToString(source.Id) - - // Location - consumergroup.Location = genruntime.ClonePointerToString(source.Location) - - // Name - consumergroup.Name = genruntime.ClonePointerToString(source.Name) - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - consumergroup.SystemData = &systemDatum - } else { - consumergroup.SystemData = nil - } - - // Type - consumergroup.Type = genruntime.ClonePointerToString(source.Type) - - // UpdatedAt - consumergroup.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) - - // UserMetadata - consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) - - // Update the property bag - if len(propertyBag) > 0 { - consumergroup.PropertyBag = propertyBag - } else { - consumergroup.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS interface (if implemented) to customize the conversion - var consumergroupAsAny any = consumergroup - if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS); ok { - err := augmentedConsumergroup.AssignPropertiesFrom(source) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") - } - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS populates the provided destination Namespaces_Eventhubs_Consumergroup_STATUS from our Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { - // Clone the existing property bag - propertyBag := genruntime.NewPropertyBag(consumergroup.PropertyBag) - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(consumergroup.Conditions) - - // CreatedAt - destination.CreatedAt = genruntime.ClonePointerToString(consumergroup.CreatedAt) - - // Id - destination.Id = genruntime.ClonePointerToString(consumergroup.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(consumergroup.Location) - - // Name - destination.Name = genruntime.ClonePointerToString(consumergroup.Name) - - // SystemData - if consumergroup.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := consumergroup.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(consumergroup.Type) - - // UpdatedAt - destination.UpdatedAt = genruntime.ClonePointerToString(consumergroup.UpdatedAt) - - // UserMetadata - destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // Invoke the augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS interface (if implemented) to customize the conversion - var consumergroupAsAny any = consumergroup - if augmentedConsumergroup, ok := consumergroupAsAny.(augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS); ok { - err := augmentedConsumergroup.AssignPropertiesTo(destination) - if err != nil { - return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") - } + if destination == consumergroup { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") } - // No error - return nil -} - -type augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error - AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error -} - -type augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS interface { - AssignPropertiesFrom(src *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error - AssignPropertiesTo(dst *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error + return destination.ConvertStatusFrom(consumergroup) } func init() { diff --git a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go index 90e5b2d08f9..bd224b18b28 100644 --- a/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go +++ b/v2/api/eventhub/v1api20211101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go @@ -5,7 +5,6 @@ package storage import ( "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -18,91 +17,6 @@ import ( "testing" ) -func Test_NamespacesEventhubsConsumerGroup_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsConsumerGroup to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesEventhubsConsumerGroup - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesEventhubsConsumerGroup - 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_NamespacesEventhubsConsumerGroup_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsConsumerGroup to NamespacesEventhubsConsumerGroup via AssignProperties_To_NamespacesEventhubsConsumerGroup & AssignProperties_From_NamespacesEventhubsConsumerGroup returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsConsumerGroup - err := copied.AssignProperties_To_NamespacesEventhubsConsumerGroup(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsConsumerGroup - err = actual.AssignProperties_From_NamespacesEventhubsConsumerGroup(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_NamespacesEventhubsConsumerGroup_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -165,48 +79,6 @@ func AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(gens map[st gens["Status"] = Namespaces_Eventhubs_Consumergroup_STATUSGenerator() } -func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_Consumergroup_Spec to Namespaces_Eventhubs_Consumergroup_Spec via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec tests if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_Spec - err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_Consumergroup_Spec - err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -270,48 +142,6 @@ func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec( gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) } -func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_Consumergroup_STATUS to Namespaces_Eventhubs_Consumergroup_STATUS via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS tests if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS - err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_Consumergroup_STATUS - err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/eventhub/v1api20211101/storage/structure.txt b/v2/api/eventhub/v1api20211101/storage/structure.txt index 1f604640e5a..ca12c28d31d 100644 --- a/v2/api/eventhub/v1api20211101/storage/structure.txt +++ b/v2/api/eventhub/v1api20211101/storage/structure.txt @@ -233,68 +233,29 @@ github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage │ │ ├── LastModifiedByType: *string │ │ └── PropertyBag: genruntime.PropertyBag │ └── Type: *string -├── NamespacesEventhubsConsumerGroup: Resource -│ ├── Owner: eventhub/v1api20211101.NamespacesEventhub -│ ├── Spec: Object (5 properties) -│ │ ├── AzureName: string -│ │ ├── OriginalVersion: string -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ └── UserMetadata: *string -│ └── Status: Object (10 properties) -│ ├── Conditions: conditions.Condition[] -│ ├── CreatedAt: *string -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── PropertyBag: genruntime.PropertyBag -│ ├── SystemData: *Object (7 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *string -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ ├── LastModifiedByType: *string -│ │ └── PropertyBag: genruntime.PropertyBag -│ ├── Type: *string -│ ├── UpdatedAt: *string -│ └── UserMetadata: *string -├── augmentConversionForCaptureDescription: Interface -├── augmentConversionForCaptureDescription_STATUS: Interface -├── augmentConversionForDestination: Interface -├── augmentConversionForDestination_STATUS: Interface -├── augmentConversionForEncryption: Interface -├── augmentConversionForEncryption_STATUS: Interface -├── augmentConversionForIdentity: Interface -├── augmentConversionForIdentity_STATUS: Interface -├── augmentConversionForKeyVaultProperties: Interface -├── augmentConversionForKeyVaultProperties_STATUS: Interface -├── augmentConversionForNamespace: Interface -├── augmentConversionForNamespaceOperatorSecrets: Interface -├── augmentConversionForNamespaceOperatorSpec: Interface -├── augmentConversionForNamespace_STATUS: Interface -├── augmentConversionForNamespace_Spec: Interface -├── augmentConversionForNamespacesAuthorizationRule: Interface -├── augmentConversionForNamespacesAuthorizationRuleOperatorSecrets: Interface -├── augmentConversionForNamespacesAuthorizationRuleOperatorSpec: Interface -├── augmentConversionForNamespacesEventhub: Interface -├── augmentConversionForNamespacesEventhubsAuthorizationRule: Interface -├── augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSecrets: Interface -├── augmentConversionForNamespacesEventhubsAuthorizationRuleOperatorSpec: Interface -├── augmentConversionForNamespacesEventhubsConsumerGroup: Interface -├── augmentConversionForNamespaces_AuthorizationRule_STATUS: Interface -├── augmentConversionForNamespaces_AuthorizationRule_Spec: Interface -├── augmentConversionForNamespaces_Eventhub_STATUS: Interface -├── augmentConversionForNamespaces_Eventhub_Spec: Interface -├── augmentConversionForNamespaces_Eventhubs_AuthorizationRule_STATUS: Interface -├── augmentConversionForNamespaces_Eventhubs_AuthorizationRule_Spec: Interface -├── augmentConversionForNamespaces_Eventhubs_Consumergroup_STATUS: Interface -├── augmentConversionForNamespaces_Eventhubs_Consumergroup_Spec: Interface -├── augmentConversionForPrivateEndpointConnection_STATUS: Interface -├── augmentConversionForSku: Interface -├── augmentConversionForSku_STATUS: Interface -├── augmentConversionForSystemData_STATUS: Interface -├── augmentConversionForUserAssignedIdentityDetails: Interface -├── augmentConversionForUserAssignedIdentityProperties: Interface -├── augmentConversionForUserAssignedIdentityProperties_STATUS: Interface -└── augmentConversionForUserAssignedIdentity_STATUS: Interface +└── NamespacesEventhubsConsumerGroup: Resource + ├── Owner: eventhub/v1api20211101.NamespacesEventhub + ├── Spec: Object (5 properties) + │ ├── AzureName: string + │ ├── OriginalVersion: string + │ ├── Owner: *genruntime.KnownResourceReference + │ ├── PropertyBag: genruntime.PropertyBag + │ └── UserMetadata: *string + └── Status: Object (10 properties) + ├── Conditions: conditions.Condition[] + ├── CreatedAt: *string + ├── Id: *string + ├── Location: *string + ├── Name: *string + ├── PropertyBag: genruntime.PropertyBag + ├── SystemData: *Object (7 properties) + │ ├── CreatedAt: *string + │ ├── CreatedBy: *string + │ ├── CreatedByType: *string + │ ├── LastModifiedAt: *string + │ ├── LastModifiedBy: *string + │ ├── LastModifiedByType: *string + │ └── PropertyBag: genruntime.PropertyBag + ├── Type: *string + ├── UpdatedAt: *string + └── UserMetadata: *string diff --git a/v2/api/eventhub/v1api20240101/doc.go b/v2/api/eventhub/v1api20240101/doc.go deleted file mode 100644 index fb79759ff2f..00000000000 --- a/v2/api/eventhub/v1api20240101/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) Microsoft Corporation. -Licensed under the MIT license. -*/ - -// Code generated by azure-service-operator-codegen. DO NOT EDIT. - -// Package v1api20240101 contains API Schema definitions for the eventhub v1api20240101 API group -// +groupName=eventhub.azure.com -package v1api20240101 diff --git a/v2/api/eventhub/v1api20240101/groupversion_info_gen.go b/v2/api/eventhub/v1api20240101/groupversion_info_gen.go deleted file mode 100644 index 6cddaea6954..00000000000 --- a/v2/api/eventhub/v1api20240101/groupversion_info_gen.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (c) Microsoft Corporation. -Licensed under the MIT license. -*/ - -// Code generated by azure-service-operator-codegen. DO NOT EDIT. - -// Package v1api20240101 contains API Schema definitions for the eventhub v1api20240101 API group -// +kubebuilder:object:generate=true -// All object properties are optional by default, this will be overridden when needed: -// +kubebuilder:validation:Optional -// +groupName=eventhub.azure.com -// +versionName=v1api20240101 -package v1api20240101 - -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: "eventhub.azure.com", Version: "v1api20240101"} - - // 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/eventhub/v1api20240101/namespace_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen.go deleted file mode 100644 index b6f30694a50..00000000000 --- a/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - -type Namespace_Spec_ARM struct { - // Identity: Properties of BYOK Identity description - Identity *Identity_ARM `json:"identity,omitempty"` - - // Location: Resource location. - Location *string `json:"location,omitempty"` - Name string `json:"name,omitempty"` - - // Properties: Namespace properties supplied for create namespace operation. - Properties *Namespace_Properties_Spec_ARM `json:"properties,omitempty"` - - // Sku: Properties of sku resource - Sku *Sku_ARM `json:"sku,omitempty"` - - // Tags: Resource tags. - Tags map[string]string `json:"tags,omitempty"` -} - -var _ genruntime.ARMResourceSpec = &Namespace_Spec_ARM{} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (namespace Namespace_Spec_ARM) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetName returns the Name of the resource -func (namespace *Namespace_Spec_ARM) GetName() string { - return namespace.Name -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces" -func (namespace *Namespace_Spec_ARM) GetType() string { - return "Microsoft.EventHub/namespaces" -} - -// Properties to configure Identity for Bring your Own Keys -type Identity_ARM struct { - // Type: Type of managed service identity. - Type *Identity_Type `json:"type,omitempty"` - UserAssignedIdentities map[string]UserAssignedIdentityDetails_ARM `json:"userAssignedIdentities,omitempty"` -} - -type Namespace_Properties_Spec_ARM struct { - // AlternateName: Alternate name specified when alias and namespace names are same. - AlternateName *string `json:"alternateName,omitempty"` - ClusterArmId *string `json:"clusterArmId,omitempty"` - - // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - - // Encryption: Properties of BYOK Encryption description - Encryption *Encryption_ARM `json:"encryption,omitempty"` - - // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. - IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` - - // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. - KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` - - // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 - // throughput units. ( '0' if AutoInflateEnabled = true) - MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` - - // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' - MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_Spec `json:"minimumTlsVersion,omitempty"` - - // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. - PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_Spec `json:"publicNetworkAccess,omitempty"` - - // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -// SKU parameters supplied to the create namespace operation -type Sku_ARM struct { - // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. - // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. - Capacity *int `json:"capacity,omitempty"` - - // Name: Name of this SKU. - Name *Sku_Name `json:"name,omitempty"` - - // Tier: The billing tier of this particular SKU. - Tier *Sku_Tier `json:"tier,omitempty"` -} - -// Properties to configure Encryption -type Encryption_ARM struct { - // KeySource: Enumerates the possible value of keySource for Encryption - KeySource *Encryption_KeySource `json:"keySource,omitempty"` - - // KeyVaultProperties: Properties of KeyVault - KeyVaultProperties []KeyVaultProperties_ARM `json:"keyVaultProperties,omitempty"` - - // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -// +kubebuilder:validation:Enum={"None","SystemAssigned","SystemAssigned, UserAssigned","UserAssigned"} -type Identity_Type string - -const ( - Identity_Type_None = Identity_Type("None") - Identity_Type_SystemAssigned = Identity_Type("SystemAssigned") - Identity_Type_SystemAssignedUserAssigned = Identity_Type("SystemAssigned, UserAssigned") - Identity_Type_UserAssigned = Identity_Type("UserAssigned") -) - -// +kubebuilder:validation:Enum={"Basic","Premium","Standard"} -type Sku_Name string - -const ( - Sku_Name_Basic = Sku_Name("Basic") - Sku_Name_Premium = Sku_Name("Premium") - Sku_Name_Standard = Sku_Name("Standard") -) - -// +kubebuilder:validation:Enum={"Basic","Premium","Standard"} -type Sku_Tier string - -const ( - Sku_Tier_Basic = Sku_Tier("Basic") - Sku_Tier_Premium = Sku_Tier("Premium") - Sku_Tier_Standard = Sku_Tier("Standard") -) - -// Information about the user assigned identity for the resource -type UserAssignedIdentityDetails_ARM struct { -} - -// Properties to configure keyVault Properties -type KeyVaultProperties_ARM struct { - Identity *UserAssignedIdentityProperties_ARM `json:"identity,omitempty"` - - // KeyName: Name of the Key from KeyVault - KeyName *string `json:"keyName,omitempty"` - - // KeyVaultUri: Uri of KeyVault - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - - // KeyVersion: Key Version - KeyVersion *string `json:"keyVersion,omitempty"` -} - -type UserAssignedIdentityProperties_ARM struct { - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go deleted file mode 100644 index 0ac5ea8e5c8..00000000000 --- a/v2/api/eventhub/v1api20240101/namespace_spec_arm_types_gen_test.go +++ /dev/null @@ -1,587 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespace_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_Spec_ARM, Namespace_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_Spec_ARM runs a test to see if a specific instance of Namespace_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_Spec_ARM(subject Namespace_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespace_Spec_ARM instances for property testing - lazily instantiated by Namespace_Spec_ARMGenerator() -var namespace_Spec_ARMGenerator gopter.Gen - -// Namespace_Spec_ARMGenerator returns a generator of Namespace_Spec_ARM instances for property testing. -// We first initialize namespace_Spec_ARMGenerator 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 Namespace_Spec_ARMGenerator() gopter.Gen { - if namespace_Spec_ARMGenerator != nil { - return namespace_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Spec_ARM(generators) - namespace_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Spec_ARM(generators) - AddRelatedPropertyGeneratorsForNamespace_Spec_ARM(generators) - namespace_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec_ARM{}), generators) - - return namespace_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_Spec_ARM(gens map[string]gopter.Gen) { - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.AlphaString() - gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespace_Spec_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_Spec_ARM(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(Identity_ARMGenerator()) - gens["Properties"] = gen.PtrOf(Namespace_Properties_Spec_ARMGenerator()) - gens["Sku"] = gen.PtrOf(Sku_ARMGenerator()) -} - -func Test_Identity_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Identity_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForIdentity_ARM, Identity_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForIdentity_ARM runs a test to see if a specific instance of Identity_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForIdentity_ARM(subject Identity_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Identity_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by Identity_ARMGenerator() -var identity_ARMGenerator gopter.Gen - -// Identity_ARMGenerator returns a generator of Identity_ARM instances for property testing. -// We first initialize identity_ARMGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Identity_ARMGenerator() gopter.Gen { - if identity_ARMGenerator != nil { - return identity_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_ARM(generators) - identity_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_ARM(generators) - AddRelatedPropertyGeneratorsForIdentity_ARM(generators) - identity_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_ARM{}), generators) - - return identity_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForIdentity_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForIdentity_ARM(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.OneConstOf( - Identity_Type_None, - Identity_Type_SystemAssigned, - Identity_Type_SystemAssignedUserAssigned, - Identity_Type_UserAssigned)) -} - -// AddRelatedPropertyGeneratorsForIdentity_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForIdentity_ARM(gens map[string]gopter.Gen) { - gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentityDetails_ARMGenerator()) -} - -func Test_Namespace_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_Properties_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_Properties_Spec_ARM, Namespace_Properties_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_Properties_Spec_ARM runs a test to see if a specific instance of Namespace_Properties_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_Properties_Spec_ARM(subject Namespace_Properties_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_Properties_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespace_Properties_Spec_ARM instances for property testing - lazily instantiated by -// Namespace_Properties_Spec_ARMGenerator() -var namespace_Properties_Spec_ARMGenerator gopter.Gen - -// Namespace_Properties_Spec_ARMGenerator returns a generator of Namespace_Properties_Spec_ARM instances for property testing. -// We first initialize namespace_Properties_Spec_ARMGenerator 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 Namespace_Properties_Spec_ARMGenerator() gopter.Gen { - if namespace_Properties_Spec_ARMGenerator != nil { - return namespace_Properties_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM(generators) - namespace_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_Spec_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM(generators) - AddRelatedPropertyGeneratorsForNamespace_Properties_Spec_ARM(generators) - namespace_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_Spec_ARM{}), generators) - - return namespace_Properties_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_Properties_Spec_ARM(gens map[string]gopter.Gen) { - gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) - gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) - gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) - gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) - gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) - gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) - gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_Spec_10, Namespace_Properties_MinimumTlsVersion_Spec_11, Namespace_Properties_MinimumTlsVersion_Spec_12)) - gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_Spec_Disabled, Namespace_Properties_PublicNetworkAccess_Spec_Enabled, Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter)) - gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForNamespace_Properties_Spec_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_Properties_Spec_ARM(gens map[string]gopter.Gen) { - gens["Encryption"] = gen.PtrOf(Encryption_ARMGenerator()) -} - -func Test_Sku_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Sku_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSku_ARM, Sku_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSku_ARM runs a test to see if a specific instance of Sku_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForSku_ARM(subject Sku_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Sku_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by Sku_ARMGenerator() -var sku_ARMGenerator gopter.Gen - -// Sku_ARMGenerator returns a generator of Sku_ARM instances for property testing. -func Sku_ARMGenerator() gopter.Gen { - if sku_ARMGenerator != nil { - return sku_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForSku_ARM(generators) - sku_ARMGenerator = gen.Struct(reflect.TypeOf(Sku_ARM{}), generators) - - return sku_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForSku_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForSku_ARM(gens map[string]gopter.Gen) { - gens["Capacity"] = gen.PtrOf(gen.Int()) - gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_Basic, Sku_Name_Premium, Sku_Name_Standard)) - gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_Basic, Sku_Tier_Premium, Sku_Tier_Standard)) -} - -func Test_Encryption_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Encryption_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForEncryption_ARM, Encryption_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForEncryption_ARM runs a test to see if a specific instance of Encryption_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForEncryption_ARM(subject Encryption_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Encryption_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Encryption_ARM instances for property testing - lazily instantiated by Encryption_ARMGenerator() -var encryption_ARMGenerator gopter.Gen - -// Encryption_ARMGenerator returns a generator of Encryption_ARM instances for property testing. -// We first initialize encryption_ARMGenerator 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 Encryption_ARMGenerator() gopter.Gen { - if encryption_ARMGenerator != nil { - return encryption_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_ARM(generators) - encryption_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_ARM(generators) - AddRelatedPropertyGeneratorsForEncryption_ARM(generators) - encryption_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_ARM{}), generators) - - return encryption_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForEncryption_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForEncryption_ARM(gens map[string]gopter.Gen) { - gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_MicrosoftKeyVault)) - gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForEncryption_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForEncryption_ARM(gens map[string]gopter.Gen) { - gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_ARMGenerator()) -} - -func Test_UserAssignedIdentityDetails_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityDetails_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails_ARM, UserAssignedIdentityDetails_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityDetails_ARM runs a test to see if a specific instance of UserAssignedIdentityDetails_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityDetails_ARM(subject UserAssignedIdentityDetails_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityDetails_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of UserAssignedIdentityDetails_ARM instances for property testing - lazily instantiated by -// UserAssignedIdentityDetails_ARMGenerator() -var userAssignedIdentityDetails_ARMGenerator gopter.Gen - -// UserAssignedIdentityDetails_ARMGenerator returns a generator of UserAssignedIdentityDetails_ARM instances for property testing. -func UserAssignedIdentityDetails_ARMGenerator() gopter.Gen { - if userAssignedIdentityDetails_ARMGenerator != nil { - return userAssignedIdentityDetails_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - userAssignedIdentityDetails_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails_ARM{}), generators) - - return userAssignedIdentityDetails_ARMGenerator -} - -func Test_KeyVaultProperties_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of KeyVaultProperties_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_ARM, KeyVaultProperties_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForKeyVaultProperties_ARM runs a test to see if a specific instance of KeyVaultProperties_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForKeyVaultProperties_ARM(subject KeyVaultProperties_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual KeyVaultProperties_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by -// KeyVaultProperties_ARMGenerator() -var keyVaultProperties_ARMGenerator gopter.Gen - -// KeyVaultProperties_ARMGenerator returns a generator of KeyVaultProperties_ARM instances for property testing. -// We first initialize keyVaultProperties_ARMGenerator 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 KeyVaultProperties_ARMGenerator() gopter.Gen { - if keyVaultProperties_ARMGenerator != nil { - return keyVaultProperties_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM(generators) - keyVaultProperties_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM(generators) - AddRelatedPropertyGeneratorsForKeyVaultProperties_ARM(generators) - keyVaultProperties_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_ARM{}), generators) - - return keyVaultProperties_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForKeyVaultProperties_ARM(gens map[string]gopter.Gen) { - gens["KeyName"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForKeyVaultProperties_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForKeyVaultProperties_ARM(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_ARMGenerator()) -} - -func Test_UserAssignedIdentityProperties_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityProperties_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_ARM, UserAssignedIdentityProperties_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityProperties_ARM runs a test to see if a specific instance of UserAssignedIdentityProperties_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityProperties_ARM(subject UserAssignedIdentityProperties_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityProperties_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of UserAssignedIdentityProperties_ARM instances for property testing - lazily instantiated by -// UserAssignedIdentityProperties_ARMGenerator() -var userAssignedIdentityProperties_ARMGenerator gopter.Gen - -// UserAssignedIdentityProperties_ARMGenerator returns a generator of UserAssignedIdentityProperties_ARM instances for property testing. -func UserAssignedIdentityProperties_ARMGenerator() gopter.Gen { - if userAssignedIdentityProperties_ARMGenerator != nil { - return userAssignedIdentityProperties_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_ARM(generators) - userAssignedIdentityProperties_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_ARM{}), generators) - - return userAssignedIdentityProperties_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_ARM(gens map[string]gopter.Gen) { - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go deleted file mode 100644 index 9e42ee542a5..00000000000 --- a/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -type Namespace_STATUS_ARM struct { - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Identity: Properties of BYOK Identity description - Identity *Identity_STATUS_ARM `json:"identity,omitempty"` - - // Location: Resource location. - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // Properties: Namespace properties supplied for create namespace operation. - Properties *Namespace_Properties_STATUS_ARM `json:"properties,omitempty"` - - // Sku: Properties of sku resource - Sku *Sku_STATUS_ARM `json:"sku,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` - - // Tags: Resource tags. - Tags map[string]string `json:"tags,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// Properties to configure Identity for Bring your Own Keys -type Identity_STATUS_ARM struct { - // PrincipalId: ObjectId from the KeyVault - PrincipalId *string `json:"principalId,omitempty"` - - // TenantId: TenantId from the KeyVault - TenantId *string `json:"tenantId,omitempty"` - - // Type: Type of managed service identity. - Type *Identity_Type_STATUS `json:"type,omitempty"` - - // UserAssignedIdentities: Properties for User Assigned Identities - UserAssignedIdentities map[string]UserAssignedIdentity_STATUS_ARM `json:"userAssignedIdentities,omitempty"` -} - -type Namespace_Properties_STATUS_ARM struct { - // AlternateName: Alternate name specified when alias and namespace names are same. - AlternateName *string `json:"alternateName,omitempty"` - - // ClusterArmId: Cluster ARM ID of the Namespace. - ClusterArmId *string `json:"clusterArmId,omitempty"` - - // CreatedAt: The time the Namespace was created. - CreatedAt *string `json:"createdAt,omitempty"` - - // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - - // Encryption: Properties of BYOK Encryption description - Encryption *Encryption_STATUS_ARM `json:"encryption,omitempty"` - - // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. - IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` - - // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. - KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` - - // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 - // throughput units. ( '0' if AutoInflateEnabled = true) - MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` - - // MetricId: Identifier for Azure Insights metrics. - MetricId *string `json:"metricId,omitempty"` - - // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' - MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_STATUS `json:"minimumTlsVersion,omitempty"` - - // PrivateEndpointConnections: List of private endpoint connections. - PrivateEndpointConnections []PrivateEndpointConnection_STATUS_ARM `json:"privateEndpointConnections,omitempty"` - - // ProvisioningState: Provisioning state of the Namespace. - ProvisioningState *string `json:"provisioningState,omitempty"` - - // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. - PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"` - - // ServiceBusEndpoint: Endpoint you can use to perform Service Bus operations. - ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` - - // Status: Status of the Namespace. - Status *string `json:"status,omitempty"` - - // UpdatedAt: The time the Namespace was updated. - UpdatedAt *string `json:"updatedAt,omitempty"` - - // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -// SKU parameters supplied to the create namespace operation -type Sku_STATUS_ARM struct { - // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. - // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. - Capacity *int `json:"capacity,omitempty"` - - // Name: Name of this SKU. - Name *Sku_Name_STATUS `json:"name,omitempty"` - - // Tier: The billing tier of this particular SKU. - Tier *Sku_Tier_STATUS `json:"tier,omitempty"` -} - -// Metadata pertaining to creation and last modification of the resource. -type SystemData_STATUS_ARM struct { - // CreatedAt: The timestamp of resource creation (UTC). - CreatedAt *string `json:"createdAt,omitempty"` - - // CreatedBy: The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - - // CreatedByType: The type of identity that created the resource. - CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"` - - // LastModifiedAt: The type of identity that last modified the resource. - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - - // LastModifiedBy: The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - - // LastModifiedByType: The type of identity that last modified the resource. - LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"` -} - -// Properties to configure Encryption -type Encryption_STATUS_ARM struct { - // KeySource: Enumerates the possible value of keySource for Encryption - KeySource *Encryption_KeySource_STATUS `json:"keySource,omitempty"` - - // KeyVaultProperties: Properties of KeyVault - KeyVaultProperties []KeyVaultProperties_STATUS_ARM `json:"keyVaultProperties,omitempty"` - - // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -type Identity_Type_STATUS string - -const ( - Identity_Type_STATUS_None = Identity_Type_STATUS("None") - Identity_Type_STATUS_SystemAssigned = Identity_Type_STATUS("SystemAssigned") - Identity_Type_STATUS_SystemAssignedUserAssigned = Identity_Type_STATUS("SystemAssigned, UserAssigned") - Identity_Type_STATUS_UserAssigned = Identity_Type_STATUS("UserAssigned") -) - -// Properties of the PrivateEndpointConnection. -type PrivateEndpointConnection_STATUS_ARM struct { - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` -} - -type Sku_Name_STATUS string - -const ( - Sku_Name_STATUS_Basic = Sku_Name_STATUS("Basic") - Sku_Name_STATUS_Premium = Sku_Name_STATUS("Premium") - Sku_Name_STATUS_Standard = Sku_Name_STATUS("Standard") -) - -type Sku_Tier_STATUS string - -const ( - Sku_Tier_STATUS_Basic = Sku_Tier_STATUS("Basic") - Sku_Tier_STATUS_Premium = Sku_Tier_STATUS("Premium") - Sku_Tier_STATUS_Standard = Sku_Tier_STATUS("Standard") -) - -type SystemData_CreatedByType_STATUS string - -const ( - SystemData_CreatedByType_STATUS_Application = SystemData_CreatedByType_STATUS("Application") - SystemData_CreatedByType_STATUS_Key = SystemData_CreatedByType_STATUS("Key") - SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity") - SystemData_CreatedByType_STATUS_User = SystemData_CreatedByType_STATUS("User") -) - -type SystemData_LastModifiedByType_STATUS string - -const ( - SystemData_LastModifiedByType_STATUS_Application = SystemData_LastModifiedByType_STATUS("Application") - SystemData_LastModifiedByType_STATUS_Key = SystemData_LastModifiedByType_STATUS("Key") - SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity") - SystemData_LastModifiedByType_STATUS_User = SystemData_LastModifiedByType_STATUS("User") -) - -// Recognized Dictionary value. -type UserAssignedIdentity_STATUS_ARM struct { - // ClientId: Client Id of user assigned identity - ClientId *string `json:"clientId,omitempty"` - - // PrincipalId: Principal Id of user assigned identity - PrincipalId *string `json:"principalId,omitempty"` -} - -// Properties to configure keyVault Properties -type KeyVaultProperties_STATUS_ARM struct { - Identity *UserAssignedIdentityProperties_STATUS_ARM `json:"identity,omitempty"` - - // KeyName: Name of the Key from KeyVault - KeyName *string `json:"keyName,omitempty"` - - // KeyVaultUri: Uri of KeyVault - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - - // KeyVersion: Key Version - KeyVersion *string `json:"keyVersion,omitempty"` -} - -type UserAssignedIdentityProperties_STATUS_ARM struct { - // UserAssignedIdentity: ARM ID of user Identity selected for encryption - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen_test.go deleted file mode 100644 index 500f66d8ace..00000000000 --- a/v2/api/eventhub/v1api20240101/namespace_status_arm_types_gen_test.go +++ /dev/null @@ -1,744 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespace_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_STATUS_ARM, Namespace_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_STATUS_ARM runs a test to see if a specific instance of Namespace_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_STATUS_ARM(subject Namespace_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespace_STATUS_ARM instances for property testing - lazily instantiated by -// Namespace_STATUS_ARMGenerator() -var namespace_STATUS_ARMGenerator gopter.Gen - -// Namespace_STATUS_ARMGenerator returns a generator of Namespace_STATUS_ARM instances for property testing. -// We first initialize namespace_STATUS_ARMGenerator 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 Namespace_STATUS_ARMGenerator() gopter.Gen { - if namespace_STATUS_ARMGenerator != nil { - return namespace_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM(generators) - namespace_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForNamespace_STATUS_ARM(generators) - namespace_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS_ARM{}), generators) - - return namespace_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_STATUS_ARM(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()) -} - -// AddRelatedPropertyGeneratorsForNamespace_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(Identity_STATUS_ARMGenerator()) - gens["Properties"] = gen.PtrOf(Namespace_Properties_STATUS_ARMGenerator()) - gens["Sku"] = gen.PtrOf(Sku_STATUS_ARMGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) -} - -func Test_Identity_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Identity_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForIdentity_STATUS_ARM, Identity_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForIdentity_STATUS_ARM runs a test to see if a specific instance of Identity_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForIdentity_STATUS_ARM(subject Identity_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Identity_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by -// Identity_STATUS_ARMGenerator() -var identity_STATUS_ARMGenerator gopter.Gen - -// Identity_STATUS_ARMGenerator returns a generator of Identity_STATUS_ARM instances for property testing. -// We first initialize identity_STATUS_ARMGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Identity_STATUS_ARMGenerator() gopter.Gen { - if identity_STATUS_ARMGenerator != nil { - return identity_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM(generators) - identity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForIdentity_STATUS_ARM(generators) - identity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS_ARM{}), generators) - - return identity_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForIdentity_STATUS_ARM(gens map[string]gopter.Gen) { - gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) - gens["TenantId"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.OneConstOf( - Identity_Type_STATUS_None, - Identity_Type_STATUS_SystemAssigned, - Identity_Type_STATUS_SystemAssignedUserAssigned, - Identity_Type_STATUS_UserAssigned)) -} - -// AddRelatedPropertyGeneratorsForIdentity_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForIdentity_STATUS_ARM(gens map[string]gopter.Gen) { - gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUS_ARMGenerator()) -} - -func Test_Namespace_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_Properties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_Properties_STATUS_ARM, Namespace_Properties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_Properties_STATUS_ARM runs a test to see if a specific instance of Namespace_Properties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_Properties_STATUS_ARM(subject Namespace_Properties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_Properties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespace_Properties_STATUS_ARM instances for property testing - lazily instantiated by -// Namespace_Properties_STATUS_ARMGenerator() -var namespace_Properties_STATUS_ARMGenerator gopter.Gen - -// Namespace_Properties_STATUS_ARMGenerator returns a generator of Namespace_Properties_STATUS_ARM instances for property testing. -// We first initialize namespace_Properties_STATUS_ARMGenerator 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 Namespace_Properties_STATUS_ARMGenerator() gopter.Gen { - if namespace_Properties_STATUS_ARMGenerator != nil { - return namespace_Properties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM(generators) - namespace_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForNamespace_Properties_STATUS_ARM(generators) - namespace_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespace_Properties_STATUS_ARM{}), generators) - - return namespace_Properties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) - gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) - gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) - gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) - gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) - gens["MetricId"] = gen.PtrOf(gen.AlphaString()) - gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_STATUS_10, Namespace_Properties_MinimumTlsVersion_STATUS_11, Namespace_Properties_MinimumTlsVersion_STATUS_12)) - gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) - gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_STATUS_Disabled, Namespace_Properties_PublicNetworkAccess_STATUS_Enabled, Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter)) - gens["ServiceBusEndpoint"] = gen.PtrOf(gen.AlphaString()) - gens["Status"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForNamespace_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Encryption"] = gen.PtrOf(Encryption_STATUS_ARMGenerator()) - gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUS_ARMGenerator()) -} - -func Test_Sku_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Sku_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSku_STATUS_ARM, Sku_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSku_STATUS_ARM runs a test to see if a specific instance of Sku_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForSku_STATUS_ARM(subject Sku_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Sku_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by Sku_STATUS_ARMGenerator() -var sku_STATUS_ARMGenerator gopter.Gen - -// Sku_STATUS_ARMGenerator returns a generator of Sku_STATUS_ARM instances for property testing. -func Sku_STATUS_ARMGenerator() gopter.Gen { - if sku_STATUS_ARMGenerator != nil { - return sku_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForSku_STATUS_ARM(generators) - sku_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Sku_STATUS_ARM{}), generators) - - return sku_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForSku_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForSku_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Capacity"] = gen.PtrOf(gen.Int()) - gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_STATUS_Basic, Sku_Name_STATUS_Premium, Sku_Name_STATUS_Standard)) - gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_STATUS_Basic, Sku_Tier_STATUS_Premium, Sku_Tier_STATUS_Standard)) -} - -func Test_SystemData_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of SystemData_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSystemData_STATUS_ARM, SystemData_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSystemData_STATUS_ARM runs a test to see if a specific instance of SystemData_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForSystemData_STATUS_ARM(subject SystemData_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual SystemData_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by -// SystemData_STATUS_ARMGenerator() -var systemData_STATUS_ARMGenerator gopter.Gen - -// SystemData_STATUS_ARMGenerator returns a generator of SystemData_STATUS_ARM instances for property testing. -func SystemData_STATUS_ARMGenerator() gopter.Gen { - if systemData_STATUS_ARMGenerator != nil { - return systemData_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForSystemData_STATUS_ARM(generators) - systemData_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS_ARM{}), generators) - - return systemData_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForSystemData_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForSystemData_STATUS_ARM(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( - SystemData_CreatedByType_STATUS_Application, - SystemData_CreatedByType_STATUS_Key, - SystemData_CreatedByType_STATUS_ManagedIdentity, - SystemData_CreatedByType_STATUS_User)) - gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) - gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) - gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( - SystemData_LastModifiedByType_STATUS_Application, - SystemData_LastModifiedByType_STATUS_Key, - SystemData_LastModifiedByType_STATUS_ManagedIdentity, - SystemData_LastModifiedByType_STATUS_User)) -} - -func Test_Encryption_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Encryption_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForEncryption_STATUS_ARM, Encryption_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForEncryption_STATUS_ARM runs a test to see if a specific instance of Encryption_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForEncryption_STATUS_ARM(subject Encryption_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Encryption_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Encryption_STATUS_ARM instances for property testing - lazily instantiated by -// Encryption_STATUS_ARMGenerator() -var encryption_STATUS_ARMGenerator gopter.Gen - -// Encryption_STATUS_ARMGenerator returns a generator of Encryption_STATUS_ARM instances for property testing. -// We first initialize encryption_STATUS_ARMGenerator 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 Encryption_STATUS_ARMGenerator() gopter.Gen { - if encryption_STATUS_ARMGenerator != nil { - return encryption_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM(generators) - encryption_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForEncryption_STATUS_ARM(generators) - encryption_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS_ARM{}), generators) - - return encryption_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForEncryption_STATUS_ARM(gens map[string]gopter.Gen) { - gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_STATUS_MicrosoftKeyVault)) - gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForEncryption_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForEncryption_STATUS_ARM(gens map[string]gopter.Gen) { - gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUS_ARMGenerator()) -} - -func Test_PrivateEndpointConnection_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of PrivateEndpointConnection_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS_ARM, PrivateEndpointConnection_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForPrivateEndpointConnection_STATUS_ARM runs a test to see if a specific instance of PrivateEndpointConnection_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForPrivateEndpointConnection_STATUS_ARM(subject PrivateEndpointConnection_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual PrivateEndpointConnection_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by -// PrivateEndpointConnection_STATUS_ARMGenerator() -var privateEndpointConnection_STATUS_ARMGenerator gopter.Gen - -// PrivateEndpointConnection_STATUS_ARMGenerator returns a generator of PrivateEndpointConnection_STATUS_ARM instances for property testing. -func PrivateEndpointConnection_STATUS_ARMGenerator() gopter.Gen { - if privateEndpointConnection_STATUS_ARMGenerator != nil { - return privateEndpointConnection_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS_ARM(generators) - privateEndpointConnection_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS_ARM{}), generators) - - return privateEndpointConnection_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_UserAssignedIdentity_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentity_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentity_STATUS_ARM, UserAssignedIdentity_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentity_STATUS_ARM runs a test to see if a specific instance of UserAssignedIdentity_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentity_STATUS_ARM(subject UserAssignedIdentity_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentity_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by -// UserAssignedIdentity_STATUS_ARMGenerator() -var userAssignedIdentity_STATUS_ARMGenerator gopter.Gen - -// UserAssignedIdentity_STATUS_ARMGenerator returns a generator of UserAssignedIdentity_STATUS_ARM instances for property testing. -func UserAssignedIdentity_STATUS_ARMGenerator() gopter.Gen { - if userAssignedIdentity_STATUS_ARMGenerator != nil { - return userAssignedIdentity_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS_ARM(generators) - userAssignedIdentity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_STATUS_ARM{}), generators) - - return userAssignedIdentity_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS_ARM(gens map[string]gopter.Gen) { - gens["ClientId"] = gen.PtrOf(gen.AlphaString()) - gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_KeyVaultProperties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of KeyVaultProperties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_STATUS_ARM, KeyVaultProperties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForKeyVaultProperties_STATUS_ARM runs a test to see if a specific instance of KeyVaultProperties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForKeyVaultProperties_STATUS_ARM(subject KeyVaultProperties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual KeyVaultProperties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(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_ARM instances for property testing - lazily instantiated by -// KeyVaultProperties_STATUS_ARMGenerator() -var keyVaultProperties_STATUS_ARMGenerator gopter.Gen - -// KeyVaultProperties_STATUS_ARMGenerator returns a generator of KeyVaultProperties_STATUS_ARM instances for property testing. -// We first initialize keyVaultProperties_STATUS_ARMGenerator 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 KeyVaultProperties_STATUS_ARMGenerator() gopter.Gen { - if keyVaultProperties_STATUS_ARMGenerator != nil { - return keyVaultProperties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(generators) - keyVaultProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(generators) - keyVaultProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS_ARM{}), generators) - - return keyVaultProperties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["KeyName"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUS_ARMGenerator()) -} - -func Test_UserAssignedIdentityProperties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityProperties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS_ARM, UserAssignedIdentityProperties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS_ARM runs a test to see if a specific instance of UserAssignedIdentityProperties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS_ARM(subject UserAssignedIdentityProperties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityProperties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of UserAssignedIdentityProperties_STATUS_ARM instances for property testing - lazily instantiated by -// UserAssignedIdentityProperties_STATUS_ARMGenerator() -var userAssignedIdentityProperties_STATUS_ARMGenerator gopter.Gen - -// UserAssignedIdentityProperties_STATUS_ARMGenerator returns a generator of UserAssignedIdentityProperties_STATUS_ARM instances for property testing. -func UserAssignedIdentityProperties_STATUS_ARMGenerator() gopter.Gen { - if userAssignedIdentityProperties_STATUS_ARMGenerator != nil { - return userAssignedIdentityProperties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS_ARM(generators) - userAssignedIdentityProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_STATUS_ARM{}), generators) - - return userAssignedIdentityProperties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/namespace_types_gen.go b/v2/api/eventhub/v1api20240101/namespace_types_gen.go deleted file mode 100644 index 36801799fbd..00000000000 --- a/v2/api/eventhub/v1api20240101/namespace_types_gen.go +++ /dev/null @@ -1,3811 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" -// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" -// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} -type Namespace struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespace_Spec `json:"spec,omitempty"` - Status Namespace_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &Namespace{} - -// GetConditions returns the conditions of the resource -func (namespace *Namespace) GetConditions() conditions.Conditions { - return namespace.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (namespace *Namespace) SetConditions(conditions conditions.Conditions) { - namespace.Status.Conditions = conditions -} - -var _ conversion.Convertible = &Namespace{} - -// ConvertFrom populates our Namespace from the provided hub Namespace -func (namespace *Namespace) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.Namespace) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) - } - - return namespace.AssignProperties_From_Namespace(source) -} - -// ConvertTo populates the provided hub Namespace from our Namespace -func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.Namespace) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/Namespace but received %T instead", hub) - } - - return namespace.AssignProperties_To_Namespace(destination) -} - -// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaces,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaces.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Defaulter = &Namespace{} - -// Default applies defaults to the Namespace resource -func (namespace *Namespace) Default() { - namespace.defaultImpl() - var temp any = namespace - if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { - runtimeDefaulter.CustomDefault() - } -} - -// defaultAzureName defaults the Azure name of the resource to the Kubernetes name -func (namespace *Namespace) defaultAzureName() { - if namespace.Spec.AzureName == "" { - namespace.Spec.AzureName = namespace.Name - } -} - -// defaultImpl applies the code generated defaults to the Namespace resource -func (namespace *Namespace) defaultImpl() { namespace.defaultAzureName() } - -var _ genruntime.ImportableResource = &Namespace{} - -// InitializeSpec initializes the spec for this resource from the given status -func (namespace *Namespace) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespace_STATUS); ok { - return namespace.Spec.Initialize_From_Namespace_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespace_STATUS but received %T instead", status) -} - -var _ genruntime.KubernetesResource = &Namespace{} - -// AzureName returns the Azure name of the resource -func (namespace *Namespace) AzureName() string { - return namespace.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (namespace Namespace) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (namespace *Namespace) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (namespace *Namespace) GetSpec() genruntime.ConvertibleSpec { - return &namespace.Spec -} - -// GetStatus returns the status of this resource -func (namespace *Namespace) GetStatus() genruntime.ConvertibleStatus { - return &namespace.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (namespace *Namespace) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces" -func (namespace *Namespace) GetType() string { - return "Microsoft.EventHub/namespaces" -} - -// NewEmptyStatus returns a new empty (blank) status -func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespace_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (namespace *Namespace) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) - return namespace.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespace_STATUS); ok { - namespace.Status = *st - return nil - } - - // Convert status to required version - var st Namespace_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - namespace.Status = st - return nil -} - -// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespace,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaces,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaces.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Validator = &Namespace{} - -// ValidateCreate validates the creation of the resource -func (namespace *Namespace) ValidateCreate() (admission.Warnings, error) { - validations := namespace.createValidations() - var temp any = namespace - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.CreateValidations()...) - } - return genruntime.ValidateCreate(validations) -} - -// ValidateDelete validates the deletion of the resource -func (namespace *Namespace) ValidateDelete() (admission.Warnings, error) { - validations := namespace.deleteValidations() - var temp any = namespace - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.DeleteValidations()...) - } - return genruntime.ValidateDelete(validations) -} - -// ValidateUpdate validates an update of the resource -func (namespace *Namespace) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { - validations := namespace.updateValidations() - var temp any = namespace - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.UpdateValidations()...) - } - return genruntime.ValidateUpdate(old, validations) -} - -// createValidations validates the creation of the resource -func (namespace *Namespace) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){namespace.validateResourceReferences, namespace.validateOwnerReference, namespace.validateSecretDestinations} -} - -// deleteValidations validates the deletion of the resource -func (namespace *Namespace) deleteValidations() []func() (admission.Warnings, error) { - return nil -} - -// updateValidations validates the update of the resource -func (namespace *Namespace) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { - return []func(old runtime.Object) (admission.Warnings, error){ - func(old runtime.Object) (admission.Warnings, error) { - return namespace.validateResourceReferences() - }, - namespace.validateWriteOnceProperties, - func(old runtime.Object) (admission.Warnings, error) { - return namespace.validateOwnerReference() - }, - func(old runtime.Object) (admission.Warnings, error) { - return namespace.validateSecretDestinations() - }, - } -} - -// validateOwnerReference validates the owner field -func (namespace *Namespace) validateOwnerReference() (admission.Warnings, error) { - return genruntime.ValidateOwner(namespace) -} - -// validateResourceReferences validates all resource references -func (namespace *Namespace) validateResourceReferences() (admission.Warnings, error) { - refs, err := reflecthelpers.FindResourceReferences(&namespace.Spec) - if err != nil { - return nil, err - } - return genruntime.ValidateResourceReferences(refs) -} - -// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's -func (namespace *Namespace) validateSecretDestinations() (admission.Warnings, error) { - if namespace.Spec.OperatorSpec == nil { - return nil, nil - } - if namespace.Spec.OperatorSpec.Secrets == nil { - return nil, nil - } - toValidate := []*genruntime.SecretDestination{ - namespace.Spec.OperatorSpec.Secrets.PrimaryConnectionString, - namespace.Spec.OperatorSpec.Secrets.PrimaryKey, - namespace.Spec.OperatorSpec.Secrets.SecondaryConnectionString, - namespace.Spec.OperatorSpec.Secrets.SecondaryKey, - } - return genruntime.ValidateSecretDestinations(toValidate) -} - -// validateWriteOnceProperties validates all WriteOnce properties -func (namespace *Namespace) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { - oldObj, ok := old.(*Namespace) - if !ok { - return nil, nil - } - - return genruntime.ValidateWriteOnceProperties(oldObj, namespace) -} - -// AssignProperties_From_Namespace populates our Namespace from the provided source Namespace -func (namespace *Namespace) AssignProperties_From_Namespace(source *v20240101s.Namespace) error { - - // ObjectMeta - namespace.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespace_Spec - err := spec.AssignProperties_From_Namespace_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespace_Spec() to populate field Spec") - } - namespace.Spec = spec - - // Status - var status Namespace_STATUS - err = status.AssignProperties_From_Namespace_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespace_STATUS() to populate field Status") - } - namespace.Status = status - - // No error - return nil -} - -// AssignProperties_To_Namespace populates the provided destination Namespace from our Namespace -func (namespace *Namespace) AssignProperties_To_Namespace(destination *v20240101s.Namespace) error { - - // ObjectMeta - destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespace_Spec - err := namespace.Spec.AssignProperties_To_Namespace_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespace_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespace_STATUS - err = namespace.Status.AssignProperties_To_Namespace_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespace_STATUS() to populate field Status") - } - destination.Status = status - - // No error - return nil -} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: namespace.Spec.OriginalVersion(), - Kind: "Namespace", - } -} - -// +kubebuilder:object:root=true -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} -type NamespaceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Namespace `json:"items"` -} - -// +kubebuilder:validation:Enum={"2024-01-01"} -type APIVersion string - -const APIVersion_Value = APIVersion("2024-01-01") - -type Namespace_Spec struct { - // AlternateName: Alternate name specified when alias and namespace names are same. - AlternateName *string `json:"alternateName,omitempty"` - - // +kubebuilder:validation:MaxLength=50 - // +kubebuilder:validation:MinLength=6 - // +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9-]{6,50}[a-zA-Z0-9]$" - // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it - // doesn't have to be. - AzureName string `json:"azureName,omitempty"` - - // ClusterArmReference: Cluster ARM ID of the Namespace. - ClusterArmReference *genruntime.ResourceReference `armReference:"ClusterArmId" json:"clusterArmReference,omitempty"` - - // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - - // Encryption: Properties of BYOK Encryption description - Encryption *Encryption `json:"encryption,omitempty"` - - // Identity: Properties of BYOK Identity description - Identity *Identity `json:"identity,omitempty"` - - // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. - IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` - - // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. - KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` - - // Location: Resource location. - Location *string `json:"location,omitempty"` - - // +kubebuilder:validation:Minimum=0 - // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 - // throughput units. ( '0' if AutoInflateEnabled = true) - MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` - - // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' - MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_Spec `json:"minimumTlsVersion,omitempty"` - - // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not - // passed directly to Azure - OperatorSpec *NamespaceOperatorSpec `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"` - - // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. - PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_Spec `json:"publicNetworkAccess,omitempty"` - - // Sku: Properties of sku resource - Sku *Sku `json:"sku,omitempty"` - - // Tags: Resource tags. - Tags map[string]string `json:"tags,omitempty"` - - // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -var _ genruntime.ARMTransformer = &Namespace_Spec{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (namespace *Namespace_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if namespace == nil { - return nil, nil - } - result := &Namespace_Spec_ARM{} - - // Set property "Identity": - if namespace.Identity != nil { - identity_ARM, err := (*namespace.Identity).ConvertToARM(resolved) - if err != nil { - return nil, err - } - identity := *identity_ARM.(*Identity_ARM) - result.Identity = &identity - } - - // Set property "Location": - if namespace.Location != nil { - location := *namespace.Location - result.Location = &location - } - - // Set property "Name": - result.Name = resolved.Name - - // Set property "Properties": - if namespace.AlternateName != nil || - namespace.ClusterArmReference != nil || - namespace.DisableLocalAuth != nil || - namespace.Encryption != nil || - namespace.IsAutoInflateEnabled != nil || - namespace.KafkaEnabled != nil || - namespace.MaximumThroughputUnits != nil || - namespace.MinimumTlsVersion != nil || - namespace.PublicNetworkAccess != nil || - namespace.ZoneRedundant != nil { - result.Properties = &Namespace_Properties_Spec_ARM{} - } - if namespace.AlternateName != nil { - alternateName := *namespace.AlternateName - result.Properties.AlternateName = &alternateName - } - if namespace.ClusterArmReference != nil { - clusterArmIdARMID, err := resolved.ResolvedReferences.Lookup(*namespace.ClusterArmReference) - if err != nil { - return nil, err - } - clusterArmId := clusterArmIdARMID - result.Properties.ClusterArmId = &clusterArmId - } - if namespace.DisableLocalAuth != nil { - disableLocalAuth := *namespace.DisableLocalAuth - result.Properties.DisableLocalAuth = &disableLocalAuth - } - if namespace.Encryption != nil { - encryption_ARM, err := (*namespace.Encryption).ConvertToARM(resolved) - if err != nil { - return nil, err - } - encryption := *encryption_ARM.(*Encryption_ARM) - result.Properties.Encryption = &encryption - } - if namespace.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *namespace.IsAutoInflateEnabled - result.Properties.IsAutoInflateEnabled = &isAutoInflateEnabled - } - if namespace.KafkaEnabled != nil { - kafkaEnabled := *namespace.KafkaEnabled - result.Properties.KafkaEnabled = &kafkaEnabled - } - if namespace.MaximumThroughputUnits != nil { - maximumThroughputUnits := *namespace.MaximumThroughputUnits - result.Properties.MaximumThroughputUnits = &maximumThroughputUnits - } - if namespace.MinimumTlsVersion != nil { - minimumTlsVersion := *namespace.MinimumTlsVersion - result.Properties.MinimumTlsVersion = &minimumTlsVersion - } - if namespace.PublicNetworkAccess != nil { - publicNetworkAccess := *namespace.PublicNetworkAccess - result.Properties.PublicNetworkAccess = &publicNetworkAccess - } - if namespace.ZoneRedundant != nil { - zoneRedundant := *namespace.ZoneRedundant - result.Properties.ZoneRedundant = &zoneRedundant - } - - // Set property "Sku": - if namespace.Sku != nil { - sku_ARM, err := (*namespace.Sku).ConvertToARM(resolved) - if err != nil { - return nil, err - } - sku := *sku_ARM.(*Sku_ARM) - result.Sku = &sku - } - - // Set property "Tags": - if namespace.Tags != nil { - result.Tags = make(map[string]string, len(namespace.Tags)) - for key, value := range namespace.Tags { - result.Tags[key] = value - } - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (namespace *Namespace_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespace_Spec_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (namespace *Namespace_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespace_Spec_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespace_Spec_ARM, got %T", armInput) - } - - // Set property "AlternateName": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.AlternateName != nil { - alternateName := *typedInput.Properties.AlternateName - namespace.AlternateName = &alternateName - } - } - - // Set property "AzureName": - namespace.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) - - // no assignment for property "ClusterArmReference" - - // Set property "DisableLocalAuth": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DisableLocalAuth != nil { - disableLocalAuth := *typedInput.Properties.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } - } - - // Set property "Encryption": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.Encryption != nil { - var encryption1 Encryption - err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption) - if err != nil { - return err - } - encryption := encryption1 - namespace.Encryption = &encryption - } - } - - // Set property "Identity": - if typedInput.Identity != nil { - var identity1 Identity - err := identity1.PopulateFromARM(owner, *typedInput.Identity) - if err != nil { - return err - } - identity := identity1 - namespace.Identity = &identity - } - - // Set property "IsAutoInflateEnabled": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *typedInput.Properties.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } - } - - // Set property "KafkaEnabled": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.KafkaEnabled != nil { - kafkaEnabled := *typedInput.Properties.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } - } - - // Set property "Location": - if typedInput.Location != nil { - location := *typedInput.Location - namespace.Location = &location - } - - // Set property "MaximumThroughputUnits": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.MaximumThroughputUnits != nil { - maximumThroughputUnits := *typedInput.Properties.MaximumThroughputUnits - namespace.MaximumThroughputUnits = &maximumThroughputUnits - } - } - - // Set property "MinimumTlsVersion": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.MinimumTlsVersion != nil { - minimumTlsVersion := *typedInput.Properties.MinimumTlsVersion - namespace.MinimumTlsVersion = &minimumTlsVersion - } - } - - // no assignment for property "OperatorSpec" - - // Set property "Owner": - namespace.Owner = &genruntime.KnownResourceReference{ - Name: owner.Name, - ARMID: owner.ARMID, - } - - // Set property "PublicNetworkAccess": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.PublicNetworkAccess != nil { - publicNetworkAccess := *typedInput.Properties.PublicNetworkAccess - namespace.PublicNetworkAccess = &publicNetworkAccess - } - } - - // Set property "Sku": - if typedInput.Sku != nil { - var sku1 Sku - err := sku1.PopulateFromARM(owner, *typedInput.Sku) - if err != nil { - return err - } - sku := sku1 - namespace.Sku = &sku - } - - // Set property "Tags": - if typedInput.Tags != nil { - namespace.Tags = make(map[string]string, len(typedInput.Tags)) - for key, value := range typedInput.Tags { - namespace.Tags[key] = value - } - } - - // Set property "ZoneRedundant": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.ZoneRedundant != nil { - zoneRedundant := *typedInput.Properties.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } - } - - // No error - return nil -} - -var _ genruntime.ConvertibleSpec = &Namespace_Spec{} - -// ConvertSpecFrom populates our Namespace_Spec from the provided source -func (namespace *Namespace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespace_Spec) - if ok { - // Populate our instance from source - return namespace.AssignProperties_From_Namespace_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespace_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") - } - - // Update our instance from src - err = namespace.AssignProperties_From_Namespace_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil -} - -// ConvertSpecTo populates the provided destination from our Namespace_Spec -func (namespace *Namespace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespace_Spec) - if ok { - // Populate destination from our instance - return namespace.AssignProperties_To_Namespace_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespace_Spec{} - err := namespace.AssignProperties_To_Namespace_Spec(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 -} - -// AssignProperties_From_Namespace_Spec populates our Namespace_Spec from the provided source Namespace_Spec -func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *v20240101s.Namespace_Spec) error { - - // AlternateName - namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) - - // AzureName - namespace.AzureName = source.AzureName - - // ClusterArmReference - if source.ClusterArmReference != nil { - clusterArmReference := source.ClusterArmReference.Copy() - namespace.ClusterArmReference = &clusterArmReference - } else { - namespace.ClusterArmReference = nil - } - - // DisableLocalAuth - if source.DisableLocalAuth != nil { - disableLocalAuth := *source.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } else { - namespace.DisableLocalAuth = nil - } - - // Encryption - if source.Encryption != nil { - var encryption Encryption - err := encryption.AssignProperties_From_Encryption(source.Encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Encryption() to populate field Encryption") - } - namespace.Encryption = &encryption - } else { - namespace.Encryption = nil - } - - // Identity - if source.Identity != nil { - var identity Identity - err := identity.AssignProperties_From_Identity(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Identity() to populate field Identity") - } - namespace.Identity = &identity - } else { - namespace.Identity = nil - } - - // IsAutoInflateEnabled - if source.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *source.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - namespace.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if source.KafkaEnabled != nil { - kafkaEnabled := *source.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } else { - namespace.KafkaEnabled = nil - } - - // Location - namespace.Location = genruntime.ClonePointerToString(source.Location) - - // MaximumThroughputUnits - if source.MaximumThroughputUnits != nil { - maximumThroughputUnit := *source.MaximumThroughputUnits - namespace.MaximumThroughputUnits = &maximumThroughputUnit - } else { - namespace.MaximumThroughputUnits = nil - } - - // MinimumTlsVersion - if source.MinimumTlsVersion != nil { - minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_Spec(*source.MinimumTlsVersion) - namespace.MinimumTlsVersion = &minimumTlsVersion - } else { - namespace.MinimumTlsVersion = nil - } - - // OperatorSpec - if source.OperatorSpec != nil { - var operatorSpec NamespaceOperatorSpec - err := operatorSpec.AssignProperties_From_NamespaceOperatorSpec(source.OperatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSpec() to populate field OperatorSpec") - } - namespace.OperatorSpec = &operatorSpec - } else { - namespace.OperatorSpec = nil - } - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - namespace.Owner = &owner - } else { - namespace.Owner = nil - } - - // PublicNetworkAccess - if source.PublicNetworkAccess != nil { - publicNetworkAccess := Namespace_Properties_PublicNetworkAccess_Spec(*source.PublicNetworkAccess) - namespace.PublicNetworkAccess = &publicNetworkAccess - } else { - namespace.PublicNetworkAccess = nil - } - - // Sku - if source.Sku != nil { - var sku Sku - err := sku.AssignProperties_From_Sku(source.Sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Sku() to populate field Sku") - } - namespace.Sku = &sku - } else { - namespace.Sku = nil - } - - // Tags - namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) - - // ZoneRedundant - if source.ZoneRedundant != nil { - zoneRedundant := *source.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } else { - namespace.ZoneRedundant = nil - } - - // No error - return nil -} - -// AssignProperties_To_Namespace_Spec populates the provided destination Namespace_Spec from our Namespace_Spec -func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination *v20240101s.Namespace_Spec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // AlternateName - destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) - - // AzureName - destination.AzureName = namespace.AzureName - - // ClusterArmReference - if namespace.ClusterArmReference != nil { - clusterArmReference := namespace.ClusterArmReference.Copy() - destination.ClusterArmReference = &clusterArmReference - } else { - destination.ClusterArmReference = nil - } - - // DisableLocalAuth - if namespace.DisableLocalAuth != nil { - disableLocalAuth := *namespace.DisableLocalAuth - destination.DisableLocalAuth = &disableLocalAuth - } else { - destination.DisableLocalAuth = nil - } - - // Encryption - if namespace.Encryption != nil { - var encryption v20240101s.Encryption - err := namespace.Encryption.AssignProperties_To_Encryption(&encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Encryption() to populate field Encryption") - } - destination.Encryption = &encryption - } else { - destination.Encryption = nil - } - - // Identity - if namespace.Identity != nil { - var identity v20240101s.Identity - err := namespace.Identity.AssignProperties_To_Identity(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Identity() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // IsAutoInflateEnabled - if namespace.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *namespace.IsAutoInflateEnabled - destination.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - destination.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if namespace.KafkaEnabled != nil { - kafkaEnabled := *namespace.KafkaEnabled - destination.KafkaEnabled = &kafkaEnabled - } else { - destination.KafkaEnabled = nil - } - - // Location - destination.Location = genruntime.ClonePointerToString(namespace.Location) - - // MaximumThroughputUnits - if namespace.MaximumThroughputUnits != nil { - maximumThroughputUnit := *namespace.MaximumThroughputUnits - destination.MaximumThroughputUnits = &maximumThroughputUnit - } else { - destination.MaximumThroughputUnits = nil - } - - // MinimumTlsVersion - if namespace.MinimumTlsVersion != nil { - minimumTlsVersion := string(*namespace.MinimumTlsVersion) - destination.MinimumTlsVersion = &minimumTlsVersion - } else { - destination.MinimumTlsVersion = nil - } - - // OperatorSpec - if namespace.OperatorSpec != nil { - var operatorSpec v20240101s.NamespaceOperatorSpec - err := namespace.OperatorSpec.AssignProperties_To_NamespaceOperatorSpec(&operatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSpec() to populate field OperatorSpec") - } - destination.OperatorSpec = &operatorSpec - } else { - destination.OperatorSpec = nil - } - - // OriginalVersion - destination.OriginalVersion = namespace.OriginalVersion() - - // Owner - if namespace.Owner != nil { - owner := namespace.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // PublicNetworkAccess - if namespace.PublicNetworkAccess != nil { - publicNetworkAccess := string(*namespace.PublicNetworkAccess) - destination.PublicNetworkAccess = &publicNetworkAccess - } else { - destination.PublicNetworkAccess = nil - } - - // Sku - if namespace.Sku != nil { - var sku v20240101s.Sku - err := namespace.Sku.AssignProperties_To_Sku(&sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Sku() to populate field Sku") - } - destination.Sku = &sku - } else { - destination.Sku = nil - } - - // Tags - destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) - - // ZoneRedundant - if namespace.ZoneRedundant != nil { - zoneRedundant := *namespace.ZoneRedundant - destination.ZoneRedundant = &zoneRedundant - } else { - destination.ZoneRedundant = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Namespace_STATUS populates our Namespace_Spec from the provided source Namespace_STATUS -func (namespace *Namespace_Spec) Initialize_From_Namespace_STATUS(source *Namespace_STATUS) error { - - // AlternateName - namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) - - // ClusterArmReference - if source.ClusterArmId != nil { - clusterArmReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterArmId) - namespace.ClusterArmReference = &clusterArmReference - } else { - namespace.ClusterArmReference = nil - } - - // DisableLocalAuth - if source.DisableLocalAuth != nil { - disableLocalAuth := *source.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } else { - namespace.DisableLocalAuth = nil - } - - // Encryption - if source.Encryption != nil { - var encryption Encryption - err := encryption.Initialize_From_Encryption_STATUS(source.Encryption) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Encryption_STATUS() to populate field Encryption") - } - namespace.Encryption = &encryption - } else { - namespace.Encryption = nil - } - - // Identity - if source.Identity != nil { - var identity Identity - err := identity.Initialize_From_Identity_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Identity_STATUS() to populate field Identity") - } - namespace.Identity = &identity - } else { - namespace.Identity = nil - } - - // IsAutoInflateEnabled - if source.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *source.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - namespace.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if source.KafkaEnabled != nil { - kafkaEnabled := *source.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } else { - namespace.KafkaEnabled = nil - } - - // Location - namespace.Location = genruntime.ClonePointerToString(source.Location) - - // MaximumThroughputUnits - if source.MaximumThroughputUnits != nil { - maximumThroughputUnit := *source.MaximumThroughputUnits - namespace.MaximumThroughputUnits = &maximumThroughputUnit - } else { - namespace.MaximumThroughputUnits = nil - } - - // MinimumTlsVersion - if source.MinimumTlsVersion != nil { - minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_Spec(*source.MinimumTlsVersion) - namespace.MinimumTlsVersion = &minimumTlsVersion - } else { - namespace.MinimumTlsVersion = nil - } - - // PublicNetworkAccess - if source.PublicNetworkAccess != nil { - publicNetworkAccess := Namespace_Properties_PublicNetworkAccess_Spec(*source.PublicNetworkAccess) - namespace.PublicNetworkAccess = &publicNetworkAccess - } else { - namespace.PublicNetworkAccess = nil - } - - // Sku - if source.Sku != nil { - var sku Sku - err := sku.Initialize_From_Sku_STATUS(source.Sku) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Sku_STATUS() to populate field Sku") - } - namespace.Sku = &sku - } else { - namespace.Sku = nil - } - - // Tags - namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) - - // ZoneRedundant - if source.ZoneRedundant != nil { - zoneRedundant := *source.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } else { - namespace.ZoneRedundant = nil - } - - // No error - return nil -} - -// OriginalVersion returns the original API version used to create the resource. -func (namespace *Namespace_Spec) OriginalVersion() string { - return GroupVersion.Version -} - -// SetAzureName sets the Azure name of the resource -func (namespace *Namespace_Spec) SetAzureName(azureName string) { namespace.AzureName = azureName } - -type Namespace_STATUS struct { - // AlternateName: Alternate name specified when alias and namespace names are same. - AlternateName *string `json:"alternateName,omitempty"` - - // ClusterArmId: Cluster ARM ID of the Namespace. - ClusterArmId *string `json:"clusterArmId,omitempty"` - - // Conditions: The observed state of the resource - Conditions []conditions.Condition `json:"conditions,omitempty"` - - // CreatedAt: The time the Namespace was created. - CreatedAt *string `json:"createdAt,omitempty"` - - // DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - - // Encryption: Properties of BYOK Encryption description - Encryption *Encryption_STATUS `json:"encryption,omitempty"` - - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Identity: Properties of BYOK Identity description - Identity *Identity_STATUS `json:"identity,omitempty"` - - // IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace. - IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` - - // KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace. - KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` - - // Location: Resource location. - Location *string `json:"location,omitempty"` - - // MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 - // throughput units. ( '0' if AutoInflateEnabled = true) - MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` - - // MetricId: Identifier for Azure Insights metrics. - MetricId *string `json:"metricId,omitempty"` - - // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' - MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_STATUS `json:"minimumTlsVersion,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // PrivateEndpointConnections: List of private endpoint connections. - PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"` - - // ProvisioningState: Provisioning state of the Namespace. - ProvisioningState *string `json:"provisioningState,omitempty"` - - // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. - PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"` - - // ServiceBusEndpoint: Endpoint you can use to perform Service Bus operations. - ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` - - // Sku: Properties of sku resource - Sku *Sku_STATUS `json:"sku,omitempty"` - - // Status: Status of the Namespace. - Status *string `json:"status,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - - // Tags: Resource tags. - Tags map[string]string `json:"tags,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` - - // UpdatedAt: The time the Namespace was updated. - UpdatedAt *string `json:"updatedAt,omitempty"` - - // ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespace_STATUS{} - -// ConvertStatusFrom populates our Namespace_STATUS from the provided source -func (namespace *Namespace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespace_STATUS) - if ok { - // Populate our instance from source - return namespace.AssignProperties_From_Namespace_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespace_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") - } - - // Update our instance from src - err = namespace.AssignProperties_From_Namespace_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil -} - -// ConvertStatusTo populates the provided destination from our Namespace_STATUS -func (namespace *Namespace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespace_STATUS) - if ok { - // Populate destination from our instance - return namespace.AssignProperties_To_Namespace_STATUS(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespace_STATUS{} - err := namespace.AssignProperties_To_Namespace_STATUS(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 = &Namespace_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (namespace *Namespace_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespace_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (namespace *Namespace_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespace_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespace_STATUS_ARM, got %T", armInput) - } - - // Set property "AlternateName": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.AlternateName != nil { - alternateName := *typedInput.Properties.AlternateName - namespace.AlternateName = &alternateName - } - } - - // Set property "ClusterArmId": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.ClusterArmId != nil { - clusterArmId := *typedInput.Properties.ClusterArmId - namespace.ClusterArmId = &clusterArmId - } - } - - // no assignment for property "Conditions" - - // Set property "CreatedAt": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.CreatedAt != nil { - createdAt := *typedInput.Properties.CreatedAt - namespace.CreatedAt = &createdAt - } - } - - // Set property "DisableLocalAuth": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DisableLocalAuth != nil { - disableLocalAuth := *typedInput.Properties.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } - } - - // Set property "Encryption": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.Encryption != nil { - var encryption1 Encryption_STATUS - err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption) - if err != nil { - return err - } - encryption := encryption1 - namespace.Encryption = &encryption - } - } - - // Set property "Id": - if typedInput.Id != nil { - id := *typedInput.Id - namespace.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 - namespace.Identity = &identity - } - - // Set property "IsAutoInflateEnabled": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *typedInput.Properties.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } - } - - // Set property "KafkaEnabled": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.KafkaEnabled != nil { - kafkaEnabled := *typedInput.Properties.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } - } - - // Set property "Location": - if typedInput.Location != nil { - location := *typedInput.Location - namespace.Location = &location - } - - // Set property "MaximumThroughputUnits": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.MaximumThroughputUnits != nil { - maximumThroughputUnits := *typedInput.Properties.MaximumThroughputUnits - namespace.MaximumThroughputUnits = &maximumThroughputUnits - } - } - - // Set property "MetricId": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.MetricId != nil { - metricId := *typedInput.Properties.MetricId - namespace.MetricId = &metricId - } - } - - // Set property "MinimumTlsVersion": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.MinimumTlsVersion != nil { - minimumTlsVersion := *typedInput.Properties.MinimumTlsVersion - namespace.MinimumTlsVersion = &minimumTlsVersion - } - } - - // Set property "Name": - if typedInput.Name != nil { - name := *typedInput.Name - namespace.Name = &name - } - - // Set property "PrivateEndpointConnections": - // copying flattened property: - if typedInput.Properties != nil { - for _, item := range typedInput.Properties.PrivateEndpointConnections { - var item1 PrivateEndpointConnection_STATUS - err := item1.PopulateFromARM(owner, item) - if err != nil { - return err - } - namespace.PrivateEndpointConnections = append(namespace.PrivateEndpointConnections, item1) - } - } - - // Set property "ProvisioningState": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.ProvisioningState != nil { - provisioningState := *typedInput.Properties.ProvisioningState - namespace.ProvisioningState = &provisioningState - } - } - - // Set property "PublicNetworkAccess": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.PublicNetworkAccess != nil { - publicNetworkAccess := *typedInput.Properties.PublicNetworkAccess - namespace.PublicNetworkAccess = &publicNetworkAccess - } - } - - // Set property "ServiceBusEndpoint": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.ServiceBusEndpoint != nil { - serviceBusEndpoint := *typedInput.Properties.ServiceBusEndpoint - namespace.ServiceBusEndpoint = &serviceBusEndpoint - } - } - - // Set property "Sku": - if typedInput.Sku != nil { - var sku1 Sku_STATUS - err := sku1.PopulateFromARM(owner, *typedInput.Sku) - if err != nil { - return err - } - sku := sku1 - namespace.Sku = &sku - } - - // Set property "Status": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.Status != nil { - status := *typedInput.Properties.Status - namespace.Status = &status - } - } - - // Set property "SystemData": - if typedInput.SystemData != nil { - var systemData1 SystemData_STATUS - err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) - if err != nil { - return err - } - systemData := systemData1 - namespace.SystemData = &systemData - } - - // Set property "Tags": - if typedInput.Tags != nil { - namespace.Tags = make(map[string]string, len(typedInput.Tags)) - for key, value := range typedInput.Tags { - namespace.Tags[key] = value - } - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - namespace.Type = &typeVar - } - - // Set property "UpdatedAt": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.UpdatedAt != nil { - updatedAt := *typedInput.Properties.UpdatedAt - namespace.UpdatedAt = &updatedAt - } - } - - // Set property "ZoneRedundant": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.ZoneRedundant != nil { - zoneRedundant := *typedInput.Properties.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } - } - - // No error - return nil -} - -// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS -func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *v20240101s.Namespace_STATUS) error { - - // AlternateName - namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) - - // ClusterArmId - namespace.ClusterArmId = genruntime.ClonePointerToString(source.ClusterArmId) - - // Conditions - namespace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // CreatedAt - namespace.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) - - // DisableLocalAuth - if source.DisableLocalAuth != nil { - disableLocalAuth := *source.DisableLocalAuth - namespace.DisableLocalAuth = &disableLocalAuth - } else { - namespace.DisableLocalAuth = nil - } - - // Encryption - if source.Encryption != nil { - var encryption Encryption_STATUS - err := encryption.AssignProperties_From_Encryption_STATUS(source.Encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Encryption_STATUS() to populate field Encryption") - } - namespace.Encryption = &encryption - } else { - namespace.Encryption = nil - } - - // Id - namespace.Id = genruntime.ClonePointerToString(source.Id) - - // Identity - if source.Identity != nil { - var identity Identity_STATUS - err := identity.AssignProperties_From_Identity_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Identity_STATUS() to populate field Identity") - } - namespace.Identity = &identity - } else { - namespace.Identity = nil - } - - // IsAutoInflateEnabled - if source.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *source.IsAutoInflateEnabled - namespace.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - namespace.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if source.KafkaEnabled != nil { - kafkaEnabled := *source.KafkaEnabled - namespace.KafkaEnabled = &kafkaEnabled - } else { - namespace.KafkaEnabled = nil - } - - // Location - namespace.Location = genruntime.ClonePointerToString(source.Location) - - // MaximumThroughputUnits - namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits) - - // MetricId - namespace.MetricId = genruntime.ClonePointerToString(source.MetricId) - - // MinimumTlsVersion - if source.MinimumTlsVersion != nil { - minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_STATUS(*source.MinimumTlsVersion) - namespace.MinimumTlsVersion = &minimumTlsVersion - } else { - namespace.MinimumTlsVersion = nil - } - - // Name - namespace.Name = genruntime.ClonePointerToString(source.Name) - - // PrivateEndpointConnections - if source.PrivateEndpointConnections != nil { - privateEndpointConnectionList := make([]PrivateEndpointConnection_STATUS, len(source.PrivateEndpointConnections)) - for privateEndpointConnectionIndex, privateEndpointConnectionItem := range source.PrivateEndpointConnections { - // Shadow the loop variable to avoid aliasing - privateEndpointConnectionItem := privateEndpointConnectionItem - var privateEndpointConnection PrivateEndpointConnection_STATUS - err := privateEndpointConnection.AssignProperties_From_PrivateEndpointConnection_STATUS(&privateEndpointConnectionItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") - } - privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection - } - namespace.PrivateEndpointConnections = privateEndpointConnectionList - } else { - namespace.PrivateEndpointConnections = nil - } - - // ProvisioningState - namespace.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState) - - // PublicNetworkAccess - if source.PublicNetworkAccess != nil { - publicNetworkAccess := Namespace_Properties_PublicNetworkAccess_STATUS(*source.PublicNetworkAccess) - namespace.PublicNetworkAccess = &publicNetworkAccess - } else { - namespace.PublicNetworkAccess = nil - } - - // ServiceBusEndpoint - namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) - - // Sku - if source.Sku != nil { - var sku Sku_STATUS - err := sku.AssignProperties_From_Sku_STATUS(source.Sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Sku_STATUS() to populate field Sku") - } - namespace.Sku = &sku - } else { - namespace.Sku = nil - } - - // Status - namespace.Status = genruntime.ClonePointerToString(source.Status) - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - namespace.SystemData = &systemDatum - } else { - namespace.SystemData = nil - } - - // Tags - namespace.Tags = genruntime.CloneMapOfStringToString(source.Tags) - - // Type - namespace.Type = genruntime.ClonePointerToString(source.Type) - - // UpdatedAt - namespace.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) - - // ZoneRedundant - if source.ZoneRedundant != nil { - zoneRedundant := *source.ZoneRedundant - namespace.ZoneRedundant = &zoneRedundant - } else { - namespace.ZoneRedundant = nil - } - - // No error - return nil -} - -// AssignProperties_To_Namespace_STATUS populates the provided destination Namespace_STATUS from our Namespace_STATUS -func (namespace *Namespace_STATUS) AssignProperties_To_Namespace_STATUS(destination *v20240101s.Namespace_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // AlternateName - destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) - - // ClusterArmId - destination.ClusterArmId = genruntime.ClonePointerToString(namespace.ClusterArmId) - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(namespace.Conditions) - - // CreatedAt - destination.CreatedAt = genruntime.ClonePointerToString(namespace.CreatedAt) - - // DisableLocalAuth - if namespace.DisableLocalAuth != nil { - disableLocalAuth := *namespace.DisableLocalAuth - destination.DisableLocalAuth = &disableLocalAuth - } else { - destination.DisableLocalAuth = nil - } - - // Encryption - if namespace.Encryption != nil { - var encryption v20240101s.Encryption_STATUS - err := namespace.Encryption.AssignProperties_To_Encryption_STATUS(&encryption) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Encryption_STATUS() to populate field Encryption") - } - destination.Encryption = &encryption - } else { - destination.Encryption = nil - } - - // Id - destination.Id = genruntime.ClonePointerToString(namespace.Id) - - // Identity - if namespace.Identity != nil { - var identity v20240101s.Identity_STATUS - err := namespace.Identity.AssignProperties_To_Identity_STATUS(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Identity_STATUS() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // IsAutoInflateEnabled - if namespace.IsAutoInflateEnabled != nil { - isAutoInflateEnabled := *namespace.IsAutoInflateEnabled - destination.IsAutoInflateEnabled = &isAutoInflateEnabled - } else { - destination.IsAutoInflateEnabled = nil - } - - // KafkaEnabled - if namespace.KafkaEnabled != nil { - kafkaEnabled := *namespace.KafkaEnabled - destination.KafkaEnabled = &kafkaEnabled - } else { - destination.KafkaEnabled = nil - } - - // Location - destination.Location = genruntime.ClonePointerToString(namespace.Location) - - // MaximumThroughputUnits - destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits) - - // MetricId - destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) - - // MinimumTlsVersion - if namespace.MinimumTlsVersion != nil { - minimumTlsVersion := string(*namespace.MinimumTlsVersion) - destination.MinimumTlsVersion = &minimumTlsVersion - } else { - destination.MinimumTlsVersion = nil - } - - // Name - destination.Name = genruntime.ClonePointerToString(namespace.Name) - - // PrivateEndpointConnections - if namespace.PrivateEndpointConnections != nil { - privateEndpointConnectionList := make([]v20240101s.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) - for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { - // Shadow the loop variable to avoid aliasing - privateEndpointConnectionItem := privateEndpointConnectionItem - var privateEndpointConnection v20240101s.PrivateEndpointConnection_STATUS - err := privateEndpointConnectionItem.AssignProperties_To_PrivateEndpointConnection_STATUS(&privateEndpointConnection) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") - } - privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection - } - destination.PrivateEndpointConnections = privateEndpointConnectionList - } else { - destination.PrivateEndpointConnections = nil - } - - // ProvisioningState - destination.ProvisioningState = genruntime.ClonePointerToString(namespace.ProvisioningState) - - // PublicNetworkAccess - if namespace.PublicNetworkAccess != nil { - publicNetworkAccess := string(*namespace.PublicNetworkAccess) - destination.PublicNetworkAccess = &publicNetworkAccess - } else { - destination.PublicNetworkAccess = nil - } - - // ServiceBusEndpoint - destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) - - // Sku - if namespace.Sku != nil { - var sku v20240101s.Sku_STATUS - err := namespace.Sku.AssignProperties_To_Sku_STATUS(&sku) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Sku_STATUS() to populate field Sku") - } - destination.Sku = &sku - } else { - destination.Sku = nil - } - - // Status - destination.Status = genruntime.ClonePointerToString(namespace.Status) - - // SystemData - if namespace.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := namespace.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Tags - destination.Tags = genruntime.CloneMapOfStringToString(namespace.Tags) - - // Type - destination.Type = genruntime.ClonePointerToString(namespace.Type) - - // UpdatedAt - destination.UpdatedAt = genruntime.ClonePointerToString(namespace.UpdatedAt) - - // ZoneRedundant - if namespace.ZoneRedundant != nil { - zoneRedundant := *namespace.ZoneRedundant - destination.ZoneRedundant = &zoneRedundant - } else { - destination.ZoneRedundant = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Properties to configure Encryption -type Encryption struct { - // KeySource: Enumerates the possible value of keySource for Encryption - KeySource *Encryption_KeySource `json:"keySource,omitempty"` - - // KeyVaultProperties: Properties of KeyVault - KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` - - // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -var _ genruntime.ARMTransformer = &Encryption{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (encryption *Encryption) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if encryption == nil { - return nil, nil - } - result := &Encryption_ARM{} - - // Set property "KeySource": - if encryption.KeySource != nil { - keySource := *encryption.KeySource - result.KeySource = &keySource - } - - // Set property "KeyVaultProperties": - for _, item := range encryption.KeyVaultProperties { - item_ARM, err := item.ConvertToARM(resolved) - if err != nil { - return nil, err - } - result.KeyVaultProperties = append(result.KeyVaultProperties, *item_ARM.(*KeyVaultProperties_ARM)) - } - - // Set property "RequireInfrastructureEncryption": - if encryption.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption - result.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (encryption *Encryption) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Encryption_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (encryption *Encryption) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Encryption_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Encryption_ARM, got %T", armInput) - } - - // Set property "KeySource": - if typedInput.KeySource != nil { - keySource := *typedInput.KeySource - encryption.KeySource = &keySource - } - - // Set property "KeyVaultProperties": - for _, item := range typedInput.KeyVaultProperties { - var item1 KeyVaultProperties - err := item1.PopulateFromARM(owner, item) - if err != nil { - return err - } - encryption.KeyVaultProperties = append(encryption.KeyVaultProperties, item1) - } - - // Set property "RequireInfrastructureEncryption": - if typedInput.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *typedInput.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } - - // No error - return nil -} - -// AssignProperties_From_Encryption populates our Encryption from the provided source Encryption -func (encryption *Encryption) AssignProperties_From_Encryption(source *v20240101s.Encryption) error { - - // KeySource - if source.KeySource != nil { - keySource := Encryption_KeySource(*source.KeySource) - encryption.KeySource = &keySource - } else { - encryption.KeySource = nil - } - - // KeyVaultProperties - if source.KeyVaultProperties != nil { - keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty KeyVaultProperties - err := keyVaultProperty.AssignProperties_From_KeyVaultProperties(&keyVaultPropertyItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - encryption.KeyVaultProperties = keyVaultPropertyList - } else { - encryption.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if source.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *source.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - encryption.RequireInfrastructureEncryption = nil - } - - // No error - return nil -} - -// AssignProperties_To_Encryption populates the provided destination Encryption from our Encryption -func (encryption *Encryption) AssignProperties_To_Encryption(destination *v20240101s.Encryption) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // KeySource - if encryption.KeySource != nil { - keySource := string(*encryption.KeySource) - destination.KeySource = &keySource - } else { - destination.KeySource = nil - } - - // KeyVaultProperties - if encryption.KeyVaultProperties != nil { - keyVaultPropertyList := make([]v20240101s.KeyVaultProperties, len(encryption.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty v20240101s.KeyVaultProperties - err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties(&keyVaultProperty) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - destination.KeyVaultProperties = keyVaultPropertyList - } else { - destination.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if encryption.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption - destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - destination.RequireInfrastructureEncryption = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Encryption_STATUS populates our Encryption from the provided source Encryption_STATUS -func (encryption *Encryption) Initialize_From_Encryption_STATUS(source *Encryption_STATUS) error { - - // KeySource - if source.KeySource != nil { - keySource := Encryption_KeySource(*source.KeySource) - encryption.KeySource = &keySource - } else { - encryption.KeySource = nil - } - - // KeyVaultProperties - if source.KeyVaultProperties != nil { - keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty KeyVaultProperties - err := keyVaultProperty.Initialize_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - encryption.KeyVaultProperties = keyVaultPropertyList - } else { - encryption.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if source.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *source.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - encryption.RequireInfrastructureEncryption = nil - } - - // No error - return nil -} - -// Properties to configure Encryption -type Encryption_STATUS struct { - // KeySource: Enumerates the possible value of keySource for Encryption - KeySource *Encryption_KeySource_STATUS `json:"keySource,omitempty"` - - // KeyVaultProperties: Properties of KeyVault - KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` - - // RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption) - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -var _ genruntime.FromARMConverter = &Encryption_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (encryption *Encryption_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Encryption_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (encryption *Encryption_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Encryption_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Encryption_STATUS_ARM, got %T", armInput) - } - - // Set property "KeySource": - if typedInput.KeySource != nil { - keySource := *typedInput.KeySource - encryption.KeySource = &keySource - } - - // Set property "KeyVaultProperties": - for _, item := range typedInput.KeyVaultProperties { - var item1 KeyVaultProperties_STATUS - err := item1.PopulateFromARM(owner, item) - if err != nil { - return err - } - encryption.KeyVaultProperties = append(encryption.KeyVaultProperties, item1) - } - - // Set property "RequireInfrastructureEncryption": - if typedInput.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *typedInput.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } - - // No error - return nil -} - -// AssignProperties_From_Encryption_STATUS populates our Encryption_STATUS from the provided source Encryption_STATUS -func (encryption *Encryption_STATUS) AssignProperties_From_Encryption_STATUS(source *v20240101s.Encryption_STATUS) error { - - // KeySource - if source.KeySource != nil { - keySource := Encryption_KeySource_STATUS(*source.KeySource) - encryption.KeySource = &keySource - } else { - encryption.KeySource = nil - } - - // KeyVaultProperties - if source.KeyVaultProperties != nil { - keyVaultPropertyList := make([]KeyVaultProperties_STATUS, len(source.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty KeyVaultProperties_STATUS - err := keyVaultProperty.AssignProperties_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - encryption.KeyVaultProperties = keyVaultPropertyList - } else { - encryption.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if source.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *source.RequireInfrastructureEncryption - encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - encryption.RequireInfrastructureEncryption = nil - } - - // No error - return nil -} - -// AssignProperties_To_Encryption_STATUS populates the provided destination Encryption_STATUS from our Encryption_STATUS -func (encryption *Encryption_STATUS) AssignProperties_To_Encryption_STATUS(destination *v20240101s.Encryption_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // KeySource - if encryption.KeySource != nil { - keySource := string(*encryption.KeySource) - destination.KeySource = &keySource - } else { - destination.KeySource = nil - } - - // KeyVaultProperties - if encryption.KeyVaultProperties != nil { - keyVaultPropertyList := make([]v20240101s.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) - for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { - // Shadow the loop variable to avoid aliasing - keyVaultPropertyItem := keyVaultPropertyItem - var keyVaultProperty v20240101s.KeyVaultProperties_STATUS - err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_KeyVaultProperties_STATUS() to populate field KeyVaultProperties") - } - keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty - } - destination.KeyVaultProperties = keyVaultPropertyList - } else { - destination.KeyVaultProperties = nil - } - - // RequireInfrastructureEncryption - if encryption.RequireInfrastructureEncryption != nil { - requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption - destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption - } else { - destination.RequireInfrastructureEncryption = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Properties to configure Identity for Bring your Own Keys -type Identity struct { - // Type: Type of managed service identity. - Type *Identity_Type `json:"type,omitempty"` - - // UserAssignedIdentities: Properties for User Assigned Identities - UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` -} - -var _ genruntime.ARMTransformer = &Identity{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (identity *Identity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if identity == nil { - return nil, nil - } - result := &Identity_ARM{} - - // Set property "Type": - if identity.Type != nil { - typeVar := *identity.Type - result.Type = &typeVar - } - - // Set property "UserAssignedIdentities": - result.UserAssignedIdentities = make(map[string]UserAssignedIdentityDetails_ARM, len(identity.UserAssignedIdentities)) - for _, ident := range identity.UserAssignedIdentities { - identARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference) - if err != nil { - return nil, err - } - key := identARMID - result.UserAssignedIdentities[key] = UserAssignedIdentityDetails_ARM{} - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (identity *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Identity_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (identity *Identity) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Identity_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Identity_ARM, got %T", armInput) - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - identity.Type = &typeVar - } - - // no assignment for property "UserAssignedIdentities" - - // No error - return nil -} - -// AssignProperties_From_Identity populates our Identity from the provided source Identity -func (identity *Identity) AssignProperties_From_Identity(source *v20240101s.Identity) error { - - // Type - if source.Type != nil { - typeVar := Identity_Type(*source.Type) - identity.Type = &typeVar - } else { - identity.Type = nil - } - - // UserAssignedIdentities - if source.UserAssignedIdentities != nil { - userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities)) - for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities { - // Shadow the loop variable to avoid aliasing - userAssignedIdentityItem := userAssignedIdentityItem - var userAssignedIdentity UserAssignedIdentityDetails - err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") - } - userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity - } - identity.UserAssignedIdentities = userAssignedIdentityList - } else { - identity.UserAssignedIdentities = nil - } - - // No error - return nil -} - -// AssignProperties_To_Identity populates the provided destination Identity from our Identity -func (identity *Identity) AssignProperties_To_Identity(destination *v20240101s.Identity) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Type - if identity.Type != nil { - typeVar := string(*identity.Type) - destination.Type = &typeVar - } else { - destination.Type = nil - } - - // UserAssignedIdentities - if identity.UserAssignedIdentities != nil { - userAssignedIdentityList := make([]v20240101s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) - for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { - // Shadow the loop variable to avoid aliasing - userAssignedIdentityItem := userAssignedIdentityItem - var userAssignedIdentity v20240101s.UserAssignedIdentityDetails - err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") - } - userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity - } - destination.UserAssignedIdentities = userAssignedIdentityList - } else { - destination.UserAssignedIdentities = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Identity_STATUS populates our Identity from the provided source Identity_STATUS -func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error { - - // Type - if source.Type != nil { - typeVar := Identity_Type(*source.Type) - identity.Type = &typeVar - } else { - identity.Type = nil - } - - // UserAssignedIdentities - if source.UserAssignedIdentities != nil { - userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities)) - for userAssignedIdentitiesKey := range source.UserAssignedIdentities { - userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey) - userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef}) - } - identity.UserAssignedIdentities = userAssignedIdentityList - } else { - identity.UserAssignedIdentities = nil - } - - // No error - return nil -} - -// Properties to configure Identity for Bring your Own Keys -type Identity_STATUS struct { - // PrincipalId: ObjectId from the KeyVault - PrincipalId *string `json:"principalId,omitempty"` - - // TenantId: TenantId from the KeyVault - TenantId *string `json:"tenantId,omitempty"` - - // Type: Type of managed service identity. - Type *Identity_Type_STATUS `json:"type,omitempty"` - - // UserAssignedIdentities: Properties for User Assigned Identities - 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_STATUS_ARM{} -} - -// 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_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Identity_STATUS_ARM, 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 -} - -// AssignProperties_From_Identity_STATUS populates our Identity_STATUS from the provided source Identity_STATUS -func (identity *Identity_STATUS) AssignProperties_From_Identity_STATUS(source *v20240101s.Identity_STATUS) error { - - // PrincipalId - identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) - - // TenantId - identity.TenantId = genruntime.ClonePointerToString(source.TenantId) - - // Type - if source.Type != nil { - typeVar := Identity_Type_STATUS(*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.AssignProperties_From_UserAssignedIdentity_STATUS(&userAssignedIdentityValue) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") - } - userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity - } - identity.UserAssignedIdentities = userAssignedIdentityMap - } else { - identity.UserAssignedIdentities = nil - } - - // No error - return nil -} - -// AssignProperties_To_Identity_STATUS populates the provided destination Identity_STATUS from our Identity_STATUS -func (identity *Identity_STATUS) AssignProperties_To_Identity_STATUS(destination *v20240101s.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]v20240101s.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) - for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { - // Shadow the loop variable to avoid aliasing - userAssignedIdentityValue := userAssignedIdentityValue - var userAssignedIdentity v20240101s.UserAssignedIdentity_STATUS - err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity_STATUS() to populate field UserAssignedIdentities") - } - userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity - } - destination.UserAssignedIdentities = userAssignedIdentityMap - } else { - destination.UserAssignedIdentities = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// +kubebuilder:validation:Enum={"1.0","1.1","1.2"} -type Namespace_Properties_MinimumTlsVersion_Spec string - -const ( - Namespace_Properties_MinimumTlsVersion_Spec_10 = Namespace_Properties_MinimumTlsVersion_Spec("1.0") - Namespace_Properties_MinimumTlsVersion_Spec_11 = Namespace_Properties_MinimumTlsVersion_Spec("1.1") - Namespace_Properties_MinimumTlsVersion_Spec_12 = Namespace_Properties_MinimumTlsVersion_Spec("1.2") -) - -type Namespace_Properties_MinimumTlsVersion_STATUS string - -const ( - Namespace_Properties_MinimumTlsVersion_STATUS_10 = Namespace_Properties_MinimumTlsVersion_STATUS("1.0") - Namespace_Properties_MinimumTlsVersion_STATUS_11 = Namespace_Properties_MinimumTlsVersion_STATUS("1.1") - Namespace_Properties_MinimumTlsVersion_STATUS_12 = Namespace_Properties_MinimumTlsVersion_STATUS("1.2") -) - -// +kubebuilder:validation:Enum={"Disabled","Enabled","SecuredByPerimeter"} -type Namespace_Properties_PublicNetworkAccess_Spec string - -const ( - Namespace_Properties_PublicNetworkAccess_Spec_Disabled = Namespace_Properties_PublicNetworkAccess_Spec("Disabled") - Namespace_Properties_PublicNetworkAccess_Spec_Enabled = Namespace_Properties_PublicNetworkAccess_Spec("Enabled") - Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter = Namespace_Properties_PublicNetworkAccess_Spec("SecuredByPerimeter") -) - -type Namespace_Properties_PublicNetworkAccess_STATUS string - -const ( - Namespace_Properties_PublicNetworkAccess_STATUS_Disabled = Namespace_Properties_PublicNetworkAccess_STATUS("Disabled") - Namespace_Properties_PublicNetworkAccess_STATUS_Enabled = Namespace_Properties_PublicNetworkAccess_STATUS("Enabled") - Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter = Namespace_Properties_PublicNetworkAccess_STATUS("SecuredByPerimeter") -) - -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type NamespaceOperatorSpec struct { - // Secrets: configures where to place Azure generated secrets. - Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` -} - -// AssignProperties_From_NamespaceOperatorSpec populates our NamespaceOperatorSpec from the provided source NamespaceOperatorSpec -func (operator *NamespaceOperatorSpec) AssignProperties_From_NamespaceOperatorSpec(source *v20240101s.NamespaceOperatorSpec) error { - - // Secrets - if source.Secrets != nil { - var secret NamespaceOperatorSecrets - err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSecrets() to populate field Secrets") - } - operator.Secrets = &secret - } else { - operator.Secrets = nil - } - - // No error - return nil -} - -// AssignProperties_To_NamespaceOperatorSpec populates the provided destination NamespaceOperatorSpec from our NamespaceOperatorSpec -func (operator *NamespaceOperatorSpec) AssignProperties_To_NamespaceOperatorSpec(destination *v20240101s.NamespaceOperatorSpec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Secrets - if operator.Secrets != nil { - var secret v20240101s.NamespaceOperatorSecrets - err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSecrets() 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 -} - -// Properties of the PrivateEndpointConnection. -type PrivateEndpointConnection_STATUS struct { - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` -} - -var _ genruntime.FromARMConverter = &PrivateEndpointConnection_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (connection *PrivateEndpointConnection_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &PrivateEndpointConnection_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (connection *PrivateEndpointConnection_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(PrivateEndpointConnection_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected PrivateEndpointConnection_STATUS_ARM, got %T", armInput) - } - - // Set property "Id": - if typedInput.Id != nil { - id := *typedInput.Id - connection.Id = &id - } - - // No error - return nil -} - -// AssignProperties_From_PrivateEndpointConnection_STATUS populates our PrivateEndpointConnection_STATUS from the provided source PrivateEndpointConnection_STATUS -func (connection *PrivateEndpointConnection_STATUS) AssignProperties_From_PrivateEndpointConnection_STATUS(source *v20240101s.PrivateEndpointConnection_STATUS) error { - - // Id - connection.Id = genruntime.ClonePointerToString(source.Id) - - // No error - return nil -} - -// AssignProperties_To_PrivateEndpointConnection_STATUS populates the provided destination PrivateEndpointConnection_STATUS from our PrivateEndpointConnection_STATUS -func (connection *PrivateEndpointConnection_STATUS) AssignProperties_To_PrivateEndpointConnection_STATUS(destination *v20240101s.PrivateEndpointConnection_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Id - destination.Id = genruntime.ClonePointerToString(connection.Id) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// SKU parameters supplied to the create namespace operation -type Sku struct { - // +kubebuilder:validation:Minimum=0 - // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. - // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. - Capacity *int `json:"capacity,omitempty"` - - // +kubebuilder:validation:Required - // Name: Name of this SKU. - Name *Sku_Name `json:"name,omitempty"` - - // Tier: The billing tier of this particular SKU. - Tier *Sku_Tier `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 := &Sku_ARM{} - - // Set property "Capacity": - if sku.Capacity != nil { - capacity := *sku.Capacity - result.Capacity = &capacity - } - - // 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 &Sku_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (sku *Sku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Sku_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Sku_ARM, got %T", armInput) - } - - // Set property "Capacity": - if typedInput.Capacity != nil { - capacity := *typedInput.Capacity - sku.Capacity = &capacity - } - - // 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 -} - -// AssignProperties_From_Sku populates our Sku from the provided source Sku -func (sku *Sku) AssignProperties_From_Sku(source *v20240101s.Sku) error { - - // Capacity - if source.Capacity != nil { - capacity := *source.Capacity - sku.Capacity = &capacity - } else { - sku.Capacity = nil - } - - // Name - if source.Name != nil { - name := Sku_Name(*source.Name) - sku.Name = &name - } else { - sku.Name = nil - } - - // Tier - if source.Tier != nil { - tier := Sku_Tier(*source.Tier) - sku.Tier = &tier - } else { - sku.Tier = nil - } - - // No error - return nil -} - -// AssignProperties_To_Sku populates the provided destination Sku from our Sku -func (sku *Sku) AssignProperties_To_Sku(destination *v20240101s.Sku) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Capacity - if sku.Capacity != nil { - capacity := *sku.Capacity - destination.Capacity = &capacity - } else { - destination.Capacity = nil - } - - // Name - if sku.Name != nil { - name := string(*sku.Name) - destination.Name = &name - } else { - destination.Name = nil - } - - // Tier - if sku.Tier != nil { - tier := string(*sku.Tier) - destination.Tier = &tier - } else { - destination.Tier = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Sku_STATUS populates our Sku from the provided source Sku_STATUS -func (sku *Sku) Initialize_From_Sku_STATUS(source *Sku_STATUS) error { - - // Capacity - if source.Capacity != nil { - capacity := *source.Capacity - sku.Capacity = &capacity - } else { - sku.Capacity = nil - } - - // Name - if source.Name != nil { - name := Sku_Name(*source.Name) - sku.Name = &name - } else { - sku.Name = nil - } - - // Tier - if source.Tier != nil { - tier := Sku_Tier(*source.Tier) - sku.Tier = &tier - } else { - sku.Tier = nil - } - - // No error - return nil -} - -// SKU parameters supplied to the create namespace operation -type Sku_STATUS struct { - // Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units. - // The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units. - Capacity *int `json:"capacity,omitempty"` - - // Name: Name of this SKU. - Name *Sku_Name_STATUS `json:"name,omitempty"` - - // Tier: The billing tier of this particular SKU. - Tier *Sku_Tier_STATUS `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_STATUS_ARM{} -} - -// 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_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Sku_STATUS_ARM, got %T", armInput) - } - - // Set property "Capacity": - if typedInput.Capacity != nil { - capacity := *typedInput.Capacity - sku.Capacity = &capacity - } - - // 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 -} - -// AssignProperties_From_Sku_STATUS populates our Sku_STATUS from the provided source Sku_STATUS -func (sku *Sku_STATUS) AssignProperties_From_Sku_STATUS(source *v20240101s.Sku_STATUS) error { - - // Capacity - sku.Capacity = genruntime.ClonePointerToInt(source.Capacity) - - // Name - if source.Name != nil { - name := Sku_Name_STATUS(*source.Name) - sku.Name = &name - } else { - sku.Name = nil - } - - // Tier - if source.Tier != nil { - tier := Sku_Tier_STATUS(*source.Tier) - sku.Tier = &tier - } else { - sku.Tier = nil - } - - // No error - return nil -} - -// AssignProperties_To_Sku_STATUS populates the provided destination Sku_STATUS from our Sku_STATUS -func (sku *Sku_STATUS) AssignProperties_To_Sku_STATUS(destination *v20240101s.Sku_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Capacity - destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity) - - // Name - if sku.Name != nil { - name := string(*sku.Name) - destination.Name = &name - } else { - destination.Name = nil - } - - // Tier - if sku.Tier != nil { - tier := string(*sku.Tier) - destination.Tier = &tier - } else { - destination.Tier = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Metadata pertaining to creation and last modification of the resource. -type SystemData_STATUS struct { - // CreatedAt: The timestamp of resource creation (UTC). - CreatedAt *string `json:"createdAt,omitempty"` - - // CreatedBy: The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - - // CreatedByType: The type of identity that created the resource. - CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"` - - // LastModifiedAt: The type of identity that last modified the resource. - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - - // LastModifiedBy: The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - - // LastModifiedByType: The type of identity that last modified the resource. - LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"` -} - -var _ genruntime.FromARMConverter = &SystemData_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (data *SystemData_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &SystemData_STATUS_ARM{} -} - -// 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_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SystemData_STATUS_ARM, 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 -} - -// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS -func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *v20240101s.SystemData_STATUS) error { - - // CreatedAt - data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) - - // CreatedBy - data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) - - // CreatedByType - if source.CreatedByType != nil { - createdByType := SystemData_CreatedByType_STATUS(*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 := SystemData_LastModifiedByType_STATUS(*source.LastModifiedByType) - data.LastModifiedByType = &lastModifiedByType - } else { - data.LastModifiedByType = nil - } - - // No error - return nil -} - -// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS -func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *v20240101s.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 -} - -// +kubebuilder:validation:Enum={"Microsoft.KeyVault"} -type Encryption_KeySource string - -const Encryption_KeySource_MicrosoftKeyVault = Encryption_KeySource("Microsoft.KeyVault") - -type Encryption_KeySource_STATUS string - -const Encryption_KeySource_STATUS_MicrosoftKeyVault = Encryption_KeySource_STATUS("Microsoft.KeyVault") - -// Properties to configure keyVault Properties -type KeyVaultProperties struct { - Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` - - // KeyName: Name of the Key from KeyVault - KeyName *string `json:"keyName,omitempty"` - - // KeyVaultUri: Uri of KeyVault - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - - // KeyVersion: Key Version - KeyVersion *string `json:"keyVersion,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 := &KeyVaultProperties_ARM{} - - // Set property "Identity": - if properties.Identity != nil { - identity_ARM, err := (*properties.Identity).ConvertToARM(resolved) - if err != nil { - return nil, err - } - identity := *identity_ARM.(*UserAssignedIdentityProperties_ARM) - result.Identity = &identity - } - - // Set property "KeyName": - if properties.KeyName != nil { - keyName := *properties.KeyName - result.KeyName = &keyName - } - - // Set property "KeyVaultUri": - if properties.KeyVaultUri != nil { - keyVaultUri := *properties.KeyVaultUri - result.KeyVaultUri = &keyVaultUri - } - - // Set property "KeyVersion": - if properties.KeyVersion != nil { - keyVersion := *properties.KeyVersion - result.KeyVersion = &keyVersion - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (properties *KeyVaultProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &KeyVaultProperties_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (properties *KeyVaultProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(KeyVaultProperties_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected KeyVaultProperties_ARM, got %T", armInput) - } - - // Set property "Identity": - if typedInput.Identity != nil { - var identity1 UserAssignedIdentityProperties - err := identity1.PopulateFromARM(owner, *typedInput.Identity) - if err != nil { - return err - } - identity := identity1 - properties.Identity = &identity - } - - // Set property "KeyName": - if typedInput.KeyName != nil { - keyName := *typedInput.KeyName - properties.KeyName = &keyName - } - - // Set property "KeyVaultUri": - if typedInput.KeyVaultUri != nil { - keyVaultUri := *typedInput.KeyVaultUri - properties.KeyVaultUri = &keyVaultUri - } - - // Set property "KeyVersion": - if typedInput.KeyVersion != nil { - keyVersion := *typedInput.KeyVersion - properties.KeyVersion = &keyVersion - } - - // No error - return nil -} - -// AssignProperties_From_KeyVaultProperties populates our KeyVaultProperties from the provided source KeyVaultProperties -func (properties *KeyVaultProperties) AssignProperties_From_KeyVaultProperties(source *v20240101s.KeyVaultProperties) error { - - // Identity - if source.Identity != nil { - var identity UserAssignedIdentityProperties - err := identity.AssignProperties_From_UserAssignedIdentityProperties(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties() to populate field Identity") - } - properties.Identity = &identity - } else { - properties.Identity = nil - } - - // KeyName - properties.KeyName = genruntime.ClonePointerToString(source.KeyName) - - // KeyVaultUri - properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) - - // KeyVersion - properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) - - // No error - return nil -} - -// AssignProperties_To_KeyVaultProperties populates the provided destination KeyVaultProperties from our KeyVaultProperties -func (properties *KeyVaultProperties) AssignProperties_To_KeyVaultProperties(destination *v20240101s.KeyVaultProperties) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Identity - if properties.Identity != nil { - var identity v20240101s.UserAssignedIdentityProperties - err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // KeyName - destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) - - // KeyVaultUri - destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) - - // KeyVersion - destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_KeyVaultProperties_STATUS populates our KeyVaultProperties from the provided source KeyVaultProperties_STATUS -func (properties *KeyVaultProperties) Initialize_From_KeyVaultProperties_STATUS(source *KeyVaultProperties_STATUS) error { - - // Identity - if source.Identity != nil { - var identity UserAssignedIdentityProperties - err := identity.Initialize_From_UserAssignedIdentityProperties_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") - } - properties.Identity = &identity - } else { - properties.Identity = nil - } - - // KeyName - properties.KeyName = genruntime.ClonePointerToString(source.KeyName) - - // KeyVaultUri - properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) - - // KeyVersion - properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) - - // No error - return nil -} - -// Properties to configure keyVault Properties -type KeyVaultProperties_STATUS struct { - Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` - - // KeyName: Name of the Key from KeyVault - KeyName *string `json:"keyName,omitempty"` - - // KeyVaultUri: Uri of KeyVault - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - - // KeyVersion: Key Version - KeyVersion *string `json:"keyVersion,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_STATUS_ARM{} -} - -// 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_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected KeyVaultProperties_STATUS_ARM, got %T", armInput) - } - - // Set property "Identity": - if typedInput.Identity != nil { - var identity1 UserAssignedIdentityProperties_STATUS - err := identity1.PopulateFromARM(owner, *typedInput.Identity) - if err != nil { - return err - } - identity := identity1 - properties.Identity = &identity - } - - // Set property "KeyName": - if typedInput.KeyName != nil { - keyName := *typedInput.KeyName - properties.KeyName = &keyName - } - - // Set property "KeyVaultUri": - if typedInput.KeyVaultUri != nil { - keyVaultUri := *typedInput.KeyVaultUri - properties.KeyVaultUri = &keyVaultUri - } - - // Set property "KeyVersion": - if typedInput.KeyVersion != nil { - keyVersion := *typedInput.KeyVersion - properties.KeyVersion = &keyVersion - } - - // No error - return nil -} - -// AssignProperties_From_KeyVaultProperties_STATUS populates our KeyVaultProperties_STATUS from the provided source KeyVaultProperties_STATUS -func (properties *KeyVaultProperties_STATUS) AssignProperties_From_KeyVaultProperties_STATUS(source *v20240101s.KeyVaultProperties_STATUS) error { - - // Identity - if source.Identity != nil { - var identity UserAssignedIdentityProperties_STATUS - err := identity.AssignProperties_From_UserAssignedIdentityProperties_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityProperties_STATUS() to populate field Identity") - } - properties.Identity = &identity - } else { - properties.Identity = nil - } - - // KeyName - properties.KeyName = genruntime.ClonePointerToString(source.KeyName) - - // KeyVaultUri - properties.KeyVaultUri = genruntime.ClonePointerToString(source.KeyVaultUri) - - // KeyVersion - properties.KeyVersion = genruntime.ClonePointerToString(source.KeyVersion) - - // No error - return nil -} - -// AssignProperties_To_KeyVaultProperties_STATUS populates the provided destination KeyVaultProperties_STATUS from our KeyVaultProperties_STATUS -func (properties *KeyVaultProperties_STATUS) AssignProperties_To_KeyVaultProperties_STATUS(destination *v20240101s.KeyVaultProperties_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Identity - if properties.Identity != nil { - var identity v20240101s.UserAssignedIdentityProperties_STATUS - err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityProperties_STATUS() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // KeyName - destination.KeyName = genruntime.ClonePointerToString(properties.KeyName) - - // KeyVaultUri - destination.KeyVaultUri = genruntime.ClonePointerToString(properties.KeyVaultUri) - - // KeyVersion - destination.KeyVersion = genruntime.ClonePointerToString(properties.KeyVersion) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -type NamespaceOperatorSecrets struct { - // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret - // will not be retrieved from Azure. - PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` - - // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from - // Azure. - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - - // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret - // will not be retrieved from Azure. - SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` - - // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved - // from Azure. - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -// AssignProperties_From_NamespaceOperatorSecrets populates our NamespaceOperatorSecrets from the provided source NamespaceOperatorSecrets -func (secrets *NamespaceOperatorSecrets) AssignProperties_From_NamespaceOperatorSecrets(source *v20240101s.NamespaceOperatorSecrets) error { - - // PrimaryConnectionString - if source.PrimaryConnectionString != nil { - primaryConnectionString := source.PrimaryConnectionString.Copy() - secrets.PrimaryConnectionString = &primaryConnectionString - } else { - secrets.PrimaryConnectionString = nil - } - - // PrimaryKey - if source.PrimaryKey != nil { - primaryKey := source.PrimaryKey.Copy() - secrets.PrimaryKey = &primaryKey - } else { - secrets.PrimaryKey = nil - } - - // SecondaryConnectionString - if source.SecondaryConnectionString != nil { - secondaryConnectionString := source.SecondaryConnectionString.Copy() - secrets.SecondaryConnectionString = &secondaryConnectionString - } else { - secrets.SecondaryConnectionString = nil - } - - // SecondaryKey - if source.SecondaryKey != nil { - secondaryKey := source.SecondaryKey.Copy() - secrets.SecondaryKey = &secondaryKey - } else { - secrets.SecondaryKey = nil - } - - // No error - return nil -} - -// AssignProperties_To_NamespaceOperatorSecrets populates the provided destination NamespaceOperatorSecrets from our NamespaceOperatorSecrets -func (secrets *NamespaceOperatorSecrets) AssignProperties_To_NamespaceOperatorSecrets(destination *v20240101s.NamespaceOperatorSecrets) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // PrimaryConnectionString - if secrets.PrimaryConnectionString != nil { - primaryConnectionString := secrets.PrimaryConnectionString.Copy() - destination.PrimaryConnectionString = &primaryConnectionString - } else { - destination.PrimaryConnectionString = nil - } - - // PrimaryKey - if secrets.PrimaryKey != nil { - primaryKey := secrets.PrimaryKey.Copy() - destination.PrimaryKey = &primaryKey - } else { - destination.PrimaryKey = nil - } - - // SecondaryConnectionString - if secrets.SecondaryConnectionString != nil { - secondaryConnectionString := secrets.SecondaryConnectionString.Copy() - destination.SecondaryConnectionString = &secondaryConnectionString - } else { - destination.SecondaryConnectionString = nil - } - - // SecondaryKey - if secrets.SecondaryKey != nil { - secondaryKey := secrets.SecondaryKey.Copy() - destination.SecondaryKey = &secondaryKey - } else { - destination.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Recognized Dictionary value. -type UserAssignedIdentity_STATUS struct { - // ClientId: Client Id of user assigned identity - ClientId *string `json:"clientId,omitempty"` - - // PrincipalId: Principal Id of user assigned identity - PrincipalId *string `json:"principalId,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_STATUS_ARM{} -} - -// 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_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAssignedIdentity_STATUS_ARM, 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 - } - - // No error - return nil -} - -// AssignProperties_From_UserAssignedIdentity_STATUS populates our UserAssignedIdentity_STATUS from the provided source UserAssignedIdentity_STATUS -func (identity *UserAssignedIdentity_STATUS) AssignProperties_From_UserAssignedIdentity_STATUS(source *v20240101s.UserAssignedIdentity_STATUS) error { - - // ClientId - identity.ClientId = genruntime.ClonePointerToString(source.ClientId) - - // PrincipalId - identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentity_STATUS populates the provided destination UserAssignedIdentity_STATUS from our UserAssignedIdentity_STATUS -func (identity *UserAssignedIdentity_STATUS) AssignProperties_To_UserAssignedIdentity_STATUS(destination *v20240101s.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) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Information about the user assigned identity for the resource -type UserAssignedIdentityDetails struct { - Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` -} - -// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails -func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *v20240101s.UserAssignedIdentityDetails) error { - - // Reference - details.Reference = source.Reference.Copy() - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentityDetails populates the provided destination UserAssignedIdentityDetails from our UserAssignedIdentityDetails -func (details *UserAssignedIdentityDetails) AssignProperties_To_UserAssignedIdentityDetails(destination *v20240101s.UserAssignedIdentityDetails) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Reference - destination.Reference = details.Reference.Copy() - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -type UserAssignedIdentityProperties struct { - // UserAssignedIdentityReference: ARM ID of user Identity selected for encryption - UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` -} - -var _ genruntime.ARMTransformer = &UserAssignedIdentityProperties{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (properties *UserAssignedIdentityProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if properties == nil { - return nil, nil - } - result := &UserAssignedIdentityProperties_ARM{} - - // Set property "UserAssignedIdentity": - if properties.UserAssignedIdentityReference != nil { - userAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*properties.UserAssignedIdentityReference) - if err != nil { - return nil, err - } - userAssignedIdentityReference := userAssignedIdentityReferenceARMID - result.UserAssignedIdentity = &userAssignedIdentityReference - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (properties *UserAssignedIdentityProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &UserAssignedIdentityProperties_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (properties *UserAssignedIdentityProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - _, ok := armInput.(UserAssignedIdentityProperties_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAssignedIdentityProperties_ARM, got %T", armInput) - } - - // no assignment for property "UserAssignedIdentityReference" - - // No error - return nil -} - -// AssignProperties_From_UserAssignedIdentityProperties populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties -func (properties *UserAssignedIdentityProperties) AssignProperties_From_UserAssignedIdentityProperties(source *v20240101s.UserAssignedIdentityProperties) error { - - // UserAssignedIdentityReference - if source.UserAssignedIdentityReference != nil { - userAssignedIdentityReference := source.UserAssignedIdentityReference.Copy() - properties.UserAssignedIdentityReference = &userAssignedIdentityReference - } else { - properties.UserAssignedIdentityReference = nil - } - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentityProperties populates the provided destination UserAssignedIdentityProperties from our UserAssignedIdentityProperties -func (properties *UserAssignedIdentityProperties) AssignProperties_To_UserAssignedIdentityProperties(destination *v20240101s.UserAssignedIdentityProperties) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // UserAssignedIdentityReference - if properties.UserAssignedIdentityReference != nil { - userAssignedIdentityReference := properties.UserAssignedIdentityReference.Copy() - destination.UserAssignedIdentityReference = &userAssignedIdentityReference - } else { - destination.UserAssignedIdentityReference = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties_STATUS -func (properties *UserAssignedIdentityProperties) Initialize_From_UserAssignedIdentityProperties_STATUS(source *UserAssignedIdentityProperties_STATUS) error { - - // No error - return nil -} - -type UserAssignedIdentityProperties_STATUS struct { - // UserAssignedIdentity: ARM ID of user Identity selected for encryption - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} - -var _ genruntime.FromARMConverter = &UserAssignedIdentityProperties_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (properties *UserAssignedIdentityProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &UserAssignedIdentityProperties_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (properties *UserAssignedIdentityProperties_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(UserAssignedIdentityProperties_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected UserAssignedIdentityProperties_STATUS_ARM, got %T", armInput) - } - - // Set property "UserAssignedIdentity": - if typedInput.UserAssignedIdentity != nil { - userAssignedIdentity := *typedInput.UserAssignedIdentity - properties.UserAssignedIdentity = &userAssignedIdentity - } - - // No error - return nil -} - -// AssignProperties_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties_STATUS from the provided source UserAssignedIdentityProperties_STATUS -func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_From_UserAssignedIdentityProperties_STATUS(source *v20240101s.UserAssignedIdentityProperties_STATUS) error { - - // UserAssignedIdentity - properties.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) - - // No error - return nil -} - -// AssignProperties_To_UserAssignedIdentityProperties_STATUS populates the provided destination UserAssignedIdentityProperties_STATUS from our UserAssignedIdentityProperties_STATUS -func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_To_UserAssignedIdentityProperties_STATUS(destination *v20240101s.UserAssignedIdentityProperties_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // UserAssignedIdentity - destination.UserAssignedIdentity = genruntime.ClonePointerToString(properties.UserAssignedIdentity) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -func init() { - SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) -} diff --git a/v2/api/eventhub/v1api20240101/namespace_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespace_types_gen_test.go deleted file mode 100644 index cd9a7b7e6e5..00000000000 --- a/v2/api/eventhub/v1api20240101/namespace_types_gen_test.go +++ /dev/null @@ -1,2173 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_Namespace_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespace, NamespaceGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespace tests if a specific instance of Namespace round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespace(subject Namespace) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.Namespace - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual Namespace - 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_Namespace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace to Namespace via AssignProperties_To_Namespace & AssignProperties_From_Namespace returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespace, NamespaceGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespace tests if a specific instance of Namespace can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespace(subject Namespace) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Namespace - err := copied.AssignProperties_To_Namespace(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespace - err = actual.AssignProperties_From_Namespace(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace, NamespaceGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace runs a test to see if a specific instance of Namespace round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace(subject Namespace) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespace instances for property testing - lazily instantiated by NamespaceGenerator() -var namespaceGenerator gopter.Gen - -// NamespaceGenerator returns a generator of Namespace instances for property testing. -func NamespaceGenerator() gopter.Gen { - if namespaceGenerator != nil { - return namespaceGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespace(generators) - namespaceGenerator = gen.Struct(reflect.TypeOf(Namespace{}), generators) - - return namespaceGenerator -} - -// AddRelatedPropertyGeneratorsForNamespace is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace(gens map[string]gopter.Gen) { - gens["Spec"] = Namespace_SpecGenerator() - gens["Status"] = Namespace_STATUSGenerator() -} - -func Test_Namespace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace_Spec to Namespace_Spec via AssignProperties_To_Namespace_Spec & AssignProperties_From_Namespace_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespace_Spec, Namespace_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespace_Spec tests if a specific instance of Namespace_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_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 v20240101s.Namespace_Spec - err := copied.AssignProperties_To_Namespace_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespace_Spec - err = actual.AssignProperties_From_Namespace_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespace_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_Spec, Namespace_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_Spec runs a test to see if a specific instance of Namespace_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_Spec(subject Namespace_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_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 Namespace_Spec instances for property testing - lazily instantiated by Namespace_SpecGenerator() -var namespace_SpecGenerator gopter.Gen - -// Namespace_SpecGenerator returns a generator of Namespace_Spec instances for property testing. -// We first initialize namespace_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespace_SpecGenerator() gopter.Gen { - if namespace_SpecGenerator != nil { - return namespace_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Spec(generators) - namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Spec(generators) - AddRelatedPropertyGeneratorsForNamespace_Spec(generators) - namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) - - return namespace_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { - gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) - gens["AzureName"] = gen.AlphaString() - gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) - gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) - gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) - gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_Spec_10, Namespace_Properties_MinimumTlsVersion_Spec_11, Namespace_Properties_MinimumTlsVersion_Spec_12)) - gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_Spec_Disabled, Namespace_Properties_PublicNetworkAccess_Spec_Enabled, Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter)) - gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) - gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { - gens["Encryption"] = gen.PtrOf(EncryptionGenerator()) - gens["Identity"] = gen.PtrOf(IdentityGenerator()) - gens["OperatorSpec"] = gen.PtrOf(NamespaceOperatorSpecGenerator()) - gens["Sku"] = gen.PtrOf(SkuGenerator()) -} - -func Test_Namespace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespace_STATUS to Namespace_STATUS via AssignProperties_To_Namespace_STATUS & AssignProperties_From_Namespace_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespace_STATUS, Namespace_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespace_STATUS tests if a specific instance of Namespace_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_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 v20240101s.Namespace_STATUS - err := copied.AssignProperties_To_Namespace_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespace_STATUS - err = actual.AssignProperties_From_Namespace_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_STATUS, Namespace_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_STATUS runs a test to see if a specific instance of Namespace_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_STATUS(subject Namespace_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_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 Namespace_STATUS instances for property testing - lazily instantiated by Namespace_STATUSGenerator() -var namespace_STATUSGenerator gopter.Gen - -// Namespace_STATUSGenerator returns a generator of Namespace_STATUS instances for property testing. -// We first initialize namespace_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespace_STATUSGenerator() gopter.Gen { - if namespace_STATUSGenerator != nil { - return namespace_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) - namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespace_STATUS(generators) - namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) - - return namespace_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { - gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) - gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) - gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) - gens["MetricId"] = gen.PtrOf(gen.AlphaString()) - gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_MinimumTlsVersion_STATUS_10, Namespace_Properties_MinimumTlsVersion_STATUS_11, Namespace_Properties_MinimumTlsVersion_STATUS_12)) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) - gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(Namespace_Properties_PublicNetworkAccess_STATUS_Disabled, Namespace_Properties_PublicNetworkAccess_STATUS_Enabled, Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter)) - gens["ServiceBusEndpoint"] = gen.PtrOf(gen.AlphaString()) - gens["Status"] = gen.PtrOf(gen.AlphaString()) - gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { - gens["Encryption"] = gen.PtrOf(Encryption_STATUSGenerator()) - gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) - gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUSGenerator()) - gens["Sku"] = gen.PtrOf(Sku_STATUSGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_Encryption_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Encryption to Encryption via AssignProperties_To_Encryption & AssignProperties_From_Encryption returns original", - prop.ForAll(RunPropertyAssignmentTestForEncryption, EncryptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForEncryption tests if a specific instance of Encryption can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForEncryption(subject Encryption) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Encryption - err := copied.AssignProperties_To_Encryption(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Encryption - err = actual.AssignProperties_From_Encryption(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Encryption_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Encryption via JSON returns original", - prop.ForAll(RunJSONSerializationTestForEncryption, EncryptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForEncryption runs a test to see if a specific instance of Encryption round trips to JSON and back losslessly -func RunJSONSerializationTestForEncryption(subject Encryption) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Encryption - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Encryption instances for property testing - lazily instantiated by EncryptionGenerator() -var encryptionGenerator gopter.Gen - -// EncryptionGenerator returns a generator of Encryption instances for property testing. -// We first initialize encryptionGenerator 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 EncryptionGenerator() gopter.Gen { - if encryptionGenerator != nil { - return encryptionGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption(generators) - encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption(generators) - AddRelatedPropertyGeneratorsForEncryption(generators) - encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) - - return encryptionGenerator -} - -// AddIndependentPropertyGeneratorsForEncryption is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { - gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_MicrosoftKeyVault)) - gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForEncryption is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { - gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) -} - -func Test_Encryption_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Encryption_STATUS to Encryption_STATUS via AssignProperties_To_Encryption_STATUS & AssignProperties_From_Encryption_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForEncryption_STATUS, Encryption_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForEncryption_STATUS tests if a specific instance of Encryption_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_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 v20240101s.Encryption_STATUS - err := copied.AssignProperties_To_Encryption_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Encryption_STATUS - err = actual.AssignProperties_From_Encryption_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Encryption_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Encryption_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForEncryption_STATUS, Encryption_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForEncryption_STATUS runs a test to see if a specific instance of Encryption_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForEncryption_STATUS(subject Encryption_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Encryption_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 Encryption_STATUS instances for property testing - lazily instantiated by Encryption_STATUSGenerator() -var encryption_STATUSGenerator gopter.Gen - -// Encryption_STATUSGenerator returns a generator of Encryption_STATUS instances for property testing. -// We first initialize encryption_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Encryption_STATUSGenerator() gopter.Gen { - if encryption_STATUSGenerator != nil { - return encryption_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) - encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) - AddRelatedPropertyGeneratorsForEncryption_STATUS(generators) - encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) - - return encryption_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { - gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_STATUS_MicrosoftKeyVault)) - gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { - gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) -} - -func Test_Identity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Identity to Identity via AssignProperties_To_Identity & AssignProperties_From_Identity returns original", - prop.ForAll(RunPropertyAssignmentTestForIdentity, IdentityGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForIdentity tests if a specific instance of Identity can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForIdentity(subject Identity) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Identity - err := copied.AssignProperties_To_Identity(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Identity - err = actual.AssignProperties_From_Identity(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Identity via JSON returns original", - prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly -func RunJSONSerializationTestForIdentity(subject Identity) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Identity - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() -var identityGenerator gopter.Gen - -// IdentityGenerator returns a generator of Identity instances for property testing. -// We first initialize identityGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func IdentityGenerator() gopter.Gen { - if identityGenerator != nil { - return identityGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity(generators) - identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity(generators) - AddRelatedPropertyGeneratorsForIdentity(generators) - identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) - - return identityGenerator -} - -// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.OneConstOf( - Identity_Type_None, - Identity_Type_SystemAssigned, - Identity_Type_SystemAssignedUserAssigned, - Identity_Type_UserAssigned)) -} - -// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { - gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) -} - -func Test_Identity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Identity_STATUS to Identity_STATUS via AssignProperties_To_Identity_STATUS & AssignProperties_From_Identity_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForIdentity_STATUS, Identity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForIdentity_STATUS tests if a specific instance of Identity_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Identity_STATUS - err := copied.AssignProperties_To_Identity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Identity_STATUS - err = actual.AssignProperties_From_Identity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Identity_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Identity_STATUS - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() -var identity_STATUSGenerator gopter.Gen - -// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. -// We first initialize identity_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Identity_STATUSGenerator() gopter.Gen { - if identity_STATUSGenerator != nil { - return identity_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) - identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) - AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) - identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) - - return identity_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { - gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) - gens["TenantId"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.OneConstOf( - Identity_Type_STATUS_None, - Identity_Type_STATUS_SystemAssigned, - Identity_Type_STATUS_SystemAssignedUserAssigned, - Identity_Type_STATUS_UserAssigned)) -} - -// AddRelatedPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { - gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUSGenerator()) -} - -func Test_NamespaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespaceOperatorSpec to NamespaceOperatorSpec via AssignProperties_To_NamespaceOperatorSpec & AssignProperties_From_NamespaceOperatorSpec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaceOperatorSpec tests if a specific instance of NamespaceOperatorSpec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespaceOperatorSpec - err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespaceOperatorSpec - err = actual.AssignProperties_From_NamespaceOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespaceOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaceOperatorSpec runs a test to see if a specific instance of NamespaceOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespaceOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespaceOperatorSpec instances for property testing - lazily instantiated by -// NamespaceOperatorSpecGenerator() -var namespaceOperatorSpecGenerator gopter.Gen - -// NamespaceOperatorSpecGenerator returns a generator of NamespaceOperatorSpec instances for property testing. -func NamespaceOperatorSpecGenerator() gopter.Gen { - if namespaceOperatorSpecGenerator != nil { - return namespaceOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(generators) - namespaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSpec{}), generators) - - return namespaceOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForNamespaceOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) -} - -func Test_PrivateEndpointConnection_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from PrivateEndpointConnection_STATUS to PrivateEndpointConnection_STATUS via AssignProperties_To_PrivateEndpointConnection_STATUS & AssignProperties_From_PrivateEndpointConnection_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS tests if a specific instance of PrivateEndpointConnection_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_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 v20240101s.PrivateEndpointConnection_STATUS - err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual PrivateEndpointConnection_STATUS - err = actual.AssignProperties_From_PrivateEndpointConnection_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual PrivateEndpointConnection_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 PrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by -// PrivateEndpointConnection_STATUSGenerator() -var privateEndpointConnection_STATUSGenerator gopter.Gen - -// PrivateEndpointConnection_STATUSGenerator returns a generator of PrivateEndpointConnection_STATUS instances for property testing. -func PrivateEndpointConnection_STATUSGenerator() gopter.Gen { - if privateEndpointConnection_STATUSGenerator != nil { - return privateEndpointConnection_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(generators) - privateEndpointConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS{}), generators) - - return privateEndpointConnection_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) -} - -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 AssignProperties_To_Sku & AssignProperties_From_Sku 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 storage 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 v20240101s.Sku - err := copied.AssignProperties_To_Sku(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Sku - err = actual.AssignProperties_From_Sku(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of 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["Capacity"] = gen.PtrOf(gen.Int()) - gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_Basic, Sku_Name_Premium, Sku_Name_Standard)) - gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_Basic, Sku_Tier_Premium, Sku_Tier_Standard)) -} - -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 AssignProperties_To_Sku_STATUS & AssignProperties_From_Sku_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForSku_STATUS, Sku_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForSku_STATUS tests if a specific instance of Sku_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForSku_STATUS(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 v20240101s.Sku_STATUS - err := copied.AssignProperties_To_Sku_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Sku_STATUS - err = actual.AssignProperties_From_Sku_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Sku_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Sku_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSku_STATUS, Sku_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSku_STATUS runs a test to see if a specific instance of Sku_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForSku_STATUS(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 Sku_STATUSGenerator() -var sku_STATUSGenerator gopter.Gen - -// Sku_STATUSGenerator returns a generator of Sku_STATUS instances for property testing. -func Sku_STATUSGenerator() gopter.Gen { - if sku_STATUSGenerator != nil { - return sku_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForSku_STATUS(generators) - sku_STATUSGenerator = gen.Struct(reflect.TypeOf(Sku_STATUS{}), generators) - - return sku_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForSku_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForSku_STATUS(gens map[string]gopter.Gen) { - gens["Capacity"] = gen.PtrOf(gen.Int()) - gens["Name"] = gen.PtrOf(gen.OneConstOf(Sku_Name_STATUS_Basic, Sku_Name_STATUS_Premium, Sku_Name_STATUS_Standard)) - gens["Tier"] = gen.PtrOf(gen.OneConstOf(Sku_Tier_STATUS_Basic, Sku_Tier_STATUS_Premium, Sku_Tier_STATUS_Standard)) -} - -func Test_SystemData_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from SystemData_STATUS to SystemData_STATUS via AssignProperties_To_SystemData_STATUS & AssignProperties_From_SystemData_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForSystemData_STATUS, SystemData_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForSystemData_STATUS tests if a specific instance of SystemData_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.SystemData_STATUS - err := copied.AssignProperties_To_SystemData_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual SystemData_STATUS - err = actual.AssignProperties_From_SystemData_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of SystemData_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual SystemData_STATUS - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() -var systemData_STATUSGenerator gopter.Gen - -// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. -func SystemData_STATUSGenerator() gopter.Gen { - if systemData_STATUSGenerator != nil { - return systemData_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) - systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) - - return systemData_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( - SystemData_CreatedByType_STATUS_Application, - SystemData_CreatedByType_STATUS_Key, - SystemData_CreatedByType_STATUS_ManagedIdentity, - SystemData_CreatedByType_STATUS_User)) - gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) - gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) - gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( - SystemData_LastModifiedByType_STATUS_Application, - SystemData_LastModifiedByType_STATUS_Key, - SystemData_LastModifiedByType_STATUS_ManagedIdentity, - SystemData_LastModifiedByType_STATUS_User)) -} - -func Test_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 AssignProperties_To_KeyVaultProperties & AssignProperties_From_KeyVaultProperties 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 storage 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 v20240101s.KeyVaultProperties - err := copied.AssignProperties_To_KeyVaultProperties(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual KeyVaultProperties - err = actual.AssignProperties_From_KeyVaultProperties(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of 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. -// We first initialize keyVaultPropertiesGenerator 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 KeyVaultPropertiesGenerator() gopter.Gen { - if keyVaultPropertiesGenerator != nil { - return keyVaultPropertiesGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) - keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) - AddRelatedPropertyGeneratorsForKeyVaultProperties(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["KeyName"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) -} - -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 AssignProperties_To_KeyVaultProperties_STATUS & AssignProperties_From_KeyVaultProperties_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForKeyVaultProperties_STATUS tests if a specific instance of KeyVaultProperties_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(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 v20240101s.KeyVaultProperties_STATUS - err := copied.AssignProperties_To_KeyVaultProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual KeyVaultProperties_STATUS - err = actual.AssignProperties_From_KeyVaultProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_KeyVaultProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of KeyVaultProperties_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForKeyVaultProperties_STATUS runs a test to see if a specific instance of KeyVaultProperties_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForKeyVaultProperties_STATUS(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 -// KeyVaultProperties_STATUSGenerator() -var keyVaultProperties_STATUSGenerator gopter.Gen - -// KeyVaultProperties_STATUSGenerator returns a generator of KeyVaultProperties_STATUS instances for property testing. -// We first initialize keyVaultProperties_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func KeyVaultProperties_STATUSGenerator() gopter.Gen { - if keyVaultProperties_STATUSGenerator != nil { - return keyVaultProperties_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) - keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) - AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(generators) - keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) - - return keyVaultProperties_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { - gens["KeyName"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) -} - -func Test_NamespaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespaceOperatorSecrets to NamespaceOperatorSecrets via AssignProperties_To_NamespaceOperatorSecrets & AssignProperties_From_NamespaceOperatorSecrets returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaceOperatorSecrets tests if a specific instance of NamespaceOperatorSecrets can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespaceOperatorSecrets - err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespaceOperatorSecrets - err = actual.AssignProperties_From_NamespaceOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespaceOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaceOperatorSecrets runs a test to see if a specific instance of NamespaceOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespaceOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespaceOperatorSecrets instances for property testing - lazily instantiated by -// NamespaceOperatorSecretsGenerator() -var namespaceOperatorSecretsGenerator gopter.Gen - -// NamespaceOperatorSecretsGenerator returns a generator of NamespaceOperatorSecrets instances for property testing. -func NamespaceOperatorSecretsGenerator() gopter.Gen { - if namespaceOperatorSecretsGenerator != nil { - return namespaceOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - namespaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSecrets{}), generators) - - return namespaceOperatorSecretsGenerator -} - -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 AssignProperties_To_UserAssignedIdentity_STATUS & AssignProperties_From_UserAssignedIdentity_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentity_STATUS tests if a specific instance of UserAssignedIdentity_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(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 v20240101s.UserAssignedIdentity_STATUS - err := copied.AssignProperties_To_UserAssignedIdentity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentity_STATUS - err = actual.AssignProperties_From_UserAssignedIdentity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_UserAssignedIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentity_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentity_STATUS runs a test to see if a specific instance of UserAssignedIdentity_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentity_STATUS(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 -// UserAssignedIdentity_STATUSGenerator() -var userAssignedIdentity_STATUSGenerator gopter.Gen - -// UserAssignedIdentity_STATUSGenerator returns a generator of UserAssignedIdentity_STATUS instances for property testing. -func UserAssignedIdentity_STATUSGenerator() gopter.Gen { - if userAssignedIdentity_STATUSGenerator != nil { - return userAssignedIdentity_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(generators) - userAssignedIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_STATUS{}), generators) - - return userAssignedIdentity_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(gens map[string]gopter.Gen) { - gens["ClientId"] = gen.PtrOf(gen.AlphaString()) - gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_UserAssignedIdentityDetails_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from UserAssignedIdentityDetails to UserAssignedIdentityDetails via AssignProperties_To_UserAssignedIdentityDetails & AssignProperties_From_UserAssignedIdentityDetails returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentityDetails tests if a specific instance of UserAssignedIdentityDetails can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.UserAssignedIdentityDetails - err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentityDetails - err = actual.AssignProperties_From_UserAssignedIdentityDetails(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityDetails via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityDetails - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by -// UserAssignedIdentityDetailsGenerator() -var userAssignedIdentityDetailsGenerator gopter.Gen - -// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. -func UserAssignedIdentityDetailsGenerator() gopter.Gen { - if userAssignedIdentityDetailsGenerator != nil { - return userAssignedIdentityDetailsGenerator - } - - generators := make(map[string]gopter.Gen) - userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) - - return userAssignedIdentityDetailsGenerator -} - -func Test_UserAssignedIdentityProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from UserAssignedIdentityProperties to UserAssignedIdentityProperties via AssignProperties_To_UserAssignedIdentityProperties & AssignProperties_From_UserAssignedIdentityProperties returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentityProperties tests if a specific instance of UserAssignedIdentityProperties can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.UserAssignedIdentityProperties - err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentityProperties - err = actual.AssignProperties_From_UserAssignedIdentityProperties(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_UserAssignedIdentityProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityProperties via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityProperties runs a test to see if a specific instance of UserAssignedIdentityProperties round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityProperties - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of UserAssignedIdentityProperties instances for property testing - lazily instantiated by -// UserAssignedIdentityPropertiesGenerator() -var userAssignedIdentityPropertiesGenerator gopter.Gen - -// UserAssignedIdentityPropertiesGenerator returns a generator of UserAssignedIdentityProperties instances for property testing. -func UserAssignedIdentityPropertiesGenerator() gopter.Gen { - if userAssignedIdentityPropertiesGenerator != nil { - return userAssignedIdentityPropertiesGenerator - } - - generators := make(map[string]gopter.Gen) - userAssignedIdentityPropertiesGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties{}), generators) - - return userAssignedIdentityPropertiesGenerator -} - -func Test_UserAssignedIdentityProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from UserAssignedIdentityProperties_STATUS to UserAssignedIdentityProperties_STATUS via AssignProperties_To_UserAssignedIdentityProperties_STATUS & AssignProperties_From_UserAssignedIdentityProperties_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS tests if a specific instance of UserAssignedIdentityProperties_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_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 v20240101s.UserAssignedIdentityProperties_STATUS - err := copied.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual UserAssignedIdentityProperties_STATUS - err = actual.AssignProperties_From_UserAssignedIdentityProperties_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_UserAssignedIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityProperties_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS runs a test to see if a specific instance of UserAssignedIdentityProperties_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS instances for property testing - lazily instantiated by -// UserAssignedIdentityProperties_STATUSGenerator() -var userAssignedIdentityProperties_STATUSGenerator gopter.Gen - -// UserAssignedIdentityProperties_STATUSGenerator returns a generator of UserAssignedIdentityProperties_STATUS instances for property testing. -func UserAssignedIdentityProperties_STATUSGenerator() gopter.Gen { - if userAssignedIdentityProperties_STATUSGenerator != nil { - return userAssignedIdentityProperties_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(generators) - userAssignedIdentityProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_STATUS{}), generators) - - return userAssignedIdentityProperties_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(gens map[string]gopter.Gen) { - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go deleted file mode 100644 index c1e985d2a59..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - -type Namespaces_AuthorizationRule_Spec_ARM struct { - Name string `json:"name,omitempty"` - - // Properties: Properties supplied to create or update AuthorizationRule - Properties *Namespaces_AuthorizationRule_Properties_Spec_ARM `json:"properties,omitempty"` -} - -var _ genruntime.ARMResourceSpec = &Namespaces_AuthorizationRule_Spec_ARM{} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (rule Namespaces_AuthorizationRule_Spec_ARM) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetName returns the Name of the resource -func (rule *Namespaces_AuthorizationRule_Spec_ARM) GetName() string { - return rule.Name -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/authorizationRules" -func (rule *Namespaces_AuthorizationRule_Spec_ARM) GetType() string { - return "Microsoft.EventHub/namespaces/authorizationRules" -} - -type Namespaces_AuthorizationRule_Properties_Spec_ARM struct { - // Rights: The rights associated with the rule. - Rights []Namespaces_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go deleted file mode 100644 index 84823317954..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_spec_arm_types_gen_test.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_AuthorizationRule_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec_ARM, Namespaces_AuthorizationRule_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec_ARM(subject Namespaces_AuthorizationRule_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_AuthorizationRule_Spec_ARM instances for property testing - lazily instantiated by -// Namespaces_AuthorizationRule_Spec_ARMGenerator() -var namespaces_AuthorizationRule_Spec_ARMGenerator gopter.Gen - -// Namespaces_AuthorizationRule_Spec_ARMGenerator returns a generator of Namespaces_AuthorizationRule_Spec_ARM instances for property testing. -// We first initialize namespaces_AuthorizationRule_Spec_ARMGenerator 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 Namespaces_AuthorizationRule_Spec_ARMGenerator() gopter.Gen { - if namespaces_AuthorizationRule_Spec_ARMGenerator != nil { - return namespaces_AuthorizationRule_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(generators) - namespaces_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(generators) - namespaces_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec_ARM{}), generators) - - return namespaces_AuthorizationRule_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { - gens["Name"] = gen.AlphaString() -} - -// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator()) -} - -func Test_Namespaces_AuthorizationRule_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_Properties_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec_ARM, Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_Properties_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec_ARM(subject Namespaces_AuthorizationRule_Properties_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_Properties_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_AuthorizationRule_Properties_Spec_ARM instances for property testing - lazily instantiated by -// Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator() -var namespaces_AuthorizationRule_Properties_Spec_ARMGenerator gopter.Gen - -// Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator returns a generator of Namespaces_AuthorizationRule_Properties_Spec_ARM instances for property testing. -func Namespaces_AuthorizationRule_Properties_Spec_ARMGenerator() gopter.Gen { - if namespaces_AuthorizationRule_Properties_Spec_ARMGenerator != nil { - return namespaces_AuthorizationRule_Properties_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec_ARM(generators) - namespaces_AuthorizationRule_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Properties_Spec_ARM{}), generators) - - return namespaces_AuthorizationRule_Properties_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec_ARM(gens map[string]gopter.Gen) { - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_AuthorizationRule_Properties_Rights_Spec_Send)) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go deleted file mode 100644 index 72dba2b4b75..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -type Namespaces_AuthorizationRule_STATUS_ARM struct { - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // Properties: Properties supplied to create or update AuthorizationRule - Properties *Namespaces_AuthorizationRule_Properties_STATUS_ARM `json:"properties,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` -} - -type Namespaces_AuthorizationRule_Properties_STATUS_ARM struct { - // Rights: The rights associated with the rule. - Rights []Namespaces_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen_test.go deleted file mode 100644 index fc6dfe73c95..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_status_arm_types_gen_test.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_AuthorizationRule_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS_ARM, Namespaces_AuthorizationRule_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS_ARM(subject Namespaces_AuthorizationRule_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_AuthorizationRule_STATUS_ARM instances for property testing - lazily instantiated by -// Namespaces_AuthorizationRule_STATUS_ARMGenerator() -var namespaces_AuthorizationRule_STATUS_ARMGenerator gopter.Gen - -// Namespaces_AuthorizationRule_STATUS_ARMGenerator returns a generator of Namespaces_AuthorizationRule_STATUS_ARM instances for property testing. -// We first initialize namespaces_AuthorizationRule_STATUS_ARMGenerator 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 Namespaces_AuthorizationRule_STATUS_ARMGenerator() gopter.Gen { - if namespaces_AuthorizationRule_STATUS_ARMGenerator != nil { - return namespaces_AuthorizationRule_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(generators) - namespaces_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(generators) - namespaces_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS_ARM{}), generators) - - return namespaces_AuthorizationRule_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) -} - -func Test_Namespaces_AuthorizationRule_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_Properties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS_ARM, Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_AuthorizationRule_Properties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS_ARM(subject Namespaces_AuthorizationRule_Properties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_Properties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_AuthorizationRule_Properties_STATUS_ARM instances for property testing - lazily instantiated -// by Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator() -var namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator gopter.Gen - -// Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator returns a generator of Namespaces_AuthorizationRule_Properties_STATUS_ARM instances for property testing. -func Namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator() gopter.Gen { - if namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator != nil { - return namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS_ARM(generators) - namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Properties_STATUS_ARM{}), generators) - - return namespaces_AuthorizationRule_Properties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send)) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go deleted file mode 100644 index 62577ba485d..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen.go +++ /dev/null @@ -1,1021 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" -// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" -// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} -type NamespacesAuthorizationRule struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_AuthorizationRule_Spec `json:"spec,omitempty"` - Status Namespaces_AuthorizationRule_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesAuthorizationRule{} - -// GetConditions returns the conditions of the resource -func (rule *NamespacesAuthorizationRule) GetConditions() conditions.Conditions { - return rule.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (rule *NamespacesAuthorizationRule) SetConditions(conditions conditions.Conditions) { - rule.Status.Conditions = conditions -} - -var _ conversion.Convertible = &NamespacesAuthorizationRule{} - -// ConvertFrom populates our NamespacesAuthorizationRule from the provided hub NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_From_NamespacesAuthorizationRule(source) -} - -// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) -} - -// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespacesauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Defaulter = &NamespacesAuthorizationRule{} - -// Default applies defaults to the NamespacesAuthorizationRule resource -func (rule *NamespacesAuthorizationRule) Default() { - rule.defaultImpl() - var temp any = rule - if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { - runtimeDefaulter.CustomDefault() - } -} - -// defaultAzureName defaults the Azure name of the resource to the Kubernetes name -func (rule *NamespacesAuthorizationRule) defaultAzureName() { - if rule.Spec.AzureName == "" { - rule.Spec.AzureName = rule.Name - } -} - -// defaultImpl applies the code generated defaults to the NamespacesAuthorizationRule resource -func (rule *NamespacesAuthorizationRule) defaultImpl() { rule.defaultAzureName() } - -var _ genruntime.ImportableResource = &NamespacesAuthorizationRule{} - -// InitializeSpec initializes the spec for this resource from the given status -func (rule *NamespacesAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { - return rule.Spec.Initialize_From_Namespaces_AuthorizationRule_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_AuthorizationRule_STATUS but received %T instead", status) -} - -var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} - -// AzureName returns the Azure name of the resource -func (rule *NamespacesAuthorizationRule) AzureName() string { - return rule.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (rule NamespacesAuthorizationRule) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (rule *NamespacesAuthorizationRule) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (rule *NamespacesAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { - return &rule.Spec -} - -// GetStatus returns the status of this resource -func (rule *NamespacesAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { - return &rule.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (rule *NamespacesAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/authorizationRules" -func (rule *NamespacesAuthorizationRule) GetType() string { - return "Microsoft.EventHub/namespaces/authorizationRules" -} - -// NewEmptyStatus returns a new empty (blank) status -func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_AuthorizationRule_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) - return rule.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { - rule.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_AuthorizationRule_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - rule.Status = st - return nil -} - -// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespacesauthorizationrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespacesauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Validator = &NamespacesAuthorizationRule{} - -// ValidateCreate validates the creation of the resource -func (rule *NamespacesAuthorizationRule) ValidateCreate() (admission.Warnings, error) { - validations := rule.createValidations() - var temp any = rule - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.CreateValidations()...) - } - return genruntime.ValidateCreate(validations) -} - -// ValidateDelete validates the deletion of the resource -func (rule *NamespacesAuthorizationRule) ValidateDelete() (admission.Warnings, error) { - validations := rule.deleteValidations() - var temp any = rule - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.DeleteValidations()...) - } - return genruntime.ValidateDelete(validations) -} - -// ValidateUpdate validates an update of the resource -func (rule *NamespacesAuthorizationRule) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { - validations := rule.updateValidations() - var temp any = rule - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.UpdateValidations()...) - } - return genruntime.ValidateUpdate(old, validations) -} - -// createValidations validates the creation of the resource -func (rule *NamespacesAuthorizationRule) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference, rule.validateSecretDestinations} -} - -// deleteValidations validates the deletion of the resource -func (rule *NamespacesAuthorizationRule) deleteValidations() []func() (admission.Warnings, error) { - return nil -} - -// updateValidations validates the update of the resource -func (rule *NamespacesAuthorizationRule) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { - return []func(old runtime.Object) (admission.Warnings, error){ - func(old runtime.Object) (admission.Warnings, error) { - return rule.validateResourceReferences() - }, - rule.validateWriteOnceProperties, - func(old runtime.Object) (admission.Warnings, error) { - return rule.validateOwnerReference() - }, - func(old runtime.Object) (admission.Warnings, error) { - return rule.validateSecretDestinations() - }, - } -} - -// validateOwnerReference validates the owner field -func (rule *NamespacesAuthorizationRule) validateOwnerReference() (admission.Warnings, error) { - return genruntime.ValidateOwner(rule) -} - -// validateResourceReferences validates all resource references -func (rule *NamespacesAuthorizationRule) validateResourceReferences() (admission.Warnings, error) { - refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) - if err != nil { - return nil, err - } - return genruntime.ValidateResourceReferences(refs) -} - -// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's -func (rule *NamespacesAuthorizationRule) validateSecretDestinations() (admission.Warnings, error) { - if rule.Spec.OperatorSpec == nil { - return nil, nil - } - if rule.Spec.OperatorSpec.Secrets == nil { - return nil, nil - } - toValidate := []*genruntime.SecretDestination{ - rule.Spec.OperatorSpec.Secrets.PrimaryConnectionString, - rule.Spec.OperatorSpec.Secrets.PrimaryKey, - rule.Spec.OperatorSpec.Secrets.SecondaryConnectionString, - rule.Spec.OperatorSpec.Secrets.SecondaryKey, - } - return genruntime.ValidateSecretDestinations(toValidate) -} - -// validateWriteOnceProperties validates all WriteOnce properties -func (rule *NamespacesAuthorizationRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { - oldObj, ok := old.(*NamespacesAuthorizationRule) - if !ok { - return nil, nil - } - - return genruntime.ValidateWriteOnceProperties(oldObj, rule) -} - -// AssignProperties_From_NamespacesAuthorizationRule populates our NamespacesAuthorizationRule from the provided source NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) AssignProperties_From_NamespacesAuthorizationRule(source *v20240101s.NamespacesAuthorizationRule) error { - - // ObjectMeta - rule.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_AuthorizationRule_Spec - err := spec.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_Spec() to populate field Spec") - } - rule.Spec = spec - - // Status - var status Namespaces_AuthorizationRule_STATUS - err = status.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_STATUS() to populate field Status") - } - rule.Status = status - - // No error - return nil -} - -// AssignProperties_To_NamespacesAuthorizationRule populates the provided destination NamespacesAuthorizationRule from our NamespacesAuthorizationRule -func (rule *NamespacesAuthorizationRule) AssignProperties_To_NamespacesAuthorizationRule(destination *v20240101s.NamespacesAuthorizationRule) error { - - // ObjectMeta - destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_AuthorizationRule_Spec - err := rule.Spec.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_AuthorizationRule_STATUS - err = rule.Status.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_STATUS() to populate field Status") - } - destination.Status = status - - // No error - return nil -} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: rule.Spec.OriginalVersion(), - Kind: "NamespacesAuthorizationRule", - } -} - -// +kubebuilder:object:root=true -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} -type NamespacesAuthorizationRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesAuthorizationRule `json:"items"` -} - -type Namespaces_AuthorizationRule_Spec struct { - // +kubebuilder:validation:MinLength=1 - // 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"` - - // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not - // passed directly to Azure - OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `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 eventhub.azure.com/Namespace resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` - - // +kubebuilder:validation:Required - // Rights: The rights associated with the rule. - Rights []Namespaces_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` -} - -var _ genruntime.ARMTransformer = &Namespaces_AuthorizationRule_Spec{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (rule *Namespaces_AuthorizationRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if rule == nil { - return nil, nil - } - result := &Namespaces_AuthorizationRule_Spec_ARM{} - - // Set property "Name": - result.Name = resolved.Name - - // Set property "Properties": - if rule.Rights != nil { - result.Properties = &Namespaces_AuthorizationRule_Properties_Spec_ARM{} - } - for _, item := range rule.Rights { - result.Properties.Rights = append(result.Properties.Rights, item) - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (rule *Namespaces_AuthorizationRule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_AuthorizationRule_Spec_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (rule *Namespaces_AuthorizationRule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_AuthorizationRule_Spec_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_AuthorizationRule_Spec_ARM, got %T", armInput) - } - - // Set property "AzureName": - rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) - - // no assignment for property "OperatorSpec" - - // Set property "Owner": - rule.Owner = &genruntime.KnownResourceReference{ - Name: owner.Name, - ARMID: owner.ARMID, - } - - // Set property "Rights": - // copying flattened property: - if typedInput.Properties != nil { - for _, item := range typedInput.Properties.Rights { - rule.Rights = append(rule.Rights, item) - } - } - - // No error - return nil -} - -var _ genruntime.ConvertibleSpec = &Namespaces_AuthorizationRule_Spec{} - -// ConvertSpecFrom populates our Namespaces_AuthorizationRule_Spec from the provided source -func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_Spec) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_AuthorizationRule_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") - } - - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil -} - -// ConvertSpecTo populates the provided destination from our Namespaces_AuthorizationRule_Spec -func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_Spec) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_AuthorizationRule_Spec{} - err := rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(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 -} - -// AssignProperties_From_Namespaces_AuthorizationRule_Spec populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_Spec -func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_From_Namespaces_AuthorizationRule_Spec(source *v20240101s.Namespaces_AuthorizationRule_Spec) error { - - // AzureName - rule.AzureName = source.AzureName - - // OperatorSpec - if source.OperatorSpec != nil { - var operatorSpec NamespacesAuthorizationRuleOperatorSpec - err := operatorSpec.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source.OperatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - rule.OperatorSpec = &operatorSpec - } else { - rule.OperatorSpec = nil - } - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - rule.Owner = &owner - } else { - rule.Owner = nil - } - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = Namespaces_AuthorizationRule_Properties_Rights_Spec(rightItem) - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_AuthorizationRule_Spec populates the provided destination Namespaces_AuthorizationRule_Spec from our Namespaces_AuthorizationRule_Spec -func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_AuthorizationRule_Spec(destination *v20240101s.Namespaces_AuthorizationRule_Spec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // AzureName - destination.AzureName = rule.AzureName - - // OperatorSpec - if rule.OperatorSpec != nil { - var operatorSpec v20240101s.NamespacesAuthorizationRuleOperatorSpec - err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - destination.OperatorSpec = &operatorSpec - } else { - destination.OperatorSpec = nil - } - - // OriginalVersion - destination.OriginalVersion = rule.OriginalVersion() - - // Owner - if rule.Owner != nil { - owner := rule.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // Rights - if rule.Rights != nil { - rightList := make([]string, len(rule.Rights)) - for rightIndex, rightItem := range rule.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = string(rightItem) - } - destination.Rights = rightList - } else { - destination.Rights = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_Spec) Initialize_From_Namespaces_AuthorizationRule_STATUS(source *Namespaces_AuthorizationRule_STATUS) error { - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - right := Namespaces_AuthorizationRule_Properties_Rights_Spec(rightItem) - rightList[rightIndex] = right - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // No error - return nil -} - -// OriginalVersion returns the original API version used to create the resource. -func (rule *Namespaces_AuthorizationRule_Spec) OriginalVersion() string { - return GroupVersion.Version -} - -// SetAzureName sets the Azure name of the resource -func (rule *Namespaces_AuthorizationRule_Spec) SetAzureName(azureName string) { - rule.AzureName = azureName -} - -type Namespaces_AuthorizationRule_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"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // Rights: The rights associated with the rule. - Rights []Namespaces_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_AuthorizationRule_STATUS{} - -// ConvertStatusFrom populates our Namespaces_AuthorizationRule_STATUS from the provided source -func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_AuthorizationRule_STATUS) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_AuthorizationRule_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") - } - - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil -} - -// ConvertStatusTo populates the provided destination from our Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_AuthorizationRule_STATUS) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_AuthorizationRule_STATUS{} - err := rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(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 = &Namespaces_AuthorizationRule_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (rule *Namespaces_AuthorizationRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_AuthorizationRule_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (rule *Namespaces_AuthorizationRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_AuthorizationRule_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_AuthorizationRule_STATUS_ARM, got %T", armInput) - } - - // no assignment for property "Conditions" - - // Set property "Id": - if typedInput.Id != nil { - id := *typedInput.Id - rule.Id = &id - } - - // Set property "Location": - if typedInput.Location != nil { - location := *typedInput.Location - rule.Location = &location - } - - // Set property "Name": - if typedInput.Name != nil { - name := *typedInput.Name - rule.Name = &name - } - - // Set property "Rights": - // copying flattened property: - if typedInput.Properties != nil { - for _, item := range typedInput.Properties.Rights { - rule.Rights = append(rule.Rights, item) - } - } - - // Set property "SystemData": - if typedInput.SystemData != nil { - var systemData1 SystemData_STATUS - err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) - if err != nil { - return err - } - systemData := systemData1 - rule.SystemData = &systemData - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - rule.Type = &typeVar - } - - // No error - return nil -} - -// AssignProperties_From_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_STATUS from the provided source Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_AuthorizationRule_STATUS(source *v20240101s.Namespaces_AuthorizationRule_STATUS) error { - - // Conditions - rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // Id - rule.Id = genruntime.ClonePointerToString(source.Id) - - // Location - rule.Location = genruntime.ClonePointerToString(source.Location) - - // Name - rule.Name = genruntime.ClonePointerToString(source.Name) - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_AuthorizationRule_Properties_Rights_STATUS, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = Namespaces_AuthorizationRule_Properties_Rights_STATUS(rightItem) - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - rule.SystemData = &systemDatum - } else { - rule.SystemData = nil - } - - // Type - rule.Type = genruntime.ClonePointerToString(source.Type) - - // No error - return nil -} - -// AssignProperties_To_Namespaces_AuthorizationRule_STATUS populates the provided destination Namespaces_AuthorizationRule_STATUS from our Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_AuthorizationRule_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) - - // Id - destination.Id = genruntime.ClonePointerToString(rule.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(rule.Location) - - // Name - destination.Name = genruntime.ClonePointerToString(rule.Name) - - // Rights - if rule.Rights != nil { - rightList := make([]string, len(rule.Rights)) - for rightIndex, rightItem := range rule.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = string(rightItem) - } - destination.Rights = rightList - } else { - destination.Rights = nil - } - - // SystemData - if rule.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(rule.Type) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// +kubebuilder:validation:Enum={"Listen","Manage","Send"} -type Namespaces_AuthorizationRule_Properties_Rights_Spec string - -const ( - Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen = Namespaces_AuthorizationRule_Properties_Rights_Spec("Listen") - Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage = Namespaces_AuthorizationRule_Properties_Rights_Spec("Manage") - Namespaces_AuthorizationRule_Properties_Rights_Spec_Send = Namespaces_AuthorizationRule_Properties_Rights_Spec("Send") -) - -type Namespaces_AuthorizationRule_Properties_Rights_STATUS string - -const ( - Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen = Namespaces_AuthorizationRule_Properties_Rights_STATUS("Listen") - Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage = Namespaces_AuthorizationRule_Properties_Rights_STATUS("Manage") - Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send = Namespaces_AuthorizationRule_Properties_Rights_STATUS("Send") -) - -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type NamespacesAuthorizationRuleOperatorSpec struct { - // Secrets: configures where to place Azure generated secrets. - Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` -} - -// AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec populates our NamespacesAuthorizationRuleOperatorSpec from the provided source NamespacesAuthorizationRuleOperatorSpec -func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { - - // Secrets - if source.Secrets != nil { - var secret NamespacesAuthorizationRuleOperatorSecrets - err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets") - } - operator.Secrets = &secret - } else { - operator.Secrets = nil - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec populates the provided destination NamespacesAuthorizationRuleOperatorSpec from our NamespacesAuthorizationRuleOperatorSpec -func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesAuthorizationRuleOperatorSpec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Secrets - if operator.Secrets != nil { - var secret v20240101s.NamespacesAuthorizationRuleOperatorSecrets - err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets() 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 NamespacesAuthorizationRuleOperatorSecrets struct { - // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret - // will not be retrieved from Azure. - PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` - - // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from - // Azure. - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - - // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret - // will not be retrieved from Azure. - SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` - - // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved - // from Azure. - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -// AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets populates our NamespacesAuthorizationRuleOperatorSecrets from the provided source NamespacesAuthorizationRuleOperatorSecrets -func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { - - // PrimaryConnectionString - if source.PrimaryConnectionString != nil { - primaryConnectionString := source.PrimaryConnectionString.Copy() - secrets.PrimaryConnectionString = &primaryConnectionString - } else { - secrets.PrimaryConnectionString = nil - } - - // PrimaryKey - if source.PrimaryKey != nil { - primaryKey := source.PrimaryKey.Copy() - secrets.PrimaryKey = &primaryKey - } else { - secrets.PrimaryKey = nil - } - - // SecondaryConnectionString - if source.SecondaryConnectionString != nil { - secondaryConnectionString := source.SecondaryConnectionString.Copy() - secrets.SecondaryConnectionString = &secondaryConnectionString - } else { - secrets.SecondaryConnectionString = nil - } - - // SecondaryKey - if source.SecondaryKey != nil { - secondaryKey := source.SecondaryKey.Copy() - secrets.SecondaryKey = &secondaryKey - } else { - secrets.SecondaryKey = nil - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets populates the provided destination NamespacesAuthorizationRuleOperatorSecrets from our NamespacesAuthorizationRuleOperatorSecrets -func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesAuthorizationRuleOperatorSecrets) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // PrimaryConnectionString - if secrets.PrimaryConnectionString != nil { - primaryConnectionString := secrets.PrimaryConnectionString.Copy() - destination.PrimaryConnectionString = &primaryConnectionString - } else { - destination.PrimaryConnectionString = nil - } - - // PrimaryKey - if secrets.PrimaryKey != nil { - primaryKey := secrets.PrimaryKey.Copy() - destination.PrimaryKey = &primaryKey - } else { - destination.PrimaryKey = nil - } - - // SecondaryConnectionString - if secrets.SecondaryConnectionString != nil { - secondaryConnectionString := secrets.SecondaryConnectionString.Copy() - destination.SecondaryConnectionString = &secondaryConnectionString - } else { - destination.SecondaryConnectionString = nil - } - - // SecondaryKey - if secrets.SecondaryKey != nil { - secondaryKey := secrets.SecondaryKey.Copy() - destination.SecondaryKey = &secondaryKey - } else { - destination.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -func init() { - SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go deleted file mode 100644 index f20ce5c3c2d..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_authorization_rule_types_gen_test.go +++ /dev/null @@ -1,605 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRule to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesAuthorizationRule - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesAuthorizationRule - 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_NamespacesAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRule to NamespacesAuthorizationRule via AssignProperties_To_NamespacesAuthorizationRule & AssignProperties_From_NamespacesAuthorizationRule returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesAuthorizationRule - err := copied.AssignProperties_To_NamespacesAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesAuthorizationRule - err = actual.AssignProperties_From_NamespacesAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesAuthorizationRule via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesAuthorizationRule runs a test to see if a specific instance of NamespacesAuthorizationRule round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesAuthorizationRule - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesAuthorizationRule instances for property testing - lazily instantiated by -// NamespacesAuthorizationRuleGenerator() -var namespacesAuthorizationRuleGenerator gopter.Gen - -// NamespacesAuthorizationRuleGenerator returns a generator of NamespacesAuthorizationRule instances for property testing. -func NamespacesAuthorizationRuleGenerator() gopter.Gen { - if namespacesAuthorizationRuleGenerator != nil { - return namespacesAuthorizationRuleGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(generators) - namespacesAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule{}), generators) - - return namespacesAuthorizationRuleGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_AuthorizationRule_SpecGenerator() - gens["Status"] = Namespaces_AuthorizationRule_STATUSGenerator() -} - -func Test_Namespaces_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_AuthorizationRule_Spec to Namespaces_AuthorizationRule_Spec via AssignProperties_To_Namespaces_AuthorizationRule_Spec & AssignProperties_From_Namespaces_AuthorizationRule_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec tests if a specific instance of Namespaces_AuthorizationRule_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_Spec - err := copied.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_AuthorizationRule_Spec - err = actual.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_AuthorizationRule_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_Spec instances for property testing - lazily instantiated by -// Namespaces_AuthorizationRule_SpecGenerator() -var namespaces_AuthorizationRule_SpecGenerator gopter.Gen - -// Namespaces_AuthorizationRule_SpecGenerator returns a generator of Namespaces_AuthorizationRule_Spec instances for property testing. -// We first initialize namespaces_AuthorizationRule_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { - if namespaces_AuthorizationRule_SpecGenerator != nil { - return namespaces_AuthorizationRule_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) - namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) - AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) - namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) - - return namespaces_AuthorizationRule_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_AuthorizationRule_Properties_Rights_Spec_Send)) -} - -// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) -} - -func Test_Namespaces_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_AuthorizationRule_STATUS to Namespaces_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_AuthorizationRule_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS tests if a specific instance of Namespaces_AuthorizationRule_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_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 v20240101s.Namespaces_AuthorizationRule_STATUS - err := copied.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_AuthorizationRule_STATUS - err = actual.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_AuthorizationRule_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_STATUS instances for property testing - lazily instantiated by -// Namespaces_AuthorizationRule_STATUSGenerator() -var namespaces_AuthorizationRule_STATUSGenerator gopter.Gen - -// Namespaces_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_AuthorizationRule_STATUS instances for property testing. -// We first initialize namespaces_AuthorizationRule_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_AuthorizationRule_STATUSGenerator() gopter.Gen { - if namespaces_AuthorizationRule_STATUSGenerator != nil { - return namespaces_AuthorizationRule_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) - namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) - namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) - - return namespaces_AuthorizationRule_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send)) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_NamespacesAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRuleOperatorSpec to NamespacesAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesAuthorizationRuleOperatorSpec - err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesAuthorizationRuleOperatorSpec - err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesAuthorizationRuleOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesAuthorizationRuleOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by -// NamespacesAuthorizationRuleOperatorSpecGenerator() -var namespacesAuthorizationRuleOperatorSpecGenerator gopter.Gen - -// NamespacesAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing. -func NamespacesAuthorizationRuleOperatorSpecGenerator() gopter.Gen { - if namespacesAuthorizationRuleOperatorSpecGenerator != nil { - return namespacesAuthorizationRuleOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(generators) - namespacesAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSpec{}), generators) - - return namespacesAuthorizationRuleOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) -} - -func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesAuthorizationRuleOperatorSecrets to NamespacesAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesAuthorizationRuleOperatorSecrets - err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesAuthorizationRuleOperatorSecrets - err = actual.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesAuthorizationRuleOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesAuthorizationRuleOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated by -// NamespacesAuthorizationRuleOperatorSecretsGenerator() -var namespacesAuthorizationRuleOperatorSecretsGenerator gopter.Gen - -// NamespacesAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing. -func NamespacesAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { - if namespacesAuthorizationRuleOperatorSecretsGenerator != nil { - return namespacesAuthorizationRuleOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - namespacesAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSecrets{}), generators) - - return namespacesAuthorizationRuleOperatorSecretsGenerator -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go deleted file mode 100644 index 3d27846eefe..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - -type Namespaces_Eventhub_Spec_ARM struct { - Name string `json:"name,omitempty"` - - // Properties: Properties supplied to the Create Or Update Event Hub operation. - Properties *Namespaces_Eventhub_Properties_Spec_ARM `json:"properties,omitempty"` -} - -var _ genruntime.ARMResourceSpec = &Namespaces_Eventhub_Spec_ARM{} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (eventhub Namespaces_Eventhub_Spec_ARM) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetName returns the Name of the resource -func (eventhub *Namespaces_Eventhub_Spec_ARM) GetName() string { - return eventhub.Name -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs" -func (eventhub *Namespaces_Eventhub_Spec_ARM) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs" -} - -type Namespaces_Eventhub_Properties_Spec_ARM struct { - // CaptureDescription: Properties of capture description - CaptureDescription *CaptureDescription_ARM `json:"captureDescription,omitempty"` - - // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days - MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` - - // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. - PartitionCount *int `json:"partitionCount,omitempty"` - - // RetentionDescription: Event Hub retention settings - RetentionDescription *RetentionDescription_ARM `json:"retentionDescription,omitempty"` -} - -// Properties to configure capture description for eventhub -type CaptureDescription_ARM struct { - // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) - Destination *Destination_ARM `json:"destination,omitempty"` - - // Enabled: A value that indicates whether capture description is enabled. - Enabled *bool `json:"enabled,omitempty"` - - // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be - // deprecated in New API Version - Encoding *CaptureDescription_Encoding `json:"encoding,omitempty"` - - // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, - // value should between 60 to 900 seconds - IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` - - // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, - // value should be between 10485760 to 524288000 bytes - SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` - - // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives - SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` -} - -// Properties to configure retention settings for the eventhub -type RetentionDescription_ARM struct { - // CleanupPolicy: Enumerates the possible values for cleanup policy - CleanupPolicy *RetentionDescription_CleanupPolicy `json:"cleanupPolicy,omitempty"` - - // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when - // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue - RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` - - // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is - // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified - // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key - // described by the tombstone marker within the compacted Event Hub - TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` -} - -// Capture storage details for capture description -type Destination_ARM struct { - // Identity: A value that indicates whether capture description is enabled. - Identity *CaptureIdentity_ARM `json:"identity,omitempty"` - - // Name: Name for capture destination - Name *string `json:"name,omitempty"` - - // Properties: Properties describing the storage account, blob container and archive name format for capture destination - Properties *Destination_Properties_ARM `json:"properties,omitempty"` -} - -// A value that indicates whether capture description is enabled. -type CaptureIdentity_ARM struct { - // Type: Type of Azure Active Directory Managed Identity. - Type *CaptureIdentity_Type `json:"type,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} - -type Destination_Properties_ARM struct { - // ArchiveNameFormat: Blob naming convention for archive, e.g. - // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - // (Namespace,EventHub .. etc) are mandatory irrespective of order - ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` - - // BlobContainer: Blob container Name - BlobContainer *string `json:"blobContainer,omitempty"` - - // DataLakeAccountName: The Azure Data Lake Store name for the captured events - DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` - - // DataLakeFolderPath: The destination folder path for the captured events - DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` - - // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store - DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` - StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go deleted file mode 100644 index 9010e7d4a7d..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhub_spec_arm_types_gen_test.go +++ /dev/null @@ -1,515 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_Eventhub_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Spec_ARM, Namespaces_Eventhub_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhub_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_Spec_ARM(subject Namespaces_Eventhub_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhub_Spec_ARM instances for property testing - lazily instantiated by -// Namespaces_Eventhub_Spec_ARMGenerator() -var namespaces_Eventhub_Spec_ARMGenerator gopter.Gen - -// Namespaces_Eventhub_Spec_ARMGenerator returns a generator of Namespaces_Eventhub_Spec_ARM instances for property testing. -// We first initialize namespaces_Eventhub_Spec_ARMGenerator 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 Namespaces_Eventhub_Spec_ARMGenerator() gopter.Gen { - if namespaces_Eventhub_Spec_ARMGenerator != nil { - return namespaces_Eventhub_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(generators) - namespaces_Eventhub_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(generators) - namespaces_Eventhub_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec_ARM{}), generators) - - return namespaces_Eventhub_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(gens map[string]gopter.Gen) { - gens["Name"] = gen.AlphaString() -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_Eventhub_Properties_Spec_ARMGenerator()) -} - -func Test_Namespaces_Eventhub_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_Properties_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Properties_Spec_ARM, Namespaces_Eventhub_Properties_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhub_Properties_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_Properties_Spec_ARM(subject Namespaces_Eventhub_Properties_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_Properties_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhub_Properties_Spec_ARM instances for property testing - lazily instantiated by -// Namespaces_Eventhub_Properties_Spec_ARMGenerator() -var namespaces_Eventhub_Properties_Spec_ARMGenerator gopter.Gen - -// Namespaces_Eventhub_Properties_Spec_ARMGenerator returns a generator of Namespaces_Eventhub_Properties_Spec_ARM instances for property testing. -// We first initialize namespaces_Eventhub_Properties_Spec_ARMGenerator 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 Namespaces_Eventhub_Properties_Spec_ARMGenerator() gopter.Gen { - if namespaces_Eventhub_Properties_Spec_ARMGenerator != nil { - return namespaces_Eventhub_Properties_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(generators) - namespaces_Eventhub_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_Spec_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(generators) - namespaces_Eventhub_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_Spec_ARM{}), generators) - - return namespaces_Eventhub_Properties_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(gens map[string]gopter.Gen) { - gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) - gens["PartitionCount"] = gen.PtrOf(gen.Int()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_Spec_ARM(gens map[string]gopter.Gen) { - gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_ARMGenerator()) - gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_ARMGenerator()) -} - -func Test_CaptureDescription_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureDescription_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureDescription_ARM, CaptureDescription_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureDescription_ARM runs a test to see if a specific instance of CaptureDescription_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureDescription_ARM(subject CaptureDescription_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureDescription_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureDescription_ARM instances for property testing - lazily instantiated by -// CaptureDescription_ARMGenerator() -var captureDescription_ARMGenerator gopter.Gen - -// CaptureDescription_ARMGenerator returns a generator of CaptureDescription_ARM instances for property testing. -// We first initialize captureDescription_ARMGenerator 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 CaptureDescription_ARMGenerator() gopter.Gen { - if captureDescription_ARMGenerator != nil { - return captureDescription_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_ARM(generators) - captureDescription_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_ARM(generators) - AddRelatedPropertyGeneratorsForCaptureDescription_ARM(generators) - captureDescription_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_ARM{}), generators) - - return captureDescription_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureDescription_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureDescription_ARM(gens map[string]gopter.Gen) { - gens["Enabled"] = gen.PtrOf(gen.Bool()) - gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_Avro, CaptureDescription_Encoding_AvroDeflate)) - gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) - gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) - gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForCaptureDescription_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForCaptureDescription_ARM(gens map[string]gopter.Gen) { - gens["Destination"] = gen.PtrOf(Destination_ARMGenerator()) -} - -func Test_RetentionDescription_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of RetentionDescription_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForRetentionDescription_ARM, RetentionDescription_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForRetentionDescription_ARM runs a test to see if a specific instance of RetentionDescription_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForRetentionDescription_ARM(subject RetentionDescription_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual RetentionDescription_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of RetentionDescription_ARM instances for property testing - lazily instantiated by -// RetentionDescription_ARMGenerator() -var retentionDescription_ARMGenerator gopter.Gen - -// RetentionDescription_ARMGenerator returns a generator of RetentionDescription_ARM instances for property testing. -func RetentionDescription_ARMGenerator() gopter.Gen { - if retentionDescription_ARMGenerator != nil { - return retentionDescription_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForRetentionDescription_ARM(generators) - retentionDescription_ARMGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_ARM{}), generators) - - return retentionDescription_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForRetentionDescription_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForRetentionDescription_ARM(gens map[string]gopter.Gen) { - gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_Compact, RetentionDescription_CleanupPolicy_Delete)) - gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) - gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) -} - -func Test_Destination_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination_ARM, Destination_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination_ARM runs a test to see if a specific instance of Destination_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination_ARM(subject Destination_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Destination_ARM instances for property testing - lazily instantiated by Destination_ARMGenerator() -var destination_ARMGenerator gopter.Gen - -// Destination_ARMGenerator returns a generator of Destination_ARM instances for property testing. -// We first initialize destination_ARMGenerator 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 Destination_ARMGenerator() gopter.Gen { - if destination_ARMGenerator != nil { - return destination_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_ARM(generators) - destination_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_ARM(generators) - AddRelatedPropertyGeneratorsForDestination_ARM(generators) - destination_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_ARM{}), generators) - - return destination_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForDestination_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination_ARM(gens map[string]gopter.Gen) { - gens["Name"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForDestination_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForDestination_ARM(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(CaptureIdentity_ARMGenerator()) - gens["Properties"] = gen.PtrOf(Destination_Properties_ARMGenerator()) -} - -func Test_CaptureIdentity_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureIdentity_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureIdentity_ARM, CaptureIdentity_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureIdentity_ARM runs a test to see if a specific instance of CaptureIdentity_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureIdentity_ARM(subject CaptureIdentity_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureIdentity_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureIdentity_ARM instances for property testing - lazily instantiated by -// CaptureIdentity_ARMGenerator() -var captureIdentity_ARMGenerator gopter.Gen - -// CaptureIdentity_ARMGenerator returns a generator of CaptureIdentity_ARM instances for property testing. -func CaptureIdentity_ARMGenerator() gopter.Gen { - if captureIdentity_ARMGenerator != nil { - return captureIdentity_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureIdentity_ARM(generators) - captureIdentity_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_ARM{}), generators) - - return captureIdentity_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureIdentity_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureIdentity_ARM(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_SystemAssigned, CaptureIdentity_Type_UserAssigned)) - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_Destination_Properties_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination_Properties_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination_Properties_ARM, Destination_Properties_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination_Properties_ARM runs a test to see if a specific instance of Destination_Properties_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination_Properties_ARM(subject Destination_Properties_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination_Properties_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Destination_Properties_ARM instances for property testing - lazily instantiated by -// Destination_Properties_ARMGenerator() -var destination_Properties_ARMGenerator gopter.Gen - -// Destination_Properties_ARMGenerator returns a generator of Destination_Properties_ARM instances for property testing. -func Destination_Properties_ARMGenerator() gopter.Gen { - if destination_Properties_ARMGenerator != nil { - return destination_Properties_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_Properties_ARM(generators) - destination_Properties_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_Properties_ARM{}), generators) - - return destination_Properties_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForDestination_Properties_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination_Properties_ARM(gens map[string]gopter.Gen) { - gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) - gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) - gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go deleted file mode 100644 index 9ec1c4d8921..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -type Namespaces_Eventhub_STATUS_ARM struct { - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // Properties: Properties supplied to the Create Or Update Event Hub operation. - Properties *Namespaces_Eventhub_Properties_STATUS_ARM `json:"properties,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` -} - -type Namespaces_Eventhub_Properties_STATUS_ARM struct { - // CaptureDescription: Properties of capture description - CaptureDescription *CaptureDescription_STATUS_ARM `json:"captureDescription,omitempty"` - - // CreatedAt: Exact time the Event Hub was created. - CreatedAt *string `json:"createdAt,omitempty"` - - // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days - MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` - - // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. - PartitionCount *int `json:"partitionCount,omitempty"` - - // PartitionIds: Current number of shards on the Event Hub. - PartitionIds []string `json:"partitionIds,omitempty"` - - // RetentionDescription: Event Hub retention settings - RetentionDescription *RetentionDescription_STATUS_ARM `json:"retentionDescription,omitempty"` - - // Status: Enumerates the possible values for the status of the Event Hub. - Status *Namespaces_Eventhub_Properties_Status_STATUS `json:"status,omitempty"` - - // UpdatedAt: The exact time the message was updated. - UpdatedAt *string `json:"updatedAt,omitempty"` -} - -// Properties to configure capture description for eventhub -type CaptureDescription_STATUS_ARM struct { - // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) - Destination *Destination_STATUS_ARM `json:"destination,omitempty"` - - // Enabled: A value that indicates whether capture description is enabled. - Enabled *bool `json:"enabled,omitempty"` - - // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be - // deprecated in New API Version - Encoding *CaptureDescription_Encoding_STATUS `json:"encoding,omitempty"` - - // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, - // value should between 60 to 900 seconds - IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` - - // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, - // value should be between 10485760 to 524288000 bytes - SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` - - // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives - SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` -} - -// Properties to configure retention settings for the eventhub -type RetentionDescription_STATUS_ARM struct { - // CleanupPolicy: Enumerates the possible values for cleanup policy - CleanupPolicy *RetentionDescription_CleanupPolicy_STATUS `json:"cleanupPolicy,omitempty"` - - // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when - // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue - RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` - - // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is - // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified - // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key - // described by the tombstone marker within the compacted Event Hub - TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` -} - -// Capture storage details for capture description -type Destination_STATUS_ARM struct { - // Identity: A value that indicates whether capture description is enabled. - Identity *CaptureIdentity_STATUS_ARM `json:"identity,omitempty"` - - // Name: Name for capture destination - Name *string `json:"name,omitempty"` - - // Properties: Properties describing the storage account, blob container and archive name format for capture destination - Properties *Destination_Properties_STATUS_ARM `json:"properties,omitempty"` -} - -// A value that indicates whether capture description is enabled. -type CaptureIdentity_STATUS_ARM struct { - // Type: Type of Azure Active Directory Managed Identity. - Type *CaptureIdentity_Type_STATUS `json:"type,omitempty"` - - // UserAssignedIdentity: ARM ID of Managed User Identity. This property is required is the type is UserAssignedIdentity. If - // type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be used. - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} - -type Destination_Properties_STATUS_ARM struct { - // ArchiveNameFormat: Blob naming convention for archive, e.g. - // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - // (Namespace,EventHub .. etc) are mandatory irrespective of order - ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` - - // BlobContainer: Blob container Name - BlobContainer *string `json:"blobContainer,omitempty"` - - // DataLakeAccountName: The Azure Data Lake Store name for the captured events - DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` - - // DataLakeFolderPath: The destination folder path for the captured events - DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` - - // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store - DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` - - // StorageAccountResourceId: Resource id of the storage account to be used to create the blobs - StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go deleted file mode 100644 index 3c24ebd5b45..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhub_status_arm_types_gen_test.go +++ /dev/null @@ -1,533 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_Eventhub_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_STATUS_ARM, Namespaces_Eventhub_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhub_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_STATUS_ARM(subject Namespaces_Eventhub_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhub_STATUS_ARM instances for property testing - lazily instantiated by -// Namespaces_Eventhub_STATUS_ARMGenerator() -var namespaces_Eventhub_STATUS_ARMGenerator gopter.Gen - -// Namespaces_Eventhub_STATUS_ARMGenerator returns a generator of Namespaces_Eventhub_STATUS_ARM instances for property testing. -// We first initialize namespaces_Eventhub_STATUS_ARMGenerator 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 Namespaces_Eventhub_STATUS_ARMGenerator() gopter.Gen { - if namespaces_Eventhub_STATUS_ARMGenerator != nil { - return namespaces_Eventhub_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(generators) - namespaces_Eventhub_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(generators) - namespaces_Eventhub_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS_ARM{}), generators) - - return namespaces_Eventhub_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_Eventhub_Properties_STATUS_ARMGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) -} - -func Test_Namespaces_Eventhub_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_Properties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Properties_STATUS_ARM, Namespaces_Eventhub_Properties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhub_Properties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_Properties_STATUS_ARM(subject Namespaces_Eventhub_Properties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_Properties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhub_Properties_STATUS_ARM instances for property testing - lazily instantiated by -// Namespaces_Eventhub_Properties_STATUS_ARMGenerator() -var namespaces_Eventhub_Properties_STATUS_ARMGenerator gopter.Gen - -// Namespaces_Eventhub_Properties_STATUS_ARMGenerator returns a generator of Namespaces_Eventhub_Properties_STATUS_ARM instances for property testing. -// We first initialize namespaces_Eventhub_Properties_STATUS_ARMGenerator 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 Namespaces_Eventhub_Properties_STATUS_ARMGenerator() gopter.Gen { - if namespaces_Eventhub_Properties_STATUS_ARMGenerator != nil { - return namespaces_Eventhub_Properties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(generators) - namespaces_Eventhub_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(generators) - namespaces_Eventhub_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Properties_STATUS_ARM{}), generators) - - return namespaces_Eventhub_Properties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) - gens["PartitionCount"] = gen.PtrOf(gen.Int()) - gens["PartitionIds"] = gen.SliceOf(gen.AlphaString()) - gens["Status"] = gen.PtrOf(gen.OneConstOf( - Namespaces_Eventhub_Properties_Status_STATUS_Active, - Namespaces_Eventhub_Properties_Status_STATUS_Creating, - Namespaces_Eventhub_Properties_Status_STATUS_Deleting, - Namespaces_Eventhub_Properties_Status_STATUS_Disabled, - Namespaces_Eventhub_Properties_Status_STATUS_ReceiveDisabled, - Namespaces_Eventhub_Properties_Status_STATUS_Renaming, - Namespaces_Eventhub_Properties_Status_STATUS_Restoring, - Namespaces_Eventhub_Properties_Status_STATUS_SendDisabled, - Namespaces_Eventhub_Properties_Status_STATUS_Unknown)) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_STATUS_ARMGenerator()) - gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_STATUS_ARMGenerator()) -} - -func Test_CaptureDescription_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureDescription_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureDescription_STATUS_ARM, CaptureDescription_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureDescription_STATUS_ARM runs a test to see if a specific instance of CaptureDescription_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureDescription_STATUS_ARM(subject CaptureDescription_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureDescription_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureDescription_STATUS_ARM instances for property testing - lazily instantiated by -// CaptureDescription_STATUS_ARMGenerator() -var captureDescription_STATUS_ARMGenerator gopter.Gen - -// CaptureDescription_STATUS_ARMGenerator returns a generator of CaptureDescription_STATUS_ARM instances for property testing. -// We first initialize captureDescription_STATUS_ARMGenerator 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 CaptureDescription_STATUS_ARMGenerator() gopter.Gen { - if captureDescription_STATUS_ARMGenerator != nil { - return captureDescription_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM(generators) - captureDescription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForCaptureDescription_STATUS_ARM(generators) - captureDescription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS_ARM{}), generators) - - return captureDescription_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureDescription_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Enabled"] = gen.PtrOf(gen.Bool()) - gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_STATUS_Avro, CaptureDescription_Encoding_STATUS_AvroDeflate)) - gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) - gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) - gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForCaptureDescription_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Destination"] = gen.PtrOf(Destination_STATUS_ARMGenerator()) -} - -func Test_RetentionDescription_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of RetentionDescription_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForRetentionDescription_STATUS_ARM, RetentionDescription_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForRetentionDescription_STATUS_ARM runs a test to see if a specific instance of RetentionDescription_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForRetentionDescription_STATUS_ARM(subject RetentionDescription_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual RetentionDescription_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of RetentionDescription_STATUS_ARM instances for property testing - lazily instantiated by -// RetentionDescription_STATUS_ARMGenerator() -var retentionDescription_STATUS_ARMGenerator gopter.Gen - -// RetentionDescription_STATUS_ARMGenerator returns a generator of RetentionDescription_STATUS_ARM instances for property testing. -func RetentionDescription_STATUS_ARMGenerator() gopter.Gen { - if retentionDescription_STATUS_ARMGenerator != nil { - return retentionDescription_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForRetentionDescription_STATUS_ARM(generators) - retentionDescription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_STATUS_ARM{}), generators) - - return retentionDescription_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForRetentionDescription_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForRetentionDescription_STATUS_ARM(gens map[string]gopter.Gen) { - gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_STATUS_Compact, RetentionDescription_CleanupPolicy_STATUS_Delete)) - gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) - gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) -} - -func Test_Destination_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination_STATUS_ARM, Destination_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination_STATUS_ARM runs a test to see if a specific instance of Destination_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination_STATUS_ARM(subject Destination_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Destination_STATUS_ARM instances for property testing - lazily instantiated by -// Destination_STATUS_ARMGenerator() -var destination_STATUS_ARMGenerator gopter.Gen - -// Destination_STATUS_ARMGenerator returns a generator of Destination_STATUS_ARM instances for property testing. -// We first initialize destination_STATUS_ARMGenerator 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 Destination_STATUS_ARMGenerator() gopter.Gen { - if destination_STATUS_ARMGenerator != nil { - return destination_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_STATUS_ARM(generators) - destination_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForDestination_STATUS_ARM(generators) - destination_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS_ARM{}), generators) - - return destination_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForDestination_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Name"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForDestination_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForDestination_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(CaptureIdentity_STATUS_ARMGenerator()) - gens["Properties"] = gen.PtrOf(Destination_Properties_STATUS_ARMGenerator()) -} - -func Test_CaptureIdentity_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureIdentity_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureIdentity_STATUS_ARM, CaptureIdentity_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureIdentity_STATUS_ARM runs a test to see if a specific instance of CaptureIdentity_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureIdentity_STATUS_ARM(subject CaptureIdentity_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureIdentity_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureIdentity_STATUS_ARM instances for property testing - lazily instantiated by -// CaptureIdentity_STATUS_ARMGenerator() -var captureIdentity_STATUS_ARMGenerator gopter.Gen - -// CaptureIdentity_STATUS_ARMGenerator returns a generator of CaptureIdentity_STATUS_ARM instances for property testing. -func CaptureIdentity_STATUS_ARMGenerator() gopter.Gen { - if captureIdentity_STATUS_ARMGenerator != nil { - return captureIdentity_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS_ARM(generators) - captureIdentity_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_STATUS_ARM{}), generators) - - return captureIdentity_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_STATUS_SystemAssigned, CaptureIdentity_Type_STATUS_UserAssigned)) - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_Destination_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination_Properties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination_Properties_STATUS_ARM, Destination_Properties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination_Properties_STATUS_ARM runs a test to see if a specific instance of Destination_Properties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination_Properties_STATUS_ARM(subject Destination_Properties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination_Properties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Destination_Properties_STATUS_ARM instances for property testing - lazily instantiated by -// Destination_Properties_STATUS_ARMGenerator() -var destination_Properties_STATUS_ARMGenerator gopter.Gen - -// Destination_Properties_STATUS_ARMGenerator returns a generator of Destination_Properties_STATUS_ARM instances for property testing. -func Destination_Properties_STATUS_ARMGenerator() gopter.Gen { - if destination_Properties_STATUS_ARMGenerator != nil { - return destination_Properties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_Properties_STATUS_ARM(generators) - destination_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Destination_Properties_STATUS_ARM{}), generators) - - return destination_Properties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForDestination_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) - gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) - gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go deleted file mode 100644 index 79d730e9a85..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen.go +++ /dev/null @@ -1,2660 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" -// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" -// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} -type NamespacesEventhub struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_Eventhub_Spec `json:"spec,omitempty"` - Status Namespaces_Eventhub_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesEventhub{} - -// GetConditions returns the conditions of the resource -func (eventhub *NamespacesEventhub) GetConditions() conditions.Conditions { - return eventhub.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (eventhub *NamespacesEventhub) SetConditions(conditions conditions.Conditions) { - eventhub.Status.Conditions = conditions -} - -var _ conversion.Convertible = &NamespacesEventhub{} - -// ConvertFrom populates our NamespacesEventhub from the provided hub NamespacesEventhub -func (eventhub *NamespacesEventhub) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesEventhub) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) - } - - return eventhub.AssignProperties_From_NamespacesEventhub(source) -} - -// ConvertTo populates the provided hub NamespacesEventhub from our NamespacesEventhub -func (eventhub *NamespacesEventhub) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesEventhub) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhub but received %T instead", hub) - } - - return eventhub.AssignProperties_To_NamespacesEventhub(destination) -} - -// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespaceseventhub,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaceseventhubs.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Defaulter = &NamespacesEventhub{} - -// Default applies defaults to the NamespacesEventhub resource -func (eventhub *NamespacesEventhub) Default() { - eventhub.defaultImpl() - var temp any = eventhub - if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { - runtimeDefaulter.CustomDefault() - } -} - -// defaultAzureName defaults the Azure name of the resource to the Kubernetes name -func (eventhub *NamespacesEventhub) defaultAzureName() { - if eventhub.Spec.AzureName == "" { - eventhub.Spec.AzureName = eventhub.Name - } -} - -// defaultImpl applies the code generated defaults to the NamespacesEventhub resource -func (eventhub *NamespacesEventhub) defaultImpl() { eventhub.defaultAzureName() } - -var _ genruntime.ImportableResource = &NamespacesEventhub{} - -// InitializeSpec initializes the spec for this resource from the given status -func (eventhub *NamespacesEventhub) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Eventhub_STATUS); ok { - return eventhub.Spec.Initialize_From_Namespaces_Eventhub_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Eventhub_STATUS but received %T instead", status) -} - -var _ genruntime.KubernetesResource = &NamespacesEventhub{} - -// AzureName returns the Azure name of the resource -func (eventhub *NamespacesEventhub) AzureName() string { - return eventhub.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (eventhub NamespacesEventhub) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (eventhub *NamespacesEventhub) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (eventhub *NamespacesEventhub) GetSpec() genruntime.ConvertibleSpec { - return &eventhub.Spec -} - -// GetStatus returns the status of this resource -func (eventhub *NamespacesEventhub) GetStatus() genruntime.ConvertibleStatus { - return &eventhub.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (eventhub *NamespacesEventhub) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs" -func (eventhub *NamespacesEventhub) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs" -} - -// NewEmptyStatus returns a new empty (blank) status -func (eventhub *NamespacesEventhub) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_Eventhub_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (eventhub *NamespacesEventhub) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(eventhub.Spec) - return eventhub.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (eventhub *NamespacesEventhub) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_Eventhub_STATUS); ok { - eventhub.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_Eventhub_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - eventhub.Status = st - return nil -} - -// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespaceseventhub,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaceseventhubs.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Validator = &NamespacesEventhub{} - -// ValidateCreate validates the creation of the resource -func (eventhub *NamespacesEventhub) ValidateCreate() (admission.Warnings, error) { - validations := eventhub.createValidations() - var temp any = eventhub - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.CreateValidations()...) - } - return genruntime.ValidateCreate(validations) -} - -// ValidateDelete validates the deletion of the resource -func (eventhub *NamespacesEventhub) ValidateDelete() (admission.Warnings, error) { - validations := eventhub.deleteValidations() - var temp any = eventhub - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.DeleteValidations()...) - } - return genruntime.ValidateDelete(validations) -} - -// ValidateUpdate validates an update of the resource -func (eventhub *NamespacesEventhub) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { - validations := eventhub.updateValidations() - var temp any = eventhub - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.UpdateValidations()...) - } - return genruntime.ValidateUpdate(old, validations) -} - -// createValidations validates the creation of the resource -func (eventhub *NamespacesEventhub) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){eventhub.validateResourceReferences, eventhub.validateOwnerReference} -} - -// deleteValidations validates the deletion of the resource -func (eventhub *NamespacesEventhub) deleteValidations() []func() (admission.Warnings, error) { - return nil -} - -// updateValidations validates the update of the resource -func (eventhub *NamespacesEventhub) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { - return []func(old runtime.Object) (admission.Warnings, error){ - func(old runtime.Object) (admission.Warnings, error) { - return eventhub.validateResourceReferences() - }, - eventhub.validateWriteOnceProperties, - func(old runtime.Object) (admission.Warnings, error) { - return eventhub.validateOwnerReference() - }, - } -} - -// validateOwnerReference validates the owner field -func (eventhub *NamespacesEventhub) validateOwnerReference() (admission.Warnings, error) { - return genruntime.ValidateOwner(eventhub) -} - -// validateResourceReferences validates all resource references -func (eventhub *NamespacesEventhub) validateResourceReferences() (admission.Warnings, error) { - refs, err := reflecthelpers.FindResourceReferences(&eventhub.Spec) - if err != nil { - return nil, err - } - return genruntime.ValidateResourceReferences(refs) -} - -// validateWriteOnceProperties validates all WriteOnce properties -func (eventhub *NamespacesEventhub) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { - oldObj, ok := old.(*NamespacesEventhub) - if !ok { - return nil, nil - } - - return genruntime.ValidateWriteOnceProperties(oldObj, eventhub) -} - -// AssignProperties_From_NamespacesEventhub populates our NamespacesEventhub from the provided source NamespacesEventhub -func (eventhub *NamespacesEventhub) AssignProperties_From_NamespacesEventhub(source *v20240101s.NamespacesEventhub) error { - - // ObjectMeta - eventhub.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_Eventhub_Spec - err := spec.AssignProperties_From_Namespaces_Eventhub_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_Spec() to populate field Spec") - } - eventhub.Spec = spec - - // Status - var status Namespaces_Eventhub_STATUS - err = status.AssignProperties_From_Namespaces_Eventhub_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhub_STATUS() to populate field Status") - } - eventhub.Status = status - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhub populates the provided destination NamespacesEventhub from our NamespacesEventhub -func (eventhub *NamespacesEventhub) AssignProperties_To_NamespacesEventhub(destination *v20240101s.NamespacesEventhub) error { - - // ObjectMeta - destination.ObjectMeta = *eventhub.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_Eventhub_Spec - err := eventhub.Spec.AssignProperties_To_Namespaces_Eventhub_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_Eventhub_STATUS - err = eventhub.Status.AssignProperties_To_Namespaces_Eventhub_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhub_STATUS() to populate field Status") - } - destination.Status = status - - // No error - return nil -} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (eventhub *NamespacesEventhub) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: eventhub.Spec.OriginalVersion(), - Kind: "NamespacesEventhub", - } -} - -// +kubebuilder:object:root=true -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} -type NamespacesEventhubList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesEventhub `json:"items"` -} - -type Namespaces_Eventhub_Spec struct { - // +kubebuilder:validation:MaxLength=256 - // +kubebuilder:validation:MinLength=1 - // 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"` - - // CaptureDescription: Properties of capture description - CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"` - - // +kubebuilder:validation:Minimum=1 - // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days - MessageRetentionInDays *int `json:"messageRetentionInDays,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 eventhub.azure.com/Namespace resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` - - // +kubebuilder:validation:Minimum=1 - // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. - PartitionCount *int `json:"partitionCount,omitempty"` - - // RetentionDescription: Event Hub retention settings - RetentionDescription *RetentionDescription `json:"retentionDescription,omitempty"` -} - -var _ genruntime.ARMTransformer = &Namespaces_Eventhub_Spec{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (eventhub *Namespaces_Eventhub_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if eventhub == nil { - return nil, nil - } - result := &Namespaces_Eventhub_Spec_ARM{} - - // Set property "Name": - result.Name = resolved.Name - - // Set property "Properties": - if eventhub.CaptureDescription != nil || - eventhub.MessageRetentionInDays != nil || - eventhub.PartitionCount != nil || - eventhub.RetentionDescription != nil { - result.Properties = &Namespaces_Eventhub_Properties_Spec_ARM{} - } - if eventhub.CaptureDescription != nil { - captureDescription_ARM, err := (*eventhub.CaptureDescription).ConvertToARM(resolved) - if err != nil { - return nil, err - } - captureDescription := *captureDescription_ARM.(*CaptureDescription_ARM) - result.Properties.CaptureDescription = &captureDescription - } - if eventhub.MessageRetentionInDays != nil { - messageRetentionInDays := *eventhub.MessageRetentionInDays - result.Properties.MessageRetentionInDays = &messageRetentionInDays - } - if eventhub.PartitionCount != nil { - partitionCount := *eventhub.PartitionCount - result.Properties.PartitionCount = &partitionCount - } - if eventhub.RetentionDescription != nil { - retentionDescription_ARM, err := (*eventhub.RetentionDescription).ConvertToARM(resolved) - if err != nil { - return nil, err - } - retentionDescription := *retentionDescription_ARM.(*RetentionDescription_ARM) - result.Properties.RetentionDescription = &retentionDescription - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (eventhub *Namespaces_Eventhub_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_Eventhub_Spec_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (eventhub *Namespaces_Eventhub_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_Eventhub_Spec_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhub_Spec_ARM, got %T", armInput) - } - - // Set property "AzureName": - eventhub.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) - - // Set property "CaptureDescription": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.CaptureDescription != nil { - var captureDescription1 CaptureDescription - err := captureDescription1.PopulateFromARM(owner, *typedInput.Properties.CaptureDescription) - if err != nil { - return err - } - captureDescription := captureDescription1 - eventhub.CaptureDescription = &captureDescription - } - } - - // Set property "MessageRetentionInDays": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.MessageRetentionInDays != nil { - messageRetentionInDays := *typedInput.Properties.MessageRetentionInDays - eventhub.MessageRetentionInDays = &messageRetentionInDays - } - } - - // Set property "Owner": - eventhub.Owner = &genruntime.KnownResourceReference{ - Name: owner.Name, - ARMID: owner.ARMID, - } - - // Set property "PartitionCount": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.PartitionCount != nil { - partitionCount := *typedInput.Properties.PartitionCount - eventhub.PartitionCount = &partitionCount - } - } - - // Set property "RetentionDescription": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.RetentionDescription != nil { - var retentionDescription1 RetentionDescription - err := retentionDescription1.PopulateFromARM(owner, *typedInput.Properties.RetentionDescription) - if err != nil { - return err - } - retentionDescription := retentionDescription1 - eventhub.RetentionDescription = &retentionDescription - } - } - - // No error - return nil -} - -var _ genruntime.ConvertibleSpec = &Namespaces_Eventhub_Spec{} - -// ConvertSpecFrom populates our Namespaces_Eventhub_Spec from the provided source -func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_Eventhub_Spec) - if ok { - // Populate our instance from source - return eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhub_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") - } - - // Update our instance from src - err = eventhub.AssignProperties_From_Namespaces_Eventhub_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil -} - -// ConvertSpecTo populates the provided destination from our Namespaces_Eventhub_Spec -func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhub_Spec) - if ok { - // Populate destination from our instance - return eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhub_Spec{} - err := eventhub.AssignProperties_To_Namespaces_Eventhub_Spec(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 -} - -// AssignProperties_From_Namespaces_Eventhub_Spec populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_Spec -func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_From_Namespaces_Eventhub_Spec(source *v20240101s.Namespaces_Eventhub_Spec) error { - - // AzureName - eventhub.AzureName = source.AzureName - - // CaptureDescription - if source.CaptureDescription != nil { - var captureDescription CaptureDescription - err := captureDescription.AssignProperties_From_CaptureDescription(source.CaptureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription() to populate field CaptureDescription") - } - eventhub.CaptureDescription = &captureDescription - } else { - eventhub.CaptureDescription = nil - } - - // MessageRetentionInDays - if source.MessageRetentionInDays != nil { - messageRetentionInDay := *source.MessageRetentionInDays - eventhub.MessageRetentionInDays = &messageRetentionInDay - } else { - eventhub.MessageRetentionInDays = nil - } - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - eventhub.Owner = &owner - } else { - eventhub.Owner = nil - } - - // PartitionCount - if source.PartitionCount != nil { - partitionCount := *source.PartitionCount - eventhub.PartitionCount = &partitionCount - } else { - eventhub.PartitionCount = nil - } - - // RetentionDescription - if source.RetentionDescription != nil { - var retentionDescription RetentionDescription - err := retentionDescription.AssignProperties_From_RetentionDescription(source.RetentionDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_RetentionDescription() to populate field RetentionDescription") - } - eventhub.RetentionDescription = &retentionDescription - } else { - eventhub.RetentionDescription = nil - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhub_Spec populates the provided destination Namespaces_Eventhub_Spec from our Namespaces_Eventhub_Spec -func (eventhub *Namespaces_Eventhub_Spec) AssignProperties_To_Namespaces_Eventhub_Spec(destination *v20240101s.Namespaces_Eventhub_Spec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // AzureName - destination.AzureName = eventhub.AzureName - - // CaptureDescription - if eventhub.CaptureDescription != nil { - var captureDescription v20240101s.CaptureDescription - err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription(&captureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription() to populate field CaptureDescription") - } - destination.CaptureDescription = &captureDescription - } else { - destination.CaptureDescription = nil - } - - // MessageRetentionInDays - if eventhub.MessageRetentionInDays != nil { - messageRetentionInDay := *eventhub.MessageRetentionInDays - destination.MessageRetentionInDays = &messageRetentionInDay - } else { - destination.MessageRetentionInDays = nil - } - - // OriginalVersion - destination.OriginalVersion = eventhub.OriginalVersion() - - // Owner - if eventhub.Owner != nil { - owner := eventhub.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // PartitionCount - if eventhub.PartitionCount != nil { - partitionCount := *eventhub.PartitionCount - destination.PartitionCount = &partitionCount - } else { - destination.PartitionCount = nil - } - - // RetentionDescription - if eventhub.RetentionDescription != nil { - var retentionDescription v20240101s.RetentionDescription - err := eventhub.RetentionDescription.AssignProperties_To_RetentionDescription(&retentionDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_RetentionDescription() to populate field RetentionDescription") - } - destination.RetentionDescription = &retentionDescription - } else { - destination.RetentionDescription = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_Spec from the provided source Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_Spec) Initialize_From_Namespaces_Eventhub_STATUS(source *Namespaces_Eventhub_STATUS) error { - - // CaptureDescription - if source.CaptureDescription != nil { - var captureDescription CaptureDescription - err := captureDescription.Initialize_From_CaptureDescription_STATUS(source.CaptureDescription) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_CaptureDescription_STATUS() to populate field CaptureDescription") - } - eventhub.CaptureDescription = &captureDescription - } else { - eventhub.CaptureDescription = nil - } - - // MessageRetentionInDays - if source.MessageRetentionInDays != nil { - messageRetentionInDay := *source.MessageRetentionInDays - eventhub.MessageRetentionInDays = &messageRetentionInDay - } else { - eventhub.MessageRetentionInDays = nil - } - - // PartitionCount - if source.PartitionCount != nil { - partitionCount := *source.PartitionCount - eventhub.PartitionCount = &partitionCount - } else { - eventhub.PartitionCount = nil - } - - // RetentionDescription - if source.RetentionDescription != nil { - var retentionDescription RetentionDescription - err := retentionDescription.Initialize_From_RetentionDescription_STATUS(source.RetentionDescription) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_RetentionDescription_STATUS() to populate field RetentionDescription") - } - eventhub.RetentionDescription = &retentionDescription - } else { - eventhub.RetentionDescription = nil - } - - // No error - return nil -} - -// OriginalVersion returns the original API version used to create the resource. -func (eventhub *Namespaces_Eventhub_Spec) OriginalVersion() string { - return GroupVersion.Version -} - -// SetAzureName sets the Azure name of the resource -func (eventhub *Namespaces_Eventhub_Spec) SetAzureName(azureName string) { - eventhub.AzureName = azureName -} - -type Namespaces_Eventhub_STATUS struct { - // CaptureDescription: Properties of capture description - CaptureDescription *CaptureDescription_STATUS `json:"captureDescription,omitempty"` - - // Conditions: The observed state of the resource - Conditions []conditions.Condition `json:"conditions,omitempty"` - - // CreatedAt: Exact time the Event Hub was created. - CreatedAt *string `json:"createdAt,omitempty"` - - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // MessageRetentionInDays: Number of days to retain the events for this Event Hub, value should be 1 to 7 days - MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // PartitionCount: Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. - PartitionCount *int `json:"partitionCount,omitempty"` - - // PartitionIds: Current number of shards on the Event Hub. - PartitionIds []string `json:"partitionIds,omitempty"` - - // RetentionDescription: Event Hub retention settings - RetentionDescription *RetentionDescription_STATUS `json:"retentionDescription,omitempty"` - - // Status: Enumerates the possible values for the status of the Event Hub. - Status *Namespaces_Eventhub_Properties_Status_STATUS `json:"status,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` - - // UpdatedAt: The exact time the message was updated. - UpdatedAt *string `json:"updatedAt,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_Eventhub_STATUS{} - -// ConvertStatusFrom populates our Namespaces_Eventhub_STATUS from the provided source -func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_Eventhub_STATUS) - if ok { - // Populate our instance from source - return eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhub_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") - } - - // Update our instance from src - err = eventhub.AssignProperties_From_Namespaces_Eventhub_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil -} - -// ConvertStatusTo populates the provided destination from our Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhub_STATUS) - if ok { - // Populate destination from our instance - return eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhub_STATUS{} - err := eventhub.AssignProperties_To_Namespaces_Eventhub_STATUS(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 = &Namespaces_Eventhub_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (eventhub *Namespaces_Eventhub_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_Eventhub_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (eventhub *Namespaces_Eventhub_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_Eventhub_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhub_STATUS_ARM, got %T", armInput) - } - - // Set property "CaptureDescription": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.CaptureDescription != nil { - var captureDescription1 CaptureDescription_STATUS - err := captureDescription1.PopulateFromARM(owner, *typedInput.Properties.CaptureDescription) - if err != nil { - return err - } - captureDescription := captureDescription1 - eventhub.CaptureDescription = &captureDescription - } - } - - // no assignment for property "Conditions" - - // Set property "CreatedAt": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.CreatedAt != nil { - createdAt := *typedInput.Properties.CreatedAt - eventhub.CreatedAt = &createdAt - } - } - - // Set property "Id": - if typedInput.Id != nil { - id := *typedInput.Id - eventhub.Id = &id - } - - // Set property "Location": - if typedInput.Location != nil { - location := *typedInput.Location - eventhub.Location = &location - } - - // Set property "MessageRetentionInDays": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.MessageRetentionInDays != nil { - messageRetentionInDays := *typedInput.Properties.MessageRetentionInDays - eventhub.MessageRetentionInDays = &messageRetentionInDays - } - } - - // Set property "Name": - if typedInput.Name != nil { - name := *typedInput.Name - eventhub.Name = &name - } - - // Set property "PartitionCount": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.PartitionCount != nil { - partitionCount := *typedInput.Properties.PartitionCount - eventhub.PartitionCount = &partitionCount - } - } - - // Set property "PartitionIds": - // copying flattened property: - if typedInput.Properties != nil { - for _, item := range typedInput.Properties.PartitionIds { - eventhub.PartitionIds = append(eventhub.PartitionIds, item) - } - } - - // Set property "RetentionDescription": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.RetentionDescription != nil { - var retentionDescription1 RetentionDescription_STATUS - err := retentionDescription1.PopulateFromARM(owner, *typedInput.Properties.RetentionDescription) - if err != nil { - return err - } - retentionDescription := retentionDescription1 - eventhub.RetentionDescription = &retentionDescription - } - } - - // Set property "Status": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.Status != nil { - status := *typedInput.Properties.Status - eventhub.Status = &status - } - } - - // Set property "SystemData": - if typedInput.SystemData != nil { - var systemData1 SystemData_STATUS - err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) - if err != nil { - return err - } - systemData := systemData1 - eventhub.SystemData = &systemData - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - eventhub.Type = &typeVar - } - - // Set property "UpdatedAt": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.UpdatedAt != nil { - updatedAt := *typedInput.Properties.UpdatedAt - eventhub.UpdatedAt = &updatedAt - } - } - - // No error - return nil -} - -// AssignProperties_From_Namespaces_Eventhub_STATUS populates our Namespaces_Eventhub_STATUS from the provided source Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_From_Namespaces_Eventhub_STATUS(source *v20240101s.Namespaces_Eventhub_STATUS) error { - - // CaptureDescription - if source.CaptureDescription != nil { - var captureDescription CaptureDescription_STATUS - err := captureDescription.AssignProperties_From_CaptureDescription_STATUS(source.CaptureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_CaptureDescription_STATUS() to populate field CaptureDescription") - } - eventhub.CaptureDescription = &captureDescription - } else { - eventhub.CaptureDescription = nil - } - - // Conditions - eventhub.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // CreatedAt - eventhub.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) - - // Id - eventhub.Id = genruntime.ClonePointerToString(source.Id) - - // Location - eventhub.Location = genruntime.ClonePointerToString(source.Location) - - // MessageRetentionInDays - eventhub.MessageRetentionInDays = genruntime.ClonePointerToInt(source.MessageRetentionInDays) - - // Name - eventhub.Name = genruntime.ClonePointerToString(source.Name) - - // PartitionCount - eventhub.PartitionCount = genruntime.ClonePointerToInt(source.PartitionCount) - - // PartitionIds - eventhub.PartitionIds = genruntime.CloneSliceOfString(source.PartitionIds) - - // RetentionDescription - if source.RetentionDescription != nil { - var retentionDescription RetentionDescription_STATUS - err := retentionDescription.AssignProperties_From_RetentionDescription_STATUS(source.RetentionDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_RetentionDescription_STATUS() to populate field RetentionDescription") - } - eventhub.RetentionDescription = &retentionDescription - } else { - eventhub.RetentionDescription = nil - } - - // Status - if source.Status != nil { - status := Namespaces_Eventhub_Properties_Status_STATUS(*source.Status) - eventhub.Status = &status - } else { - eventhub.Status = nil - } - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - eventhub.SystemData = &systemDatum - } else { - eventhub.SystemData = nil - } - - // Type - eventhub.Type = genruntime.ClonePointerToString(source.Type) - - // UpdatedAt - eventhub.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhub_STATUS populates the provided destination Namespaces_Eventhub_STATUS from our Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_STATUS) AssignProperties_To_Namespaces_Eventhub_STATUS(destination *v20240101s.Namespaces_Eventhub_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // CaptureDescription - if eventhub.CaptureDescription != nil { - var captureDescription v20240101s.CaptureDescription_STATUS - err := eventhub.CaptureDescription.AssignProperties_To_CaptureDescription_STATUS(&captureDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_CaptureDescription_STATUS() to populate field CaptureDescription") - } - destination.CaptureDescription = &captureDescription - } else { - destination.CaptureDescription = nil - } - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(eventhub.Conditions) - - // CreatedAt - destination.CreatedAt = genruntime.ClonePointerToString(eventhub.CreatedAt) - - // Id - destination.Id = genruntime.ClonePointerToString(eventhub.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(eventhub.Location) - - // MessageRetentionInDays - destination.MessageRetentionInDays = genruntime.ClonePointerToInt(eventhub.MessageRetentionInDays) - - // Name - destination.Name = genruntime.ClonePointerToString(eventhub.Name) - - // PartitionCount - destination.PartitionCount = genruntime.ClonePointerToInt(eventhub.PartitionCount) - - // PartitionIds - destination.PartitionIds = genruntime.CloneSliceOfString(eventhub.PartitionIds) - - // RetentionDescription - if eventhub.RetentionDescription != nil { - var retentionDescription v20240101s.RetentionDescription_STATUS - err := eventhub.RetentionDescription.AssignProperties_To_RetentionDescription_STATUS(&retentionDescription) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_RetentionDescription_STATUS() to populate field RetentionDescription") - } - destination.RetentionDescription = &retentionDescription - } else { - destination.RetentionDescription = nil - } - - // Status - if eventhub.Status != nil { - status := string(*eventhub.Status) - destination.Status = &status - } else { - destination.Status = nil - } - - // SystemData - if eventhub.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := eventhub.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(eventhub.Type) - - // UpdatedAt - destination.UpdatedAt = genruntime.ClonePointerToString(eventhub.UpdatedAt) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Properties to configure capture description for eventhub -type CaptureDescription struct { - // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) - Destination *Destination `json:"destination,omitempty"` - - // Enabled: A value that indicates whether capture description is enabled. - Enabled *bool `json:"enabled,omitempty"` - - // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be - // deprecated in New API Version - Encoding *CaptureDescription_Encoding `json:"encoding,omitempty"` - - // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, - // value should between 60 to 900 seconds - IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` - - // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, - // value should be between 10485760 to 524288000 bytes - SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` - - // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives - SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` -} - -var _ genruntime.ARMTransformer = &CaptureDescription{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (description *CaptureDescription) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if description == nil { - return nil, nil - } - result := &CaptureDescription_ARM{} - - // Set property "Destination": - if description.Destination != nil { - destination_ARM, err := (*description.Destination).ConvertToARM(resolved) - if err != nil { - return nil, err - } - destination := *destination_ARM.(*Destination_ARM) - result.Destination = &destination - } - - // Set property "Enabled": - if description.Enabled != nil { - enabled := *description.Enabled - result.Enabled = &enabled - } - - // Set property "Encoding": - if description.Encoding != nil { - encoding := *description.Encoding - result.Encoding = &encoding - } - - // Set property "IntervalInSeconds": - if description.IntervalInSeconds != nil { - intervalInSeconds := *description.IntervalInSeconds - result.IntervalInSeconds = &intervalInSeconds - } - - // Set property "SizeLimitInBytes": - if description.SizeLimitInBytes != nil { - sizeLimitInBytes := *description.SizeLimitInBytes - result.SizeLimitInBytes = &sizeLimitInBytes - } - - // Set property "SkipEmptyArchives": - if description.SkipEmptyArchives != nil { - skipEmptyArchives := *description.SkipEmptyArchives - result.SkipEmptyArchives = &skipEmptyArchives - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (description *CaptureDescription) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &CaptureDescription_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (description *CaptureDescription) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(CaptureDescription_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureDescription_ARM, got %T", armInput) - } - - // Set property "Destination": - if typedInput.Destination != nil { - var destination1 Destination - err := destination1.PopulateFromARM(owner, *typedInput.Destination) - if err != nil { - return err - } - destination := destination1 - description.Destination = &destination - } - - // Set property "Enabled": - if typedInput.Enabled != nil { - enabled := *typedInput.Enabled - description.Enabled = &enabled - } - - // Set property "Encoding": - if typedInput.Encoding != nil { - encoding := *typedInput.Encoding - description.Encoding = &encoding - } - - // Set property "IntervalInSeconds": - if typedInput.IntervalInSeconds != nil { - intervalInSeconds := *typedInput.IntervalInSeconds - description.IntervalInSeconds = &intervalInSeconds - } - - // Set property "SizeLimitInBytes": - if typedInput.SizeLimitInBytes != nil { - sizeLimitInBytes := *typedInput.SizeLimitInBytes - description.SizeLimitInBytes = &sizeLimitInBytes - } - - // Set property "SkipEmptyArchives": - if typedInput.SkipEmptyArchives != nil { - skipEmptyArchives := *typedInput.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchives - } - - // No error - return nil -} - -// AssignProperties_From_CaptureDescription populates our CaptureDescription from the provided source CaptureDescription -func (description *CaptureDescription) AssignProperties_From_CaptureDescription(source *v20240101s.CaptureDescription) error { - - // Destination - if source.Destination != nil { - var destination Destination - err := destination.AssignProperties_From_Destination(source.Destination) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Destination() to populate field Destination") - } - description.Destination = &destination - } else { - description.Destination = nil - } - - // Enabled - if source.Enabled != nil { - enabled := *source.Enabled - description.Enabled = &enabled - } else { - description.Enabled = nil - } - - // Encoding - if source.Encoding != nil { - encoding := CaptureDescription_Encoding(*source.Encoding) - description.Encoding = &encoding - } else { - description.Encoding = nil - } - - // IntervalInSeconds - description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) - - // SizeLimitInBytes - description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) - - // SkipEmptyArchives - if source.SkipEmptyArchives != nil { - skipEmptyArchive := *source.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchive - } else { - description.SkipEmptyArchives = nil - } - - // No error - return nil -} - -// AssignProperties_To_CaptureDescription populates the provided destination CaptureDescription from our CaptureDescription -func (description *CaptureDescription) AssignProperties_To_CaptureDescription(destination *v20240101s.CaptureDescription) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Destination - if description.Destination != nil { - var destinationLocal v20240101s.Destination - err := description.Destination.AssignProperties_To_Destination(&destinationLocal) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Destination() to populate field Destination") - } - destination.Destination = &destinationLocal - } else { - destination.Destination = nil - } - - // Enabled - if description.Enabled != nil { - enabled := *description.Enabled - destination.Enabled = &enabled - } else { - destination.Enabled = nil - } - - // Encoding - if description.Encoding != nil { - encoding := string(*description.Encoding) - destination.Encoding = &encoding - } else { - destination.Encoding = nil - } - - // IntervalInSeconds - destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) - - // SizeLimitInBytes - destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) - - // SkipEmptyArchives - if description.SkipEmptyArchives != nil { - skipEmptyArchive := *description.SkipEmptyArchives - destination.SkipEmptyArchives = &skipEmptyArchive - } else { - destination.SkipEmptyArchives = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_CaptureDescription_STATUS populates our CaptureDescription from the provided source CaptureDescription_STATUS -func (description *CaptureDescription) Initialize_From_CaptureDescription_STATUS(source *CaptureDescription_STATUS) error { - - // Destination - if source.Destination != nil { - var destination Destination - err := destination.Initialize_From_Destination_STATUS(source.Destination) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Destination_STATUS() to populate field Destination") - } - description.Destination = &destination - } else { - description.Destination = nil - } - - // Enabled - if source.Enabled != nil { - enabled := *source.Enabled - description.Enabled = &enabled - } else { - description.Enabled = nil - } - - // Encoding - if source.Encoding != nil { - encoding := CaptureDescription_Encoding(*source.Encoding) - description.Encoding = &encoding - } else { - description.Encoding = nil - } - - // IntervalInSeconds - description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) - - // SizeLimitInBytes - description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) - - // SkipEmptyArchives - if source.SkipEmptyArchives != nil { - skipEmptyArchive := *source.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchive - } else { - description.SkipEmptyArchives = nil - } - - // No error - return nil -} - -// Properties to configure capture description for eventhub -type CaptureDescription_STATUS struct { - // Destination: Properties of Destination where capture will be stored. (Storage Account, Blob Names) - Destination *Destination_STATUS `json:"destination,omitempty"` - - // Enabled: A value that indicates whether capture description is enabled. - Enabled *bool `json:"enabled,omitempty"` - - // Encoding: Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be - // deprecated in New API Version - Encoding *CaptureDescription_Encoding_STATUS `json:"encoding,omitempty"` - - // IntervalInSeconds: The time window allows you to set the frequency with which the capture to Azure Blobs will happen, - // value should between 60 to 900 seconds - IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` - - // SizeLimitInBytes: The size window defines the amount of data built up in your Event Hub before an capture operation, - // value should be between 10485760 to 524288000 bytes - SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` - - // SkipEmptyArchives: A value that indicates whether to Skip Empty Archives - SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` -} - -var _ genruntime.FromARMConverter = &CaptureDescription_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (description *CaptureDescription_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &CaptureDescription_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (description *CaptureDescription_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(CaptureDescription_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureDescription_STATUS_ARM, got %T", armInput) - } - - // Set property "Destination": - if typedInput.Destination != nil { - var destination1 Destination_STATUS - err := destination1.PopulateFromARM(owner, *typedInput.Destination) - if err != nil { - return err - } - destination := destination1 - description.Destination = &destination - } - - // Set property "Enabled": - if typedInput.Enabled != nil { - enabled := *typedInput.Enabled - description.Enabled = &enabled - } - - // Set property "Encoding": - if typedInput.Encoding != nil { - encoding := *typedInput.Encoding - description.Encoding = &encoding - } - - // Set property "IntervalInSeconds": - if typedInput.IntervalInSeconds != nil { - intervalInSeconds := *typedInput.IntervalInSeconds - description.IntervalInSeconds = &intervalInSeconds - } - - // Set property "SizeLimitInBytes": - if typedInput.SizeLimitInBytes != nil { - sizeLimitInBytes := *typedInput.SizeLimitInBytes - description.SizeLimitInBytes = &sizeLimitInBytes - } - - // Set property "SkipEmptyArchives": - if typedInput.SkipEmptyArchives != nil { - skipEmptyArchives := *typedInput.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchives - } - - // No error - return nil -} - -// AssignProperties_From_CaptureDescription_STATUS populates our CaptureDescription_STATUS from the provided source CaptureDescription_STATUS -func (description *CaptureDescription_STATUS) AssignProperties_From_CaptureDescription_STATUS(source *v20240101s.CaptureDescription_STATUS) error { - - // Destination - if source.Destination != nil { - var destination Destination_STATUS - err := destination.AssignProperties_From_Destination_STATUS(source.Destination) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Destination_STATUS() to populate field Destination") - } - description.Destination = &destination - } else { - description.Destination = nil - } - - // Enabled - if source.Enabled != nil { - enabled := *source.Enabled - description.Enabled = &enabled - } else { - description.Enabled = nil - } - - // Encoding - if source.Encoding != nil { - encoding := CaptureDescription_Encoding_STATUS(*source.Encoding) - description.Encoding = &encoding - } else { - description.Encoding = nil - } - - // IntervalInSeconds - description.IntervalInSeconds = genruntime.ClonePointerToInt(source.IntervalInSeconds) - - // SizeLimitInBytes - description.SizeLimitInBytes = genruntime.ClonePointerToInt(source.SizeLimitInBytes) - - // SkipEmptyArchives - if source.SkipEmptyArchives != nil { - skipEmptyArchive := *source.SkipEmptyArchives - description.SkipEmptyArchives = &skipEmptyArchive - } else { - description.SkipEmptyArchives = nil - } - - // No error - return nil -} - -// AssignProperties_To_CaptureDescription_STATUS populates the provided destination CaptureDescription_STATUS from our CaptureDescription_STATUS -func (description *CaptureDescription_STATUS) AssignProperties_To_CaptureDescription_STATUS(destination *v20240101s.CaptureDescription_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Destination - if description.Destination != nil { - var destinationLocal v20240101s.Destination_STATUS - err := description.Destination.AssignProperties_To_Destination_STATUS(&destinationLocal) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Destination_STATUS() to populate field Destination") - } - destination.Destination = &destinationLocal - } else { - destination.Destination = nil - } - - // Enabled - if description.Enabled != nil { - enabled := *description.Enabled - destination.Enabled = &enabled - } else { - destination.Enabled = nil - } - - // Encoding - if description.Encoding != nil { - encoding := string(*description.Encoding) - destination.Encoding = &encoding - } else { - destination.Encoding = nil - } - - // IntervalInSeconds - destination.IntervalInSeconds = genruntime.ClonePointerToInt(description.IntervalInSeconds) - - // SizeLimitInBytes - destination.SizeLimitInBytes = genruntime.ClonePointerToInt(description.SizeLimitInBytes) - - // SkipEmptyArchives - if description.SkipEmptyArchives != nil { - skipEmptyArchive := *description.SkipEmptyArchives - destination.SkipEmptyArchives = &skipEmptyArchive - } else { - destination.SkipEmptyArchives = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -type Namespaces_Eventhub_Properties_Status_STATUS string - -const ( - Namespaces_Eventhub_Properties_Status_STATUS_Active = Namespaces_Eventhub_Properties_Status_STATUS("Active") - Namespaces_Eventhub_Properties_Status_STATUS_Creating = Namespaces_Eventhub_Properties_Status_STATUS("Creating") - Namespaces_Eventhub_Properties_Status_STATUS_Deleting = Namespaces_Eventhub_Properties_Status_STATUS("Deleting") - Namespaces_Eventhub_Properties_Status_STATUS_Disabled = Namespaces_Eventhub_Properties_Status_STATUS("Disabled") - Namespaces_Eventhub_Properties_Status_STATUS_ReceiveDisabled = Namespaces_Eventhub_Properties_Status_STATUS("ReceiveDisabled") - Namespaces_Eventhub_Properties_Status_STATUS_Renaming = Namespaces_Eventhub_Properties_Status_STATUS("Renaming") - Namespaces_Eventhub_Properties_Status_STATUS_Restoring = Namespaces_Eventhub_Properties_Status_STATUS("Restoring") - Namespaces_Eventhub_Properties_Status_STATUS_SendDisabled = Namespaces_Eventhub_Properties_Status_STATUS("SendDisabled") - Namespaces_Eventhub_Properties_Status_STATUS_Unknown = Namespaces_Eventhub_Properties_Status_STATUS("Unknown") -) - -// Properties to configure retention settings for the eventhub -type RetentionDescription struct { - // CleanupPolicy: Enumerates the possible values for cleanup policy - CleanupPolicy *RetentionDescription_CleanupPolicy `json:"cleanupPolicy,omitempty"` - - // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when - // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue - RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` - - // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is - // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified - // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key - // described by the tombstone marker within the compacted Event Hub - TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` -} - -var _ genruntime.ARMTransformer = &RetentionDescription{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (description *RetentionDescription) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if description == nil { - return nil, nil - } - result := &RetentionDescription_ARM{} - - // Set property "CleanupPolicy": - if description.CleanupPolicy != nil { - cleanupPolicy := *description.CleanupPolicy - result.CleanupPolicy = &cleanupPolicy - } - - // Set property "RetentionTimeInHours": - if description.RetentionTimeInHours != nil { - retentionTimeInHours := *description.RetentionTimeInHours - result.RetentionTimeInHours = &retentionTimeInHours - } - - // Set property "TombstoneRetentionTimeInHours": - if description.TombstoneRetentionTimeInHours != nil { - tombstoneRetentionTimeInHours := *description.TombstoneRetentionTimeInHours - result.TombstoneRetentionTimeInHours = &tombstoneRetentionTimeInHours - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (description *RetentionDescription) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &RetentionDescription_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (description *RetentionDescription) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(RetentionDescription_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected RetentionDescription_ARM, got %T", armInput) - } - - // Set property "CleanupPolicy": - if typedInput.CleanupPolicy != nil { - cleanupPolicy := *typedInput.CleanupPolicy - description.CleanupPolicy = &cleanupPolicy - } - - // Set property "RetentionTimeInHours": - if typedInput.RetentionTimeInHours != nil { - retentionTimeInHours := *typedInput.RetentionTimeInHours - description.RetentionTimeInHours = &retentionTimeInHours - } - - // Set property "TombstoneRetentionTimeInHours": - if typedInput.TombstoneRetentionTimeInHours != nil { - tombstoneRetentionTimeInHours := *typedInput.TombstoneRetentionTimeInHours - description.TombstoneRetentionTimeInHours = &tombstoneRetentionTimeInHours - } - - // No error - return nil -} - -// AssignProperties_From_RetentionDescription populates our RetentionDescription from the provided source RetentionDescription -func (description *RetentionDescription) AssignProperties_From_RetentionDescription(source *v20240101s.RetentionDescription) error { - - // CleanupPolicy - if source.CleanupPolicy != nil { - cleanupPolicy := RetentionDescription_CleanupPolicy(*source.CleanupPolicy) - description.CleanupPolicy = &cleanupPolicy - } else { - description.CleanupPolicy = nil - } - - // RetentionTimeInHours - description.RetentionTimeInHours = genruntime.ClonePointerToInt(source.RetentionTimeInHours) - - // TombstoneRetentionTimeInHours - description.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(source.TombstoneRetentionTimeInHours) - - // No error - return nil -} - -// AssignProperties_To_RetentionDescription populates the provided destination RetentionDescription from our RetentionDescription -func (description *RetentionDescription) AssignProperties_To_RetentionDescription(destination *v20240101s.RetentionDescription) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // CleanupPolicy - if description.CleanupPolicy != nil { - cleanupPolicy := string(*description.CleanupPolicy) - destination.CleanupPolicy = &cleanupPolicy - } else { - destination.CleanupPolicy = nil - } - - // RetentionTimeInHours - destination.RetentionTimeInHours = genruntime.ClonePointerToInt(description.RetentionTimeInHours) - - // TombstoneRetentionTimeInHours - destination.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(description.TombstoneRetentionTimeInHours) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_RetentionDescription_STATUS populates our RetentionDescription from the provided source RetentionDescription_STATUS -func (description *RetentionDescription) Initialize_From_RetentionDescription_STATUS(source *RetentionDescription_STATUS) error { - - // CleanupPolicy - if source.CleanupPolicy != nil { - cleanupPolicy := RetentionDescription_CleanupPolicy(*source.CleanupPolicy) - description.CleanupPolicy = &cleanupPolicy - } else { - description.CleanupPolicy = nil - } - - // RetentionTimeInHours - description.RetentionTimeInHours = genruntime.ClonePointerToInt(source.RetentionTimeInHours) - - // TombstoneRetentionTimeInHours - description.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(source.TombstoneRetentionTimeInHours) - - // No error - return nil -} - -// Properties to configure retention settings for the eventhub -type RetentionDescription_STATUS struct { - // CleanupPolicy: Enumerates the possible values for cleanup policy - CleanupPolicy *RetentionDescription_CleanupPolicy_STATUS `json:"cleanupPolicy,omitempty"` - - // RetentionTimeInHours: Number of hours to retain the events for this Event Hub. This value is only used when - // cleanupPolicy is Delete. If cleanupPolicy is Compact the returned value of this property is Long.MaxValue - RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` - - // TombstoneRetentionTimeInHours: Number of hours to retain the tombstone markers of a compacted Event Hub. This value is - // only used when cleanupPolicy is Compact. Consumer must complete reading the tombstone marker within this specified - // amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key - // described by the tombstone marker within the compacted Event Hub - TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` -} - -var _ genruntime.FromARMConverter = &RetentionDescription_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (description *RetentionDescription_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &RetentionDescription_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (description *RetentionDescription_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(RetentionDescription_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected RetentionDescription_STATUS_ARM, got %T", armInput) - } - - // Set property "CleanupPolicy": - if typedInput.CleanupPolicy != nil { - cleanupPolicy := *typedInput.CleanupPolicy - description.CleanupPolicy = &cleanupPolicy - } - - // Set property "RetentionTimeInHours": - if typedInput.RetentionTimeInHours != nil { - retentionTimeInHours := *typedInput.RetentionTimeInHours - description.RetentionTimeInHours = &retentionTimeInHours - } - - // Set property "TombstoneRetentionTimeInHours": - if typedInput.TombstoneRetentionTimeInHours != nil { - tombstoneRetentionTimeInHours := *typedInput.TombstoneRetentionTimeInHours - description.TombstoneRetentionTimeInHours = &tombstoneRetentionTimeInHours - } - - // No error - return nil -} - -// AssignProperties_From_RetentionDescription_STATUS populates our RetentionDescription_STATUS from the provided source RetentionDescription_STATUS -func (description *RetentionDescription_STATUS) AssignProperties_From_RetentionDescription_STATUS(source *v20240101s.RetentionDescription_STATUS) error { - - // CleanupPolicy - if source.CleanupPolicy != nil { - cleanupPolicy := RetentionDescription_CleanupPolicy_STATUS(*source.CleanupPolicy) - description.CleanupPolicy = &cleanupPolicy - } else { - description.CleanupPolicy = nil - } - - // RetentionTimeInHours - description.RetentionTimeInHours = genruntime.ClonePointerToInt(source.RetentionTimeInHours) - - // TombstoneRetentionTimeInHours - description.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(source.TombstoneRetentionTimeInHours) - - // No error - return nil -} - -// AssignProperties_To_RetentionDescription_STATUS populates the provided destination RetentionDescription_STATUS from our RetentionDescription_STATUS -func (description *RetentionDescription_STATUS) AssignProperties_To_RetentionDescription_STATUS(destination *v20240101s.RetentionDescription_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // CleanupPolicy - if description.CleanupPolicy != nil { - cleanupPolicy := string(*description.CleanupPolicy) - destination.CleanupPolicy = &cleanupPolicy - } else { - destination.CleanupPolicy = nil - } - - // RetentionTimeInHours - destination.RetentionTimeInHours = genruntime.ClonePointerToInt(description.RetentionTimeInHours) - - // TombstoneRetentionTimeInHours - destination.TombstoneRetentionTimeInHours = genruntime.ClonePointerToInt(description.TombstoneRetentionTimeInHours) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// +kubebuilder:validation:Enum={"Avro","AvroDeflate"} -type CaptureDescription_Encoding string - -const ( - CaptureDescription_Encoding_Avro = CaptureDescription_Encoding("Avro") - CaptureDescription_Encoding_AvroDeflate = CaptureDescription_Encoding("AvroDeflate") -) - -type CaptureDescription_Encoding_STATUS string - -const ( - CaptureDescription_Encoding_STATUS_Avro = CaptureDescription_Encoding_STATUS("Avro") - CaptureDescription_Encoding_STATUS_AvroDeflate = CaptureDescription_Encoding_STATUS("AvroDeflate") -) - -// Capture storage details for capture description -type Destination struct { - // ArchiveNameFormat: Blob naming convention for archive, e.g. - // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - // (Namespace,EventHub .. etc) are mandatory irrespective of order - ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` - - // BlobContainer: Blob container Name - BlobContainer *string `json:"blobContainer,omitempty"` - - // DataLakeAccountName: The Azure Data Lake Store name for the captured events - DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` - - // DataLakeFolderPath: The destination folder path for the captured events - DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` - - // +kubebuilder:validation:Pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$" - // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store - DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` - - // Identity: A value that indicates whether capture description is enabled. - Identity *CaptureIdentity `json:"identity,omitempty"` - - // Name: Name for capture destination - Name *string `json:"name,omitempty"` - - // StorageAccountResourceReference: Resource id of the storage account to be used to create the blobs - StorageAccountResourceReference *genruntime.ResourceReference `armReference:"StorageAccountResourceId" json:"storageAccountResourceReference,omitempty"` -} - -var _ genruntime.ARMTransformer = &Destination{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (destination *Destination) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if destination == nil { - return nil, nil - } - result := &Destination_ARM{} - - // Set property "Identity": - if destination.Identity != nil { - identity_ARM, err := (*destination.Identity).ConvertToARM(resolved) - if err != nil { - return nil, err - } - identity := *identity_ARM.(*CaptureIdentity_ARM) - result.Identity = &identity - } - - // Set property "Name": - if destination.Name != nil { - name := *destination.Name - result.Name = &name - } - - // Set property "Properties": - if destination.ArchiveNameFormat != nil || - destination.BlobContainer != nil || - destination.DataLakeAccountName != nil || - destination.DataLakeFolderPath != nil || - destination.DataLakeSubscriptionId != nil || - destination.StorageAccountResourceReference != nil { - result.Properties = &Destination_Properties_ARM{} - } - if destination.ArchiveNameFormat != nil { - archiveNameFormat := *destination.ArchiveNameFormat - result.Properties.ArchiveNameFormat = &archiveNameFormat - } - if destination.BlobContainer != nil { - blobContainer := *destination.BlobContainer - result.Properties.BlobContainer = &blobContainer - } - if destination.DataLakeAccountName != nil { - dataLakeAccountName := *destination.DataLakeAccountName - result.Properties.DataLakeAccountName = &dataLakeAccountName - } - if destination.DataLakeFolderPath != nil { - dataLakeFolderPath := *destination.DataLakeFolderPath - result.Properties.DataLakeFolderPath = &dataLakeFolderPath - } - if destination.DataLakeSubscriptionId != nil { - dataLakeSubscriptionId := *destination.DataLakeSubscriptionId - result.Properties.DataLakeSubscriptionId = &dataLakeSubscriptionId - } - if destination.StorageAccountResourceReference != nil { - storageAccountResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*destination.StorageAccountResourceReference) - if err != nil { - return nil, err - } - storageAccountResourceId := storageAccountResourceIdARMID - result.Properties.StorageAccountResourceId = &storageAccountResourceId - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (destination *Destination) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Destination_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (destination *Destination) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Destination_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Destination_ARM, got %T", armInput) - } - - // Set property "ArchiveNameFormat": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.ArchiveNameFormat != nil { - archiveNameFormat := *typedInput.Properties.ArchiveNameFormat - destination.ArchiveNameFormat = &archiveNameFormat - } - } - - // Set property "BlobContainer": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.BlobContainer != nil { - blobContainer := *typedInput.Properties.BlobContainer - destination.BlobContainer = &blobContainer - } - } - - // Set property "DataLakeAccountName": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DataLakeAccountName != nil { - dataLakeAccountName := *typedInput.Properties.DataLakeAccountName - destination.DataLakeAccountName = &dataLakeAccountName - } - } - - // Set property "DataLakeFolderPath": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DataLakeFolderPath != nil { - dataLakeFolderPath := *typedInput.Properties.DataLakeFolderPath - destination.DataLakeFolderPath = &dataLakeFolderPath - } - } - - // Set property "DataLakeSubscriptionId": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DataLakeSubscriptionId != nil { - dataLakeSubscriptionId := *typedInput.Properties.DataLakeSubscriptionId - destination.DataLakeSubscriptionId = &dataLakeSubscriptionId - } - } - - // Set property "Identity": - if typedInput.Identity != nil { - var identity1 CaptureIdentity - err := identity1.PopulateFromARM(owner, *typedInput.Identity) - if err != nil { - return err - } - identity := identity1 - destination.Identity = &identity - } - - // Set property "Name": - if typedInput.Name != nil { - name := *typedInput.Name - destination.Name = &name - } - - // no assignment for property "StorageAccountResourceReference" - - // No error - return nil -} - -// AssignProperties_From_Destination populates our Destination from the provided source Destination -func (destination *Destination) AssignProperties_From_Destination(source *v20240101s.Destination) error { - - // ArchiveNameFormat - destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) - - // BlobContainer - destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) - - // DataLakeAccountName - destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) - - // DataLakeFolderPath - destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) - - // DataLakeSubscriptionId - if source.DataLakeSubscriptionId != nil { - dataLakeSubscriptionId := *source.DataLakeSubscriptionId - destination.DataLakeSubscriptionId = &dataLakeSubscriptionId - } else { - destination.DataLakeSubscriptionId = nil - } - - // Identity - if source.Identity != nil { - var identity CaptureIdentity - err := identity.AssignProperties_From_CaptureIdentity(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_CaptureIdentity() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // Name - destination.Name = genruntime.ClonePointerToString(source.Name) - - // StorageAccountResourceReference - if source.StorageAccountResourceReference != nil { - storageAccountResourceReference := source.StorageAccountResourceReference.Copy() - destination.StorageAccountResourceReference = &storageAccountResourceReference - } else { - destination.StorageAccountResourceReference = nil - } - - // No error - return nil -} - -// AssignProperties_To_Destination populates the provided destination Destination from our Destination -func (destination *Destination) AssignProperties_To_Destination(target *v20240101s.Destination) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // ArchiveNameFormat - target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) - - // BlobContainer - target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) - - // DataLakeAccountName - target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) - - // DataLakeFolderPath - target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) - - // DataLakeSubscriptionId - if destination.DataLakeSubscriptionId != nil { - dataLakeSubscriptionId := *destination.DataLakeSubscriptionId - target.DataLakeSubscriptionId = &dataLakeSubscriptionId - } else { - target.DataLakeSubscriptionId = nil - } - - // Identity - if destination.Identity != nil { - var identity v20240101s.CaptureIdentity - err := destination.Identity.AssignProperties_To_CaptureIdentity(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_CaptureIdentity() to populate field Identity") - } - target.Identity = &identity - } else { - target.Identity = nil - } - - // Name - target.Name = genruntime.ClonePointerToString(destination.Name) - - // StorageAccountResourceReference - if destination.StorageAccountResourceReference != nil { - storageAccountResourceReference := destination.StorageAccountResourceReference.Copy() - target.StorageAccountResourceReference = &storageAccountResourceReference - } else { - target.StorageAccountResourceReference = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - target.PropertyBag = propertyBag - } else { - target.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Destination_STATUS populates our Destination from the provided source Destination_STATUS -func (destination *Destination) Initialize_From_Destination_STATUS(source *Destination_STATUS) error { - - // ArchiveNameFormat - destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) - - // BlobContainer - destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) - - // DataLakeAccountName - destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) - - // DataLakeFolderPath - destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) - - // DataLakeSubscriptionId - if source.DataLakeSubscriptionId != nil { - dataLakeSubscriptionId := *source.DataLakeSubscriptionId - destination.DataLakeSubscriptionId = &dataLakeSubscriptionId - } else { - destination.DataLakeSubscriptionId = nil - } - - // Identity - if source.Identity != nil { - var identity CaptureIdentity - err := identity.Initialize_From_CaptureIdentity_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_CaptureIdentity_STATUS() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // Name - destination.Name = genruntime.ClonePointerToString(source.Name) - - // StorageAccountResourceReference - if source.StorageAccountResourceId != nil { - storageAccountResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.StorageAccountResourceId) - destination.StorageAccountResourceReference = &storageAccountResourceReference - } else { - destination.StorageAccountResourceReference = nil - } - - // No error - return nil -} - -// Capture storage details for capture description -type Destination_STATUS struct { - // ArchiveNameFormat: Blob naming convention for archive, e.g. - // {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters - // (Namespace,EventHub .. etc) are mandatory irrespective of order - ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` - - // BlobContainer: Blob container Name - BlobContainer *string `json:"blobContainer,omitempty"` - - // DataLakeAccountName: The Azure Data Lake Store name for the captured events - DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` - - // DataLakeFolderPath: The destination folder path for the captured events - DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` - - // DataLakeSubscriptionId: Subscription Id of Azure Data Lake Store - DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` - - // Identity: A value that indicates whether capture description is enabled. - Identity *CaptureIdentity_STATUS `json:"identity,omitempty"` - - // Name: Name for capture destination - Name *string `json:"name,omitempty"` - - // StorageAccountResourceId: Resource id of the storage account to be used to create the blobs - StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` -} - -var _ genruntime.FromARMConverter = &Destination_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (destination *Destination_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Destination_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (destination *Destination_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Destination_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Destination_STATUS_ARM, got %T", armInput) - } - - // Set property "ArchiveNameFormat": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.ArchiveNameFormat != nil { - archiveNameFormat := *typedInput.Properties.ArchiveNameFormat - destination.ArchiveNameFormat = &archiveNameFormat - } - } - - // Set property "BlobContainer": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.BlobContainer != nil { - blobContainer := *typedInput.Properties.BlobContainer - destination.BlobContainer = &blobContainer - } - } - - // Set property "DataLakeAccountName": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DataLakeAccountName != nil { - dataLakeAccountName := *typedInput.Properties.DataLakeAccountName - destination.DataLakeAccountName = &dataLakeAccountName - } - } - - // Set property "DataLakeFolderPath": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DataLakeFolderPath != nil { - dataLakeFolderPath := *typedInput.Properties.DataLakeFolderPath - destination.DataLakeFolderPath = &dataLakeFolderPath - } - } - - // Set property "DataLakeSubscriptionId": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.DataLakeSubscriptionId != nil { - dataLakeSubscriptionId := *typedInput.Properties.DataLakeSubscriptionId - destination.DataLakeSubscriptionId = &dataLakeSubscriptionId - } - } - - // Set property "Identity": - if typedInput.Identity != nil { - var identity1 CaptureIdentity_STATUS - err := identity1.PopulateFromARM(owner, *typedInput.Identity) - if err != nil { - return err - } - identity := identity1 - destination.Identity = &identity - } - - // Set property "Name": - if typedInput.Name != nil { - name := *typedInput.Name - destination.Name = &name - } - - // Set property "StorageAccountResourceId": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.StorageAccountResourceId != nil { - storageAccountResourceId := *typedInput.Properties.StorageAccountResourceId - destination.StorageAccountResourceId = &storageAccountResourceId - } - } - - // No error - return nil -} - -// AssignProperties_From_Destination_STATUS populates our Destination_STATUS from the provided source Destination_STATUS -func (destination *Destination_STATUS) AssignProperties_From_Destination_STATUS(source *v20240101s.Destination_STATUS) error { - - // ArchiveNameFormat - destination.ArchiveNameFormat = genruntime.ClonePointerToString(source.ArchiveNameFormat) - - // BlobContainer - destination.BlobContainer = genruntime.ClonePointerToString(source.BlobContainer) - - // DataLakeAccountName - destination.DataLakeAccountName = genruntime.ClonePointerToString(source.DataLakeAccountName) - - // DataLakeFolderPath - destination.DataLakeFolderPath = genruntime.ClonePointerToString(source.DataLakeFolderPath) - - // DataLakeSubscriptionId - destination.DataLakeSubscriptionId = genruntime.ClonePointerToString(source.DataLakeSubscriptionId) - - // Identity - if source.Identity != nil { - var identity CaptureIdentity_STATUS - err := identity.AssignProperties_From_CaptureIdentity_STATUS(source.Identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_CaptureIdentity_STATUS() to populate field Identity") - } - destination.Identity = &identity - } else { - destination.Identity = nil - } - - // Name - destination.Name = genruntime.ClonePointerToString(source.Name) - - // StorageAccountResourceId - destination.StorageAccountResourceId = genruntime.ClonePointerToString(source.StorageAccountResourceId) - - // No error - return nil -} - -// AssignProperties_To_Destination_STATUS populates the provided destination Destination_STATUS from our Destination_STATUS -func (destination *Destination_STATUS) AssignProperties_To_Destination_STATUS(target *v20240101s.Destination_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // ArchiveNameFormat - target.ArchiveNameFormat = genruntime.ClonePointerToString(destination.ArchiveNameFormat) - - // BlobContainer - target.BlobContainer = genruntime.ClonePointerToString(destination.BlobContainer) - - // DataLakeAccountName - target.DataLakeAccountName = genruntime.ClonePointerToString(destination.DataLakeAccountName) - - // DataLakeFolderPath - target.DataLakeFolderPath = genruntime.ClonePointerToString(destination.DataLakeFolderPath) - - // DataLakeSubscriptionId - target.DataLakeSubscriptionId = genruntime.ClonePointerToString(destination.DataLakeSubscriptionId) - - // Identity - if destination.Identity != nil { - var identity v20240101s.CaptureIdentity_STATUS - err := destination.Identity.AssignProperties_To_CaptureIdentity_STATUS(&identity) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_CaptureIdentity_STATUS() to populate field Identity") - } - target.Identity = &identity - } else { - target.Identity = nil - } - - // Name - target.Name = genruntime.ClonePointerToString(destination.Name) - - // StorageAccountResourceId - target.StorageAccountResourceId = genruntime.ClonePointerToString(destination.StorageAccountResourceId) - - // Update the property bag - if len(propertyBag) > 0 { - target.PropertyBag = propertyBag - } else { - target.PropertyBag = nil - } - - // No error - return nil -} - -// +kubebuilder:validation:Enum={"Compact","Delete"} -type RetentionDescription_CleanupPolicy string - -const ( - RetentionDescription_CleanupPolicy_Compact = RetentionDescription_CleanupPolicy("Compact") - RetentionDescription_CleanupPolicy_Delete = RetentionDescription_CleanupPolicy("Delete") -) - -type RetentionDescription_CleanupPolicy_STATUS string - -const ( - RetentionDescription_CleanupPolicy_STATUS_Compact = RetentionDescription_CleanupPolicy_STATUS("Compact") - RetentionDescription_CleanupPolicy_STATUS_Delete = RetentionDescription_CleanupPolicy_STATUS("Delete") -) - -// A value that indicates whether capture description is enabled. -type CaptureIdentity struct { - // Type: Type of Azure Active Directory Managed Identity. - Type *CaptureIdentity_Type `json:"type,omitempty"` - - // UserAssignedIdentityReference: ARM ID of Managed User Identity. This property is required is the type is - // UserAssignedIdentity. If type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be - // used. - UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` -} - -var _ genruntime.ARMTransformer = &CaptureIdentity{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (identity *CaptureIdentity) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if identity == nil { - return nil, nil - } - result := &CaptureIdentity_ARM{} - - // Set property "Type": - if identity.Type != nil { - typeVar := *identity.Type - result.Type = &typeVar - } - - // Set property "UserAssignedIdentity": - if identity.UserAssignedIdentityReference != nil { - userAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*identity.UserAssignedIdentityReference) - if err != nil { - return nil, err - } - userAssignedIdentityReference := userAssignedIdentityReferenceARMID - result.UserAssignedIdentity = &userAssignedIdentityReference - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (identity *CaptureIdentity) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &CaptureIdentity_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (identity *CaptureIdentity) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(CaptureIdentity_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureIdentity_ARM, got %T", armInput) - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - identity.Type = &typeVar - } - - // no assignment for property "UserAssignedIdentityReference" - - // No error - return nil -} - -// AssignProperties_From_CaptureIdentity populates our CaptureIdentity from the provided source CaptureIdentity -func (identity *CaptureIdentity) AssignProperties_From_CaptureIdentity(source *v20240101s.CaptureIdentity) error { - - // Type - if source.Type != nil { - typeVar := CaptureIdentity_Type(*source.Type) - identity.Type = &typeVar - } else { - identity.Type = nil - } - - // UserAssignedIdentityReference - if source.UserAssignedIdentityReference != nil { - userAssignedIdentityReference := source.UserAssignedIdentityReference.Copy() - identity.UserAssignedIdentityReference = &userAssignedIdentityReference - } else { - identity.UserAssignedIdentityReference = nil - } - - // No error - return nil -} - -// AssignProperties_To_CaptureIdentity populates the provided destination CaptureIdentity from our CaptureIdentity -func (identity *CaptureIdentity) AssignProperties_To_CaptureIdentity(destination *v20240101s.CaptureIdentity) 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 - } - - // UserAssignedIdentityReference - if identity.UserAssignedIdentityReference != nil { - userAssignedIdentityReference := identity.UserAssignedIdentityReference.Copy() - destination.UserAssignedIdentityReference = &userAssignedIdentityReference - } else { - destination.UserAssignedIdentityReference = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_CaptureIdentity_STATUS populates our CaptureIdentity from the provided source CaptureIdentity_STATUS -func (identity *CaptureIdentity) Initialize_From_CaptureIdentity_STATUS(source *CaptureIdentity_STATUS) error { - - // Type - if source.Type != nil { - typeVar := CaptureIdentity_Type(*source.Type) - identity.Type = &typeVar - } else { - identity.Type = nil - } - - // No error - return nil -} - -// A value that indicates whether capture description is enabled. -type CaptureIdentity_STATUS struct { - // Type: Type of Azure Active Directory Managed Identity. - Type *CaptureIdentity_Type_STATUS `json:"type,omitempty"` - - // UserAssignedIdentity: ARM ID of Managed User Identity. This property is required is the type is UserAssignedIdentity. If - // type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be used. - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} - -var _ genruntime.FromARMConverter = &CaptureIdentity_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (identity *CaptureIdentity_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &CaptureIdentity_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (identity *CaptureIdentity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(CaptureIdentity_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CaptureIdentity_STATUS_ARM, got %T", armInput) - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - identity.Type = &typeVar - } - - // Set property "UserAssignedIdentity": - if typedInput.UserAssignedIdentity != nil { - userAssignedIdentity := *typedInput.UserAssignedIdentity - identity.UserAssignedIdentity = &userAssignedIdentity - } - - // No error - return nil -} - -// AssignProperties_From_CaptureIdentity_STATUS populates our CaptureIdentity_STATUS from the provided source CaptureIdentity_STATUS -func (identity *CaptureIdentity_STATUS) AssignProperties_From_CaptureIdentity_STATUS(source *v20240101s.CaptureIdentity_STATUS) error { - - // Type - if source.Type != nil { - typeVar := CaptureIdentity_Type_STATUS(*source.Type) - identity.Type = &typeVar - } else { - identity.Type = nil - } - - // UserAssignedIdentity - identity.UserAssignedIdentity = genruntime.ClonePointerToString(source.UserAssignedIdentity) - - // No error - return nil -} - -// AssignProperties_To_CaptureIdentity_STATUS populates the provided destination CaptureIdentity_STATUS from our CaptureIdentity_STATUS -func (identity *CaptureIdentity_STATUS) AssignProperties_To_CaptureIdentity_STATUS(destination *v20240101s.CaptureIdentity_STATUS) 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 - } - - // UserAssignedIdentity - destination.UserAssignedIdentity = genruntime.ClonePointerToString(identity.UserAssignedIdentity) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// +kubebuilder:validation:Enum={"SystemAssigned","UserAssigned"} -type CaptureIdentity_Type string - -const ( - CaptureIdentity_Type_SystemAssigned = CaptureIdentity_Type("SystemAssigned") - CaptureIdentity_Type_UserAssigned = CaptureIdentity_Type("UserAssigned") -) - -type CaptureIdentity_Type_STATUS string - -const ( - CaptureIdentity_Type_STATUS_SystemAssigned = CaptureIdentity_Type_STATUS("SystemAssigned") - CaptureIdentity_Type_STATUS_UserAssigned = CaptureIdentity_Type_STATUS("UserAssigned") -) - -func init() { - SchemeBuilder.Register(&NamespacesEventhub{}, &NamespacesEventhubList{}) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go deleted file mode 100644 index 5d3d93f99c9..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhub_types_gen_test.go +++ /dev/null @@ -1,1322 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesEventhub_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhub to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesEventhub, NamespacesEventhubGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesEventhub(subject NamespacesEventhub) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesEventhub - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesEventhub - 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_NamespacesEventhub_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhub to NamespacesEventhub via AssignProperties_To_NamespacesEventhub & AssignProperties_From_NamespacesEventhub returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhub, NamespacesEventhubGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhub tests if a specific instance of NamespacesEventhub can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhub(subject NamespacesEventhub) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhub - err := copied.AssignProperties_To_NamespacesEventhub(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhub - err = actual.AssignProperties_From_NamespacesEventhub(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesEventhub_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhub via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhub, NamespacesEventhubGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhub runs a test to see if a specific instance of NamespacesEventhub round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhub(subject NamespacesEventhub) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhub - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhub instances for property testing - lazily instantiated by NamespacesEventhubGenerator() -var namespacesEventhubGenerator gopter.Gen - -// NamespacesEventhubGenerator returns a generator of NamespacesEventhub instances for property testing. -func NamespacesEventhubGenerator() gopter.Gen { - if namespacesEventhubGenerator != nil { - return namespacesEventhubGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhub(generators) - namespacesEventhubGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhub{}), generators) - - return namespacesEventhubGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhub is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhub(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_Eventhub_SpecGenerator() - gens["Status"] = Namespaces_Eventhub_STATUSGenerator() -} - -func Test_Namespaces_Eventhub_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhub_Spec to Namespaces_Eventhub_Spec via AssignProperties_To_Namespaces_Eventhub_Spec & AssignProperties_From_Namespaces_Eventhub_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhub_Spec tests if a specific instance of Namespaces_Eventhub_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_Spec - err := copied.AssignProperties_To_Namespaces_Eventhub_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhub_Spec - err = actual.AssignProperties_From_Namespaces_Eventhub_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_Eventhub_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_Spec runs a test to see if a specific instance of Namespaces_Eventhub_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_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 Namespaces_Eventhub_Spec instances for property testing - lazily instantiated by -// Namespaces_Eventhub_SpecGenerator() -var namespaces_Eventhub_SpecGenerator gopter.Gen - -// Namespaces_Eventhub_SpecGenerator returns a generator of Namespaces_Eventhub_Spec instances for property testing. -// We first initialize namespaces_Eventhub_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhub_SpecGenerator() gopter.Gen { - if namespaces_Eventhub_SpecGenerator != nil { - return namespaces_Eventhub_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) - namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) - namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) - - return namespaces_Eventhub_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) - gens["PartitionCount"] = gen.PtrOf(gen.Int()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { - gens["CaptureDescription"] = gen.PtrOf(CaptureDescriptionGenerator()) - gens["RetentionDescription"] = gen.PtrOf(RetentionDescriptionGenerator()) -} - -func Test_Namespaces_Eventhub_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhub_STATUS to Namespaces_Eventhub_STATUS via AssignProperties_To_Namespaces_Eventhub_STATUS & AssignProperties_From_Namespaces_Eventhub_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS tests if a specific instance of Namespaces_Eventhub_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_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 v20240101s.Namespaces_Eventhub_STATUS - err := copied.AssignProperties_To_Namespaces_Eventhub_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhub_STATUS - err = actual.AssignProperties_From_Namespaces_Eventhub_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_Eventhub_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_STATUS runs a test to see if a specific instance of Namespaces_Eventhub_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_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 Namespaces_Eventhub_STATUS instances for property testing - lazily instantiated by -// Namespaces_Eventhub_STATUSGenerator() -var namespaces_Eventhub_STATUSGenerator gopter.Gen - -// Namespaces_Eventhub_STATUSGenerator returns a generator of Namespaces_Eventhub_STATUS instances for property testing. -// We first initialize namespaces_Eventhub_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhub_STATUSGenerator() gopter.Gen { - if namespaces_Eventhub_STATUSGenerator != nil { - return namespaces_Eventhub_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) - namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) - namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) - - return namespaces_Eventhub_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["PartitionCount"] = gen.PtrOf(gen.Int()) - gens["PartitionIds"] = gen.SliceOf(gen.AlphaString()) - gens["Status"] = gen.PtrOf(gen.OneConstOf( - Namespaces_Eventhub_Properties_Status_STATUS_Active, - Namespaces_Eventhub_Properties_Status_STATUS_Creating, - Namespaces_Eventhub_Properties_Status_STATUS_Deleting, - Namespaces_Eventhub_Properties_Status_STATUS_Disabled, - Namespaces_Eventhub_Properties_Status_STATUS_ReceiveDisabled, - Namespaces_Eventhub_Properties_Status_STATUS_Renaming, - Namespaces_Eventhub_Properties_Status_STATUS_Restoring, - Namespaces_Eventhub_Properties_Status_STATUS_SendDisabled, - Namespaces_Eventhub_Properties_Status_STATUS_Unknown)) - gens["Type"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { - gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_STATUSGenerator()) - gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_STATUSGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_CaptureDescription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from CaptureDescription to CaptureDescription via AssignProperties_To_CaptureDescription & AssignProperties_From_CaptureDescription returns original", - prop.ForAll(RunPropertyAssignmentTestForCaptureDescription, CaptureDescriptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForCaptureDescription tests if a specific instance of CaptureDescription can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForCaptureDescription(subject CaptureDescription) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.CaptureDescription - err := copied.AssignProperties_To_CaptureDescription(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual CaptureDescription - err = actual.AssignProperties_From_CaptureDescription(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_CaptureDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureDescription via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureDescription, CaptureDescriptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureDescription runs a test to see if a specific instance of CaptureDescription round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureDescription(subject CaptureDescription) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureDescription - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureDescription instances for property testing - lazily instantiated by CaptureDescriptionGenerator() -var captureDescriptionGenerator gopter.Gen - -// CaptureDescriptionGenerator returns a generator of CaptureDescription instances for property testing. -// We first initialize captureDescriptionGenerator 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 CaptureDescriptionGenerator() gopter.Gen { - if captureDescriptionGenerator != nil { - return captureDescriptionGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription(generators) - captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription(generators) - AddRelatedPropertyGeneratorsForCaptureDescription(generators) - captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) - - return captureDescriptionGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { - gens["Enabled"] = gen.PtrOf(gen.Bool()) - gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_Avro, CaptureDescription_Encoding_AvroDeflate)) - gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) - gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) - gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { - gens["Destination"] = gen.PtrOf(DestinationGenerator()) -} - -func Test_CaptureDescription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from CaptureDescription_STATUS to CaptureDescription_STATUS via AssignProperties_To_CaptureDescription_STATUS & AssignProperties_From_CaptureDescription_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForCaptureDescription_STATUS tests if a specific instance of CaptureDescription_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForCaptureDescription_STATUS(subject CaptureDescription_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 v20240101s.CaptureDescription_STATUS - err := copied.AssignProperties_To_CaptureDescription_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual CaptureDescription_STATUS - err = actual.AssignProperties_From_CaptureDescription_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_CaptureDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureDescription_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureDescription_STATUS runs a test to see if a specific instance of CaptureDescription_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureDescription_STATUS(subject CaptureDescription_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureDescription_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 CaptureDescription_STATUS instances for property testing - lazily instantiated by -// CaptureDescription_STATUSGenerator() -var captureDescription_STATUSGenerator gopter.Gen - -// CaptureDescription_STATUSGenerator returns a generator of CaptureDescription_STATUS instances for property testing. -// We first initialize captureDescription_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func CaptureDescription_STATUSGenerator() gopter.Gen { - if captureDescription_STATUSGenerator != nil { - return captureDescription_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) - captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) - AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(generators) - captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) - - return captureDescription_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { - gens["Enabled"] = gen.PtrOf(gen.Bool()) - gens["Encoding"] = gen.PtrOf(gen.OneConstOf(CaptureDescription_Encoding_STATUS_Avro, CaptureDescription_Encoding_STATUS_AvroDeflate)) - gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) - gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) - gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { - gens["Destination"] = gen.PtrOf(Destination_STATUSGenerator()) -} - -func Test_RetentionDescription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from RetentionDescription to RetentionDescription via AssignProperties_To_RetentionDescription & AssignProperties_From_RetentionDescription returns original", - prop.ForAll(RunPropertyAssignmentTestForRetentionDescription, RetentionDescriptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForRetentionDescription tests if a specific instance of RetentionDescription can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForRetentionDescription(subject RetentionDescription) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.RetentionDescription - err := copied.AssignProperties_To_RetentionDescription(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual RetentionDescription - err = actual.AssignProperties_From_RetentionDescription(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_RetentionDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of RetentionDescription via JSON returns original", - prop.ForAll(RunJSONSerializationTestForRetentionDescription, RetentionDescriptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForRetentionDescription runs a test to see if a specific instance of RetentionDescription round trips to JSON and back losslessly -func RunJSONSerializationTestForRetentionDescription(subject RetentionDescription) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual RetentionDescription - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of RetentionDescription instances for property testing - lazily instantiated by -// RetentionDescriptionGenerator() -var retentionDescriptionGenerator gopter.Gen - -// RetentionDescriptionGenerator returns a generator of RetentionDescription instances for property testing. -func RetentionDescriptionGenerator() gopter.Gen { - if retentionDescriptionGenerator != nil { - return retentionDescriptionGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForRetentionDescription(generators) - retentionDescriptionGenerator = gen.Struct(reflect.TypeOf(RetentionDescription{}), generators) - - return retentionDescriptionGenerator -} - -// AddIndependentPropertyGeneratorsForRetentionDescription is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForRetentionDescription(gens map[string]gopter.Gen) { - gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_Compact, RetentionDescription_CleanupPolicy_Delete)) - gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) - gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) -} - -func Test_RetentionDescription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from RetentionDescription_STATUS to RetentionDescription_STATUS via AssignProperties_To_RetentionDescription_STATUS & AssignProperties_From_RetentionDescription_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForRetentionDescription_STATUS, RetentionDescription_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForRetentionDescription_STATUS tests if a specific instance of RetentionDescription_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForRetentionDescription_STATUS(subject RetentionDescription_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 v20240101s.RetentionDescription_STATUS - err := copied.AssignProperties_To_RetentionDescription_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual RetentionDescription_STATUS - err = actual.AssignProperties_From_RetentionDescription_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_RetentionDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of RetentionDescription_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForRetentionDescription_STATUS, RetentionDescription_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForRetentionDescription_STATUS runs a test to see if a specific instance of RetentionDescription_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForRetentionDescription_STATUS(subject RetentionDescription_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual RetentionDescription_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 RetentionDescription_STATUS instances for property testing - lazily instantiated by -// RetentionDescription_STATUSGenerator() -var retentionDescription_STATUSGenerator gopter.Gen - -// RetentionDescription_STATUSGenerator returns a generator of RetentionDescription_STATUS instances for property testing. -func RetentionDescription_STATUSGenerator() gopter.Gen { - if retentionDescription_STATUSGenerator != nil { - return retentionDescription_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(generators) - retentionDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_STATUS{}), generators) - - return retentionDescription_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForRetentionDescription_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(gens map[string]gopter.Gen) { - gens["CleanupPolicy"] = gen.PtrOf(gen.OneConstOf(RetentionDescription_CleanupPolicy_STATUS_Compact, RetentionDescription_CleanupPolicy_STATUS_Delete)) - gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) - gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) -} - -func Test_Destination_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Destination to Destination via AssignProperties_To_Destination & AssignProperties_From_Destination returns original", - prop.ForAll(RunPropertyAssignmentTestForDestination, DestinationGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForDestination tests if a specific instance of Destination can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForDestination(subject Destination) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.Destination - err := copied.AssignProperties_To_Destination(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Destination - err = actual.AssignProperties_From_Destination(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Destination_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination, DestinationGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination runs a test to see if a specific instance of Destination round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination(subject Destination) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Destination instances for property testing - lazily instantiated by DestinationGenerator() -var destinationGenerator gopter.Gen - -// DestinationGenerator returns a generator of Destination instances for property testing. -// We first initialize destinationGenerator 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 DestinationGenerator() gopter.Gen { - if destinationGenerator != nil { - return destinationGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination(generators) - destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination(generators) - AddRelatedPropertyGeneratorsForDestination(generators) - destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) - - return destinationGenerator -} - -// AddIndependentPropertyGeneratorsForDestination is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { - gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) - gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForDestination is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(CaptureIdentityGenerator()) -} - -func Test_Destination_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Destination_STATUS to Destination_STATUS via AssignProperties_To_Destination_STATUS & AssignProperties_From_Destination_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForDestination_STATUS, Destination_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForDestination_STATUS tests if a specific instance of Destination_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForDestination_STATUS(subject Destination_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 v20240101s.Destination_STATUS - err := copied.AssignProperties_To_Destination_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Destination_STATUS - err = actual.AssignProperties_From_Destination_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Destination_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination_STATUS, Destination_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination_STATUS runs a test to see if a specific instance of Destination_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination_STATUS(subject Destination_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination_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 Destination_STATUS instances for property testing - lazily instantiated by Destination_STATUSGenerator() -var destination_STATUSGenerator gopter.Gen - -// Destination_STATUSGenerator returns a generator of Destination_STATUS instances for property testing. -// We first initialize destination_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Destination_STATUSGenerator() gopter.Gen { - if destination_STATUSGenerator != nil { - return destination_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_STATUS(generators) - destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_STATUS(generators) - AddRelatedPropertyGeneratorsForDestination_STATUS(generators) - destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) - - return destination_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { - gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) - gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(CaptureIdentity_STATUSGenerator()) -} - -func Test_CaptureIdentity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from CaptureIdentity to CaptureIdentity via AssignProperties_To_CaptureIdentity & AssignProperties_From_CaptureIdentity returns original", - prop.ForAll(RunPropertyAssignmentTestForCaptureIdentity, CaptureIdentityGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForCaptureIdentity tests if a specific instance of CaptureIdentity can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForCaptureIdentity(subject CaptureIdentity) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.CaptureIdentity - err := copied.AssignProperties_To_CaptureIdentity(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual CaptureIdentity - err = actual.AssignProperties_From_CaptureIdentity(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_CaptureIdentity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureIdentity via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureIdentity, CaptureIdentityGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureIdentity runs a test to see if a specific instance of CaptureIdentity round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureIdentity(subject CaptureIdentity) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureIdentity - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureIdentity instances for property testing - lazily instantiated by CaptureIdentityGenerator() -var captureIdentityGenerator gopter.Gen - -// CaptureIdentityGenerator returns a generator of CaptureIdentity instances for property testing. -func CaptureIdentityGenerator() gopter.Gen { - if captureIdentityGenerator != nil { - return captureIdentityGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureIdentity(generators) - captureIdentityGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity{}), generators) - - return captureIdentityGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureIdentity is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureIdentity(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_SystemAssigned, CaptureIdentity_Type_UserAssigned)) -} - -func Test_CaptureIdentity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from CaptureIdentity_STATUS to CaptureIdentity_STATUS via AssignProperties_To_CaptureIdentity_STATUS & AssignProperties_From_CaptureIdentity_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForCaptureIdentity_STATUS, CaptureIdentity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForCaptureIdentity_STATUS tests if a specific instance of CaptureIdentity_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForCaptureIdentity_STATUS(subject CaptureIdentity_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 v20240101s.CaptureIdentity_STATUS - err := copied.AssignProperties_To_CaptureIdentity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual CaptureIdentity_STATUS - err = actual.AssignProperties_From_CaptureIdentity_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_CaptureIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureIdentity_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureIdentity_STATUS, CaptureIdentity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureIdentity_STATUS runs a test to see if a specific instance of CaptureIdentity_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureIdentity_STATUS(subject CaptureIdentity_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureIdentity_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 CaptureIdentity_STATUS instances for property testing - lazily instantiated by -// CaptureIdentity_STATUSGenerator() -var captureIdentity_STATUSGenerator gopter.Gen - -// CaptureIdentity_STATUSGenerator returns a generator of CaptureIdentity_STATUS instances for property testing. -func CaptureIdentity_STATUSGenerator() gopter.Gen { - if captureIdentity_STATUSGenerator != nil { - return captureIdentity_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(generators) - captureIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_STATUS{}), generators) - - return captureIdentity_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.OneConstOf(CaptureIdentity_Type_STATUS_SystemAssigned, CaptureIdentity_Type_STATUS_UserAssigned)) - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go deleted file mode 100644 index bd467ed9bfd..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - -type Namespaces_Eventhubs_AuthorizationRule_Spec_ARM struct { - Name string `json:"name,omitempty"` - - // Properties: Properties supplied to create or update AuthorizationRule - Properties *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM `json:"properties,omitempty"` -} - -var _ genruntime.ARMResourceSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (rule Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetName returns the Name of the resource -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) GetName() string { - return rule.Name -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" -} - -type Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM struct { - // Rights: The rights associated with the rule. - Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go deleted file mode 100644 index e2f17d65a1d..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_spec_arm_types_gen_test.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_Eventhubs_AuthorizationRule_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM, Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(subject Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator() -var namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec_ARM instances for property testing. -// We first initialize namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator 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 Namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(generators) - namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(generators) - namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { - gens["Name"] = gen.AlphaString() -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator()) -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM, Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM(subject Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM instances for property testing - lazily -// instantiated by Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator() -var namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM instances for property testing. -func Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM(generators) - namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM(gens map[string]gopter.Gen) { - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send)) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go deleted file mode 100644 index ea35e249927..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -type Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM struct { - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // Properties: Properties supplied to create or update AuthorizationRule - Properties *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM `json:"properties,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` -} - -type Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM struct { - // Rights: The rights associated with the rule. - Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen_test.go deleted file mode 100644 index 68dc1cea72b..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_status_arm_types_gen_test.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM, Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(subject Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM instances for property testing - lazily instantiated -// by Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator() -var namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM instances for property testing. -// We first initialize namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator 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 Namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(generators) - namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(generators) - namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM, Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM(subject Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM instances for property testing - lazily -// instantiated by Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator() -var namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM instances for property testing. -func Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM(generators) - namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Send)) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go deleted file mode 100644 index 1031d5647db..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen.go +++ /dev/null @@ -1,1021 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" -// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" -// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} -type NamespacesEventhubsAuthorizationRule struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_Eventhubs_AuthorizationRule_Spec `json:"spec,omitempty"` - Status Namespaces_Eventhubs_AuthorizationRule_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesEventhubsAuthorizationRule{} - -// GetConditions returns the conditions of the resource -func (rule *NamespacesEventhubsAuthorizationRule) GetConditions() conditions.Conditions { - return rule.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (rule *NamespacesEventhubsAuthorizationRule) SetConditions(conditions conditions.Conditions) { - rule.Status.Conditions = conditions -} - -var _ conversion.Convertible = &NamespacesEventhubsAuthorizationRule{} - -// ConvertFrom populates our NamespacesEventhubsAuthorizationRule from the provided hub NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_From_NamespacesEventhubsAuthorizationRule(source) -} - -// ConvertTo populates the provided hub NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesEventhubsAuthorizationRule) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsAuthorizationRule but received %T instead", hub) - } - - return rule.AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination) -} - -// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespaceseventhubsauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaceseventhubsauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Defaulter = &NamespacesEventhubsAuthorizationRule{} - -// Default applies defaults to the NamespacesEventhubsAuthorizationRule resource -func (rule *NamespacesEventhubsAuthorizationRule) Default() { - rule.defaultImpl() - var temp any = rule - if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { - runtimeDefaulter.CustomDefault() - } -} - -// defaultAzureName defaults the Azure name of the resource to the Kubernetes name -func (rule *NamespacesEventhubsAuthorizationRule) defaultAzureName() { - if rule.Spec.AzureName == "" { - rule.Spec.AzureName = rule.Name - } -} - -// defaultImpl applies the code generated defaults to the NamespacesEventhubsAuthorizationRule resource -func (rule *NamespacesEventhubsAuthorizationRule) defaultImpl() { rule.defaultAzureName() } - -var _ genruntime.ImportableResource = &NamespacesEventhubsAuthorizationRule{} - -// InitializeSpec initializes the spec for this resource from the given status -func (rule *NamespacesEventhubsAuthorizationRule) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { - return rule.Spec.Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Eventhubs_AuthorizationRule_STATUS but received %T instead", status) -} - -var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} - -// AzureName returns the Azure name of the resource -func (rule *NamespacesEventhubsAuthorizationRule) AzureName() string { - return rule.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (rule NamespacesEventhubsAuthorizationRule) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (rule *NamespacesEventhubsAuthorizationRule) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (rule *NamespacesEventhubsAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { - return &rule.Spec -} - -// GetStatus returns the status of this resource -func (rule *NamespacesEventhubsAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { - return &rule.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (rule *NamespacesEventhubsAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" -func (rule *NamespacesEventhubsAuthorizationRule) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" -} - -// NewEmptyStatus returns a new empty (blank) status -func (rule *NamespacesEventhubsAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_Eventhubs_AuthorizationRule_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (rule *NamespacesEventhubsAuthorizationRule) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) - return rule.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (rule *NamespacesEventhubsAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { - rule.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_Eventhubs_AuthorizationRule_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - rule.Status = st - return nil -} - -// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespaceseventhubsauthorizationrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaceseventhubsauthorizationrules.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Validator = &NamespacesEventhubsAuthorizationRule{} - -// ValidateCreate validates the creation of the resource -func (rule *NamespacesEventhubsAuthorizationRule) ValidateCreate() (admission.Warnings, error) { - validations := rule.createValidations() - var temp any = rule - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.CreateValidations()...) - } - return genruntime.ValidateCreate(validations) -} - -// ValidateDelete validates the deletion of the resource -func (rule *NamespacesEventhubsAuthorizationRule) ValidateDelete() (admission.Warnings, error) { - validations := rule.deleteValidations() - var temp any = rule - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.DeleteValidations()...) - } - return genruntime.ValidateDelete(validations) -} - -// ValidateUpdate validates an update of the resource -func (rule *NamespacesEventhubsAuthorizationRule) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { - validations := rule.updateValidations() - var temp any = rule - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.UpdateValidations()...) - } - return genruntime.ValidateUpdate(old, validations) -} - -// createValidations validates the creation of the resource -func (rule *NamespacesEventhubsAuthorizationRule) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){rule.validateResourceReferences, rule.validateOwnerReference, rule.validateSecretDestinations} -} - -// deleteValidations validates the deletion of the resource -func (rule *NamespacesEventhubsAuthorizationRule) deleteValidations() []func() (admission.Warnings, error) { - return nil -} - -// updateValidations validates the update of the resource -func (rule *NamespacesEventhubsAuthorizationRule) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { - return []func(old runtime.Object) (admission.Warnings, error){ - func(old runtime.Object) (admission.Warnings, error) { - return rule.validateResourceReferences() - }, - rule.validateWriteOnceProperties, - func(old runtime.Object) (admission.Warnings, error) { - return rule.validateOwnerReference() - }, - func(old runtime.Object) (admission.Warnings, error) { - return rule.validateSecretDestinations() - }, - } -} - -// validateOwnerReference validates the owner field -func (rule *NamespacesEventhubsAuthorizationRule) validateOwnerReference() (admission.Warnings, error) { - return genruntime.ValidateOwner(rule) -} - -// validateResourceReferences validates all resource references -func (rule *NamespacesEventhubsAuthorizationRule) validateResourceReferences() (admission.Warnings, error) { - refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) - if err != nil { - return nil, err - } - return genruntime.ValidateResourceReferences(refs) -} - -// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's -func (rule *NamespacesEventhubsAuthorizationRule) validateSecretDestinations() (admission.Warnings, error) { - if rule.Spec.OperatorSpec == nil { - return nil, nil - } - if rule.Spec.OperatorSpec.Secrets == nil { - return nil, nil - } - toValidate := []*genruntime.SecretDestination{ - rule.Spec.OperatorSpec.Secrets.PrimaryConnectionString, - rule.Spec.OperatorSpec.Secrets.PrimaryKey, - rule.Spec.OperatorSpec.Secrets.SecondaryConnectionString, - rule.Spec.OperatorSpec.Secrets.SecondaryKey, - } - return genruntime.ValidateSecretDestinations(toValidate) -} - -// validateWriteOnceProperties validates all WriteOnce properties -func (rule *NamespacesEventhubsAuthorizationRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { - oldObj, ok := old.(*NamespacesEventhubsAuthorizationRule) - if !ok { - return nil, nil - } - - return genruntime.ValidateWriteOnceProperties(oldObj, rule) -} - -// AssignProperties_From_NamespacesEventhubsAuthorizationRule populates our NamespacesEventhubsAuthorizationRule from the provided source NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_From_NamespacesEventhubsAuthorizationRule(source *v20240101s.NamespacesEventhubsAuthorizationRule) error { - - // ObjectMeta - rule.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_Eventhubs_AuthorizationRule_Spec - err := spec.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") - } - rule.Spec = spec - - // Status - var status Namespaces_Eventhubs_AuthorizationRule_STATUS - err = status.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") - } - rule.Status = status - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsAuthorizationRule populates the provided destination NamespacesEventhubsAuthorizationRule from our NamespacesEventhubsAuthorizationRule -func (rule *NamespacesEventhubsAuthorizationRule) AssignProperties_To_NamespacesEventhubsAuthorizationRule(destination *v20240101s.NamespacesEventhubsAuthorizationRule) error { - - // ObjectMeta - destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec - err := rule.Spec.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS - err = rule.Status.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS() to populate field Status") - } - destination.Status = status - - // No error - return nil -} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (rule *NamespacesEventhubsAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: rule.Spec.OriginalVersion(), - Kind: "NamespacesEventhubsAuthorizationRule", - } -} - -// +kubebuilder:object:root=true -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} -type NamespacesEventhubsAuthorizationRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesEventhubsAuthorizationRule `json:"items"` -} - -type Namespaces_Eventhubs_AuthorizationRule_Spec struct { - // +kubebuilder:validation:MinLength=1 - // 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"` - - // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not - // passed directly to Azure - OperatorSpec *NamespacesEventhubsAuthorizationRuleOperatorSpec `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 eventhub.azure.com/NamespacesEventhub resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` - - // +kubebuilder:validation:Required - // Rights: The rights associated with the rule. - Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` -} - -var _ genruntime.ARMTransformer = &Namespaces_Eventhubs_AuthorizationRule_Spec{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if rule == nil { - return nil, nil - } - result := &Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{} - - // Set property "Name": - result.Name = resolved.Name - - // Set property "Properties": - if rule.Rights != nil { - result.Properties = &Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM{} - } - for _, item := range rule.Rights { - result.Properties.Rights = append(result.Properties.Rights, item) - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_Eventhubs_AuthorizationRule_Spec_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_AuthorizationRule_Spec_ARM, got %T", armInput) - } - - // Set property "AzureName": - rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) - - // no assignment for property "OperatorSpec" - - // Set property "Owner": - rule.Owner = &genruntime.KnownResourceReference{ - Name: owner.Name, - ARMID: owner.ARMID, - } - - // Set property "Rights": - // copying flattened property: - if typedInput.Properties != nil { - for _, item := range typedInput.Properties.Rights { - rule.Rights = append(rule.Rights, item) - } - } - - // No error - return nil -} - -var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec{} - -// ConvertSpecFrom populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") - } - - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil -} - -// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_Spec -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec{} - err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(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 -} - -// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_Spec -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { - - // AzureName - rule.AzureName = source.AzureName - - // OperatorSpec - if source.OperatorSpec != nil { - var operatorSpec NamespacesEventhubsAuthorizationRuleOperatorSpec - err := operatorSpec.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source.OperatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - rule.OperatorSpec = &operatorSpec - } else { - rule.OperatorSpec = nil - } - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - rule.Owner = &owner - } else { - rule.Owner = nil - } - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec(rightItem) - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec populates the provided destination Namespaces_Eventhubs_AuthorizationRule_Spec from our Namespaces_Eventhubs_AuthorizationRule_Spec -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // AzureName - destination.AzureName = rule.AzureName - - // OperatorSpec - if rule.OperatorSpec != nil { - var operatorSpec v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec - err := rule.OperatorSpec.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&operatorSpec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec() to populate field OperatorSpec") - } - destination.OperatorSpec = &operatorSpec - } else { - destination.OperatorSpec = nil - } - - // OriginalVersion - destination.OriginalVersion = rule.OriginalVersion() - - // Owner - if rule.Owner != nil { - owner := rule.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // Rights - if rule.Rights != nil { - rightList := make([]string, len(rule.Rights)) - for rightIndex, rightItem := range rule.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = string(rightItem) - } - destination.Rights = rightList - } else { - destination.Rights = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) Initialize_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *Namespaces_Eventhubs_AuthorizationRule_STATUS) error { - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - right := Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec(rightItem) - rightList[rightIndex] = right - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // No error - return nil -} - -// OriginalVersion returns the original API version used to create the resource. -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) OriginalVersion() string { - return GroupVersion.Version -} - -// SetAzureName sets the Azure name of the resource -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) SetAzureName(azureName string) { - rule.AzureName = azureName -} - -type Namespaces_Eventhubs_AuthorizationRule_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"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // Rights: The rights associated with the rule. - Rights []Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_AuthorizationRule_STATUS{} - -// ConvertStatusFrom populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) - if ok { - // Populate our instance from source - return rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") - } - - // Update our instance from src - err = rule.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil -} - -// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) - if ok { - // Populate destination from our instance - return rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS{} - err := rule.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(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 = &Namespaces_Eventhubs_AuthorizationRule_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM, got %T", armInput) - } - - // no assignment for property "Conditions" - - // Set property "Id": - if typedInput.Id != nil { - id := *typedInput.Id - rule.Id = &id - } - - // Set property "Location": - if typedInput.Location != nil { - location := *typedInput.Location - rule.Location = &location - } - - // Set property "Name": - if typedInput.Name != nil { - name := *typedInput.Name - rule.Name = &name - } - - // Set property "Rights": - // copying flattened property: - if typedInput.Properties != nil { - for _, item := range typedInput.Properties.Rights { - rule.Rights = append(rule.Rights, item) - } - } - - // Set property "SystemData": - if typedInput.SystemData != nil { - var systemData1 SystemData_STATUS - err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) - if err != nil { - return err - } - systemData := systemData1 - rule.SystemData = &systemData - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - rule.Type = &typeVar - } - - // No error - return nil -} - -// AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(source *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { - - // Conditions - rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // Id - rule.Id = genruntime.ClonePointerToString(source.Id) - - // Location - rule.Location = genruntime.ClonePointerToString(source.Location) - - // Name - rule.Name = genruntime.ClonePointerToString(source.Name) - - // Rights - if source.Rights != nil { - rightList := make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS, len(source.Rights)) - for rightIndex, rightItem := range source.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS(rightItem) - } - rule.Rights = rightList - } else { - rule.Rights = nil - } - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - rule.SystemData = &systemDatum - } else { - rule.SystemData = nil - } - - // Type - rule.Type = genruntime.ClonePointerToString(source.Type) - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS populates the provided destination Namespaces_Eventhubs_AuthorizationRule_STATUS from our Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(destination *v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) - - // Id - destination.Id = genruntime.ClonePointerToString(rule.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(rule.Location) - - // Name - destination.Name = genruntime.ClonePointerToString(rule.Name) - - // Rights - if rule.Rights != nil { - rightList := make([]string, len(rule.Rights)) - for rightIndex, rightItem := range rule.Rights { - // Shadow the loop variable to avoid aliasing - rightItem := rightItem - rightList[rightIndex] = string(rightItem) - } - destination.Rights = rightList - } else { - destination.Rights = nil - } - - // SystemData - if rule.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(rule.Type) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// +kubebuilder:validation:Enum={"Listen","Manage","Send"} -type Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec string - -const ( - Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec("Listen") - Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Manage = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec("Manage") - Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec("Send") -) - -type Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS string - -const ( - Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Listen = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS("Listen") - Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Manage = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS("Manage") - Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Send = Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS("Send") -) - -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type NamespacesEventhubsAuthorizationRuleOperatorSpec struct { - // Secrets: configures where to place Azure generated secrets. - Secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` -} - -// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec populates our NamespacesEventhubsAuthorizationRuleOperatorSpec from the provided source NamespacesEventhubsAuthorizationRuleOperatorSpec -func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { - - // Secrets - if source.Secrets != nil { - var secret NamespacesEventhubsAuthorizationRuleOperatorSecrets - err := secret.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source.Secrets) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets() to populate field Secrets") - } - operator.Secrets = &secret - } else { - operator.Secrets = nil - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSpec from our NamespacesEventhubsAuthorizationRuleOperatorSpec -func (operator *NamespacesEventhubsAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Secrets - if operator.Secrets != nil { - var secret v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets - err := operator.Secrets.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&secret) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets() 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 NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { - // PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret - // will not be retrieved from Azure. - PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` - - // PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from - // Azure. - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - - // SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret - // will not be retrieved from Azure. - SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` - - // SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved - // from Azure. - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -// AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates our NamespacesEventhubsAuthorizationRuleOperatorSecrets from the provided source NamespacesEventhubsAuthorizationRuleOperatorSecrets -func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(source *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { - - // PrimaryConnectionString - if source.PrimaryConnectionString != nil { - primaryConnectionString := source.PrimaryConnectionString.Copy() - secrets.PrimaryConnectionString = &primaryConnectionString - } else { - secrets.PrimaryConnectionString = nil - } - - // PrimaryKey - if source.PrimaryKey != nil { - primaryKey := source.PrimaryKey.Copy() - secrets.PrimaryKey = &primaryKey - } else { - secrets.PrimaryKey = nil - } - - // SecondaryConnectionString - if source.SecondaryConnectionString != nil { - secondaryConnectionString := source.SecondaryConnectionString.Copy() - secrets.SecondaryConnectionString = &secondaryConnectionString - } else { - secrets.SecondaryConnectionString = nil - } - - // SecondaryKey - if source.SecondaryKey != nil { - secondaryKey := source.SecondaryKey.Copy() - secrets.SecondaryKey = &secondaryKey - } else { - secrets.SecondaryKey = nil - } - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets populates the provided destination NamespacesEventhubsAuthorizationRuleOperatorSecrets from our NamespacesEventhubsAuthorizationRuleOperatorSecrets -func (secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(destination *v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // PrimaryConnectionString - if secrets.PrimaryConnectionString != nil { - primaryConnectionString := secrets.PrimaryConnectionString.Copy() - destination.PrimaryConnectionString = &primaryConnectionString - } else { - destination.PrimaryConnectionString = nil - } - - // PrimaryKey - if secrets.PrimaryKey != nil { - primaryKey := secrets.PrimaryKey.Copy() - destination.PrimaryKey = &primaryKey - } else { - destination.PrimaryKey = nil - } - - // SecondaryConnectionString - if secrets.SecondaryConnectionString != nil { - secondaryConnectionString := secrets.SecondaryConnectionString.Copy() - destination.SecondaryConnectionString = &secondaryConnectionString - } else { - destination.SecondaryConnectionString = nil - } - - // SecondaryKey - if secrets.SecondaryKey != nil { - secondaryKey := secrets.SecondaryKey.Copy() - destination.SecondaryKey = &secondaryKey - } else { - destination.SecondaryKey = nil - } - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -func init() { - SchemeBuilder.Register(&NamespacesEventhubsAuthorizationRule{}, &NamespacesEventhubsAuthorizationRuleList{}) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go deleted file mode 100644 index 347f5c3b90d..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_authorization_rule_types_gen_test.go +++ /dev/null @@ -1,605 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesEventhubsAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRule to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesEventhubsAuthorizationRule - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesEventhubsAuthorizationRule - 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_NamespacesEventhubsAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRule to NamespacesEventhubsAuthorizationRule via AssignProperties_To_NamespacesEventhubsAuthorizationRule & AssignProperties_From_NamespacesEventhubsAuthorizationRule returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule tests if a specific instance of NamespacesEventhubsAuthorizationRule can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsAuthorizationRule - err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsAuthorizationRule - err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRule(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesEventhubsAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsAuthorizationRule via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRule round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsAuthorizationRule - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsAuthorizationRule instances for property testing - lazily instantiated by -// NamespacesEventhubsAuthorizationRuleGenerator() -var namespacesEventhubsAuthorizationRuleGenerator gopter.Gen - -// NamespacesEventhubsAuthorizationRuleGenerator returns a generator of NamespacesEventhubsAuthorizationRule instances for property testing. -func NamespacesEventhubsAuthorizationRuleGenerator() gopter.Gen { - if namespacesEventhubsAuthorizationRuleGenerator != nil { - return namespacesEventhubsAuthorizationRuleGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(generators) - namespacesEventhubsAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRule{}), generators) - - return namespacesEventhubsAuthorizationRuleGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() - gens["Status"] = Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_AuthorizationRule_Spec to Namespaces_Eventhubs_AuthorizationRule_Spec via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_Spec - err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_AuthorizationRule_Spec - err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() -var namespaces_Eventhubs_AuthorizationRule_SpecGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing. -// We first initialize namespaces_Eventhubs_AuthorizationRule_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_SpecGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) - namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) - namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send)) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["OperatorSpec"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator()) -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_AuthorizationRule_STATUS to Namespaces_Eventhubs_AuthorizationRule_STATUS via AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS & AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS tests if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_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 v20240101s.Namespaces_Eventhubs_AuthorizationRule_STATUS - err := copied.AssignProperties_To_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_AuthorizationRule_STATUS - err = actual.AssignProperties_From_Namespaces_Eventhubs_AuthorizationRule_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() -var namespaces_Eventhubs_AuthorizationRule_STATUSGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing. -// We first initialize namespaces_Eventhubs_AuthorizationRule_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_STATUSGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) - namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) - namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Rights"] = gen.SliceOf(gen.OneConstOf(Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Listen, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Manage, Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS_Send)) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSpec to NamespacesEventhubsAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSpec - err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsAuthorizationRuleOperatorSpec - err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSpec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsAuthorizationRuleOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by -// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() -var namespacesEventhubsAuthorizationRuleOperatorSpecGenerator gopter.Gen - -// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing. -func NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() gopter.Gen { - if namespacesEventhubsAuthorizationRuleOperatorSpecGenerator != nil { - return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(generators) - namespacesEventhubsAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSpec{}), generators) - - return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator()) -} - -func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsAuthorizationRuleOperatorSecrets to NamespacesEventhubsAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsAuthorizationRuleOperatorSecrets - err := copied.AssignProperties_To_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets - err = actual.AssignProperties_From_NamespacesEventhubsAuthorizationRuleOperatorSecrets(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated -// by NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() -var namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator gopter.Gen - -// NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing. -func NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { - if namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator != nil { - return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSecrets{}), generators) - - return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go deleted file mode 100644 index e533e31db0f..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen.go +++ /dev/null @@ -1,788 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "fmt" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" -// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" -// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} -type NamespacesEventhubsConsumerGroup struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_Eventhubs_Consumergroup_Spec `json:"spec,omitempty"` - Status Namespaces_Eventhubs_Consumergroup_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesEventhubsConsumerGroup{} - -// GetConditions returns the conditions of the resource -func (group *NamespacesEventhubsConsumerGroup) GetConditions() conditions.Conditions { - return group.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (group *NamespacesEventhubsConsumerGroup) SetConditions(conditions conditions.Conditions) { - group.Status.Conditions = conditions -} - -var _ conversion.Convertible = &NamespacesEventhubsConsumerGroup{} - -// ConvertFrom populates our NamespacesEventhubsConsumerGroup from the provided hub NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) - } - - return group.AssignProperties_From_NamespacesEventhubsConsumerGroup(source) -} - -// ConvertTo populates the provided hub NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20240101s.NamespacesEventhubsConsumerGroup) - if !ok { - return fmt.Errorf("expected eventhub/v1api20240101/storage/NamespacesEventhubsConsumerGroup but received %T instead", hub) - } - - return group.AssignProperties_To_NamespacesEventhubsConsumerGroup(destination) -} - -// +kubebuilder:webhook:path=/mutate-eventhub-azure-com-v1api20240101-namespaceseventhubsconsumergroup,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.namespaceseventhubsconsumergroups.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Defaulter = &NamespacesEventhubsConsumerGroup{} - -// Default applies defaults to the NamespacesEventhubsConsumerGroup resource -func (group *NamespacesEventhubsConsumerGroup) Default() { - group.defaultImpl() - var temp any = group - if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { - runtimeDefaulter.CustomDefault() - } -} - -// defaultAzureName defaults the Azure name of the resource to the Kubernetes name -func (group *NamespacesEventhubsConsumerGroup) defaultAzureName() { - if group.Spec.AzureName == "" { - group.Spec.AzureName = group.Name - } -} - -// defaultImpl applies the code generated defaults to the NamespacesEventhubsConsumerGroup resource -func (group *NamespacesEventhubsConsumerGroup) defaultImpl() { group.defaultAzureName() } - -var _ genruntime.ImportableResource = &NamespacesEventhubsConsumerGroup{} - -// InitializeSpec initializes the spec for this resource from the given status -func (group *NamespacesEventhubsConsumerGroup) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { - return group.Spec.Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Eventhubs_Consumergroup_STATUS but received %T instead", status) -} - -var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} - -// AzureName returns the Azure name of the resource -func (group *NamespacesEventhubsConsumerGroup) AzureName() string { - return group.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (group NamespacesEventhubsConsumerGroup) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (group *NamespacesEventhubsConsumerGroup) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (group *NamespacesEventhubsConsumerGroup) GetSpec() genruntime.ConvertibleSpec { - return &group.Spec -} - -// GetStatus returns the status of this resource -func (group *NamespacesEventhubsConsumerGroup) GetStatus() genruntime.ConvertibleStatus { - return &group.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (group *NamespacesEventhubsConsumerGroup) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/consumergroups" -func (group *NamespacesEventhubsConsumerGroup) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs/consumergroups" -} - -// NewEmptyStatus returns a new empty (blank) status -func (group *NamespacesEventhubsConsumerGroup) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_Eventhubs_Consumergroup_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (group *NamespacesEventhubsConsumerGroup) Owner() *genruntime.ResourceReference { - ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) - return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) -} - -// SetStatus sets the status of this resource -func (group *NamespacesEventhubsConsumerGroup) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { - group.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_Eventhubs_Consumergroup_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - group.Status = st - return nil -} - -// +kubebuilder:webhook:path=/validate-eventhub-azure-com-v1api20240101-namespaceseventhubsconsumergroup,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.namespaceseventhubsconsumergroups.eventhub.azure.com,admissionReviewVersions=v1 - -var _ admission.Validator = &NamespacesEventhubsConsumerGroup{} - -// ValidateCreate validates the creation of the resource -func (group *NamespacesEventhubsConsumerGroup) ValidateCreate() (admission.Warnings, error) { - validations := group.createValidations() - var temp any = group - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.CreateValidations()...) - } - return genruntime.ValidateCreate(validations) -} - -// ValidateDelete validates the deletion of the resource -func (group *NamespacesEventhubsConsumerGroup) ValidateDelete() (admission.Warnings, error) { - validations := group.deleteValidations() - var temp any = group - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.DeleteValidations()...) - } - return genruntime.ValidateDelete(validations) -} - -// ValidateUpdate validates an update of the resource -func (group *NamespacesEventhubsConsumerGroup) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { - validations := group.updateValidations() - var temp any = group - if runtimeValidator, ok := temp.(genruntime.Validator); ok { - validations = append(validations, runtimeValidator.UpdateValidations()...) - } - return genruntime.ValidateUpdate(old, validations) -} - -// createValidations validates the creation of the resource -func (group *NamespacesEventhubsConsumerGroup) createValidations() []func() (admission.Warnings, error) { - return []func() (admission.Warnings, error){group.validateResourceReferences, group.validateOwnerReference} -} - -// deleteValidations validates the deletion of the resource -func (group *NamespacesEventhubsConsumerGroup) deleteValidations() []func() (admission.Warnings, error) { - return nil -} - -// updateValidations validates the update of the resource -func (group *NamespacesEventhubsConsumerGroup) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { - return []func(old runtime.Object) (admission.Warnings, error){ - func(old runtime.Object) (admission.Warnings, error) { - return group.validateResourceReferences() - }, - group.validateWriteOnceProperties, - func(old runtime.Object) (admission.Warnings, error) { - return group.validateOwnerReference() - }, - } -} - -// validateOwnerReference validates the owner field -func (group *NamespacesEventhubsConsumerGroup) validateOwnerReference() (admission.Warnings, error) { - return genruntime.ValidateOwner(group) -} - -// validateResourceReferences validates all resource references -func (group *NamespacesEventhubsConsumerGroup) validateResourceReferences() (admission.Warnings, error) { - refs, err := reflecthelpers.FindResourceReferences(&group.Spec) - if err != nil { - return nil, err - } - return genruntime.ValidateResourceReferences(refs) -} - -// validateWriteOnceProperties validates all WriteOnce properties -func (group *NamespacesEventhubsConsumerGroup) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { - oldObj, ok := old.(*NamespacesEventhubsConsumerGroup) - if !ok { - return nil, nil - } - - return genruntime.ValidateWriteOnceProperties(oldObj, group) -} - -// AssignProperties_From_NamespacesEventhubsConsumerGroup populates our NamespacesEventhubsConsumerGroup from the provided source NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) AssignProperties_From_NamespacesEventhubsConsumerGroup(source *v20240101s.NamespacesEventhubsConsumerGroup) error { - - // ObjectMeta - group.ObjectMeta = *source.ObjectMeta.DeepCopy() - - // Spec - var spec Namespaces_Eventhubs_Consumergroup_Spec - err := spec.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&source.Spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") - } - group.Spec = spec - - // Status - var status Namespaces_Eventhubs_Consumergroup_STATUS - err = status.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&source.Status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") - } - group.Status = status - - // No error - return nil -} - -// AssignProperties_To_NamespacesEventhubsConsumerGroup populates the provided destination NamespacesEventhubsConsumerGroup from our NamespacesEventhubsConsumerGroup -func (group *NamespacesEventhubsConsumerGroup) AssignProperties_To_NamespacesEventhubsConsumerGroup(destination *v20240101s.NamespacesEventhubsConsumerGroup) error { - - // ObjectMeta - destination.ObjectMeta = *group.ObjectMeta.DeepCopy() - - // Spec - var spec v20240101s.Namespaces_Eventhubs_Consumergroup_Spec - err := group.Spec.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&spec) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec() to populate field Spec") - } - destination.Spec = spec - - // Status - var status v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS - err = group.Status.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&status) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS() to populate field Status") - } - destination.Status = status - - // No error - return nil -} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (group *NamespacesEventhubsConsumerGroup) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: group.Spec.OriginalVersion(), - Kind: "NamespacesEventhubsConsumerGroup", - } -} - -// +kubebuilder:object:root=true -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} -type NamespacesEventhubsConsumerGroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesEventhubsConsumerGroup `json:"items"` -} - -type Namespaces_Eventhubs_Consumergroup_Spec struct { - // +kubebuilder:validation:MaxLength=50 - // +kubebuilder:validation:MinLength=1 - // 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"` - - // +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 eventhub.azure.com/NamespacesEventhub resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` - - // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be - // used to store descriptive data, such as list of teams and their contact information also user-defined configuration - // settings can be stored. - UserMetadata *string `json:"userMetadata,omitempty"` -} - -var _ genruntime.ARMTransformer = &Namespaces_Eventhubs_Consumergroup_Spec{} - -// ConvertToARM converts from a Kubernetes CRD object to an ARM object -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { - if consumergroup == nil { - return nil, nil - } - result := &Namespaces_Eventhubs_Consumergroup_Spec_ARM{} - - // Set property "Name": - result.Name = resolved.Name - - // Set property "Properties": - if consumergroup.UserMetadata != nil { - result.Properties = &Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM{} - } - if consumergroup.UserMetadata != nil { - userMetadata := *consumergroup.UserMetadata - result.Properties.UserMetadata = &userMetadata - } - return result, nil -} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_Eventhubs_Consumergroup_Spec_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_Eventhubs_Consumergroup_Spec_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_Consumergroup_Spec_ARM, got %T", armInput) - } - - // Set property "AzureName": - consumergroup.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) - - // Set property "Owner": - consumergroup.Owner = &genruntime.KnownResourceReference{ - Name: owner.Name, - ARMID: owner.ARMID, - } - - // Set property "UserMetadata": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.UserMetadata != nil { - userMetadata := *typedInput.Properties.UserMetadata - consumergroup.UserMetadata = &userMetadata - } - } - - // No error - return nil -} - -var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_Consumergroup_Spec{} - -// ConvertSpecFrom populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) - if ok { - // Populate our instance from source - return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} - err := src.ConvertSpecFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") - } - - // Update our instance from src - err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") - } - - return nil -} - -// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_Spec -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) - if ok { - // Populate destination from our instance - return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_Spec{} - err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(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 -} - -// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_Spec -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(source *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { - - // AzureName - consumergroup.AzureName = source.AzureName - - // Owner - if source.Owner != nil { - owner := source.Owner.Copy() - consumergroup.Owner = &owner - } else { - consumergroup.Owner = nil - } - - // UserMetadata - consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec populates the provided destination Namespaces_Eventhubs_Consumergroup_Spec from our Namespaces_Eventhubs_Consumergroup_Spec -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_Spec) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // AzureName - destination.AzureName = consumergroup.AzureName - - // OriginalVersion - destination.OriginalVersion = consumergroup.OriginalVersion() - - // Owner - if consumergroup.Owner != nil { - owner := consumergroup.Owner.Copy() - destination.Owner = &owner - } else { - destination.Owner = nil - } - - // UserMetadata - destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -// Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) Initialize_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *Namespaces_Eventhubs_Consumergroup_STATUS) error { - - // UserMetadata - consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) - - // No error - return nil -} - -// OriginalVersion returns the original API version used to create the resource. -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) OriginalVersion() string { - return GroupVersion.Version -} - -// SetAzureName sets the Azure name of the resource -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) SetAzureName(azureName string) { - consumergroup.AzureName = azureName -} - -type Namespaces_Eventhubs_Consumergroup_STATUS struct { - // Conditions: The observed state of the resource - Conditions []conditions.Condition `json:"conditions,omitempty"` - - // CreatedAt: Exact time the message was created. - CreatedAt *string `json:"createdAt,omitempty"` - - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` - - // UpdatedAt: The exact time the message was updated. - UpdatedAt *string `json:"updatedAt,omitempty"` - - // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be - // used to store descriptive data, such as list of teams and their contact information also user-defined configuration - // settings can be stored. - UserMetadata *string `json:"userMetadata,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_Consumergroup_STATUS{} - -// ConvertStatusFrom populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - src, ok := source.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) - if ok { - // Populate our instance from source - return consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) - } - - // Convert to an intermediate form - src = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} - err := src.ConvertStatusFrom(source) - if err != nil { - return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") - } - - // Update our instance from src - err = consumergroup.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(src) - if err != nil { - return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") - } - - return nil -} - -// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - dst, ok := destination.(*v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) - if ok { - // Populate destination from our instance - return consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(dst) - } - - // Convert to an intermediate form - dst = &v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS{} - err := consumergroup.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(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 = &Namespaces_Eventhubs_Consumergroup_STATUS{} - -// NewEmptyARMValue returns an empty ARM value suitable for deserializing into -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { - return &Namespaces_Eventhubs_Consumergroup_STATUS_ARM{} -} - -// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { - typedInput, ok := armInput.(Namespaces_Eventhubs_Consumergroup_STATUS_ARM) - if !ok { - return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Eventhubs_Consumergroup_STATUS_ARM, got %T", armInput) - } - - // no assignment for property "Conditions" - - // Set property "CreatedAt": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.CreatedAt != nil { - createdAt := *typedInput.Properties.CreatedAt - consumergroup.CreatedAt = &createdAt - } - } - - // Set property "Id": - if typedInput.Id != nil { - id := *typedInput.Id - consumergroup.Id = &id - } - - // Set property "Location": - if typedInput.Location != nil { - location := *typedInput.Location - consumergroup.Location = &location - } - - // Set property "Name": - if typedInput.Name != nil { - name := *typedInput.Name - consumergroup.Name = &name - } - - // Set property "SystemData": - if typedInput.SystemData != nil { - var systemData1 SystemData_STATUS - err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) - if err != nil { - return err - } - systemData := systemData1 - consumergroup.SystemData = &systemData - } - - // Set property "Type": - if typedInput.Type != nil { - typeVar := *typedInput.Type - consumergroup.Type = &typeVar - } - - // Set property "UpdatedAt": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.UpdatedAt != nil { - updatedAt := *typedInput.Properties.UpdatedAt - consumergroup.UpdatedAt = &updatedAt - } - } - - // Set property "UserMetadata": - // copying flattened property: - if typedInput.Properties != nil { - if typedInput.Properties.UserMetadata != nil { - userMetadata := *typedInput.Properties.UserMetadata - consumergroup.UserMetadata = &userMetadata - } - } - - // No error - return nil -} - -// AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(source *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { - - // Conditions - consumergroup.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) - - // CreatedAt - consumergroup.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) - - // Id - consumergroup.Id = genruntime.ClonePointerToString(source.Id) - - // Location - consumergroup.Location = genruntime.ClonePointerToString(source.Location) - - // Name - consumergroup.Name = genruntime.ClonePointerToString(source.Name) - - // SystemData - if source.SystemData != nil { - var systemDatum SystemData_STATUS - err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData") - } - consumergroup.SystemData = &systemDatum - } else { - consumergroup.SystemData = nil - } - - // Type - consumergroup.Type = genruntime.ClonePointerToString(source.Type) - - // UpdatedAt - consumergroup.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) - - // UserMetadata - consumergroup.UserMetadata = genruntime.ClonePointerToString(source.UserMetadata) - - // No error - return nil -} - -// AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS populates the provided destination Namespaces_Eventhubs_Consumergroup_STATUS from our Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(destination *v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS) error { - // Create a new property bag - propertyBag := genruntime.NewPropertyBag() - - // Conditions - destination.Conditions = genruntime.CloneSliceOfCondition(consumergroup.Conditions) - - // CreatedAt - destination.CreatedAt = genruntime.ClonePointerToString(consumergroup.CreatedAt) - - // Id - destination.Id = genruntime.ClonePointerToString(consumergroup.Id) - - // Location - destination.Location = genruntime.ClonePointerToString(consumergroup.Location) - - // Name - destination.Name = genruntime.ClonePointerToString(consumergroup.Name) - - // SystemData - if consumergroup.SystemData != nil { - var systemDatum v20240101s.SystemData_STATUS - err := consumergroup.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) - if err != nil { - return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") - } - destination.SystemData = &systemDatum - } else { - destination.SystemData = nil - } - - // Type - destination.Type = genruntime.ClonePointerToString(consumergroup.Type) - - // UpdatedAt - destination.UpdatedAt = genruntime.ClonePointerToString(consumergroup.UpdatedAt) - - // UserMetadata - destination.UserMetadata = genruntime.ClonePointerToString(consumergroup.UserMetadata) - - // Update the property bag - if len(propertyBag) > 0 { - destination.PropertyBag = propertyBag - } else { - destination.PropertyBag = nil - } - - // No error - return nil -} - -func init() { - SchemeBuilder.Register(&NamespacesEventhubsConsumerGroup{}, &NamespacesEventhubsConsumerGroupList{}) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go deleted file mode 100644 index 0223bf1c089..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumer_group_types_gen_test.go +++ /dev/null @@ -1,393 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import ( - "encoding/json" - v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesEventhubsConsumerGroup_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - parameters.MinSuccessfulTests = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsConsumerGroup to hub returns original", - prop.ForAll(RunResourceConversionTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunResourceConversionTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup round trips to the hub storage version and back losslessly -func RunResourceConversionTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { - // Copy subject to make sure conversion doesn't modify it - copied := subject.DeepCopy() - - // Convert to our hub version - var hub v20240101s.NamespacesEventhubsConsumerGroup - err := copied.ConvertTo(&hub) - if err != nil { - return err.Error() - } - - // Convert from our hub version - var actual NamespacesEventhubsConsumerGroup - 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_NamespacesEventhubsConsumerGroup_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from NamespacesEventhubsConsumerGroup to NamespacesEventhubsConsumerGroup via AssignProperties_To_NamespacesEventhubsConsumerGroup & AssignProperties_From_NamespacesEventhubsConsumerGroup returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup tests if a specific instance of NamespacesEventhubsConsumerGroup can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { - // Copy subject to make sure assignment doesn't modify it - copied := subject.DeepCopy() - - // Use AssignPropertiesTo() for the first stage of conversion - var other v20240101s.NamespacesEventhubsConsumerGroup - err := copied.AssignProperties_To_NamespacesEventhubsConsumerGroup(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual NamespacesEventhubsConsumerGroup - err = actual.AssignProperties_From_NamespacesEventhubsConsumerGroup(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_NamespacesEventhubsConsumerGroup_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsConsumerGroup via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsConsumerGroup runs a test to see if a specific instance of NamespacesEventhubsConsumerGroup round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsConsumerGroup - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsConsumerGroup instances for property testing - lazily instantiated by -// NamespacesEventhubsConsumerGroupGenerator() -var namespacesEventhubsConsumerGroupGenerator gopter.Gen - -// NamespacesEventhubsConsumerGroupGenerator returns a generator of NamespacesEventhubsConsumerGroup instances for property testing. -func NamespacesEventhubsConsumerGroupGenerator() gopter.Gen { - if namespacesEventhubsConsumerGroupGenerator != nil { - return namespacesEventhubsConsumerGroupGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(generators) - namespacesEventhubsConsumerGroupGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsConsumerGroup{}), generators) - - return namespacesEventhubsConsumerGroupGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_Eventhubs_Consumergroup_SpecGenerator() - gens["Status"] = Namespaces_Eventhubs_Consumergroup_STATUSGenerator() -} - -func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_Consumergroup_Spec to Namespaces_Eventhubs_Consumergroup_Spec via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec tests if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_Spec - err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_Spec(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_Consumergroup_Spec - err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_Spec(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_Spec instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_Consumergroup_SpecGenerator() -var namespaces_Eventhubs_Consumergroup_SpecGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_SpecGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Spec instances for property testing. -func Namespaces_Eventhubs_Consumergroup_SpecGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_SpecGenerator != nil { - return namespaces_Eventhubs_Consumergroup_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(generators) - namespaces_Eventhubs_Consumergroup_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec{}), generators) - - return namespaces_Eventhubs_Consumergroup_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MaxSize = 10 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip from Namespaces_Eventhubs_Consumergroup_STATUS to Namespaces_Eventhubs_Consumergroup_STATUS via AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS & AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS returns original", - prop.ForAll(RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) -} - -// RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS tests if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS can be assigned to storage and back losslessly -func RunPropertyAssignmentTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_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 v20240101s.Namespaces_Eventhubs_Consumergroup_STATUS - err := copied.AssignProperties_To_Namespaces_Eventhubs_Consumergroup_STATUS(&other) - if err != nil { - return err.Error() - } - - // Use AssignPropertiesFrom() to convert back to our original type - var actual Namespaces_Eventhubs_Consumergroup_STATUS - err = actual.AssignProperties_From_Namespaces_Eventhubs_Consumergroup_STATUS(&other) - if err != nil { - return err.Error() - } - - // Check for a match - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_Consumergroup_STATUSGenerator() -var namespaces_Eventhubs_Consumergroup_STATUSGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_STATUSGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing. -// We first initialize namespaces_Eventhubs_Consumergroup_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhubs_Consumergroup_STATUSGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_STATUSGenerator != nil { - return namespaces_Eventhubs_Consumergroup_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) - namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) - namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) - - return namespaces_Eventhubs_Consumergroup_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go deleted file mode 100644 index 709f505208d..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - -type Namespaces_Eventhubs_Consumergroup_Spec_ARM struct { - Name string `json:"name,omitempty"` - - // Properties: Single item in List or Get Consumer group operation - Properties *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM `json:"properties,omitempty"` -} - -var _ genruntime.ARMResourceSpec = &Namespaces_Eventhubs_Consumergroup_Spec_ARM{} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (consumergroup Namespaces_Eventhubs_Consumergroup_Spec_ARM) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetName returns the Name of the resource -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec_ARM) GetName() string { - return consumergroup.Name -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/consumergroups" -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec_ARM) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs/consumergroups" -} - -type Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM struct { - // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be - // used to store descriptive data, such as list of teams and their contact information also user-defined configuration - // settings can be stored. - UserMetadata *string `json:"userMetadata,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go deleted file mode 100644 index 5f8ba2cf39d..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_spec_arm_types_gen_test.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_Eventhubs_Consumergroup_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec_ARM, Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec_ARM(subject Namespaces_Eventhubs_Consumergroup_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_Consumergroup_Spec_ARM instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator() -var namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Spec_ARM instances for property testing. -// We first initialize namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator 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 Namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator != nil { - return namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(generators) - namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(generators) - namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec_ARM{}), generators) - - return namespaces_Eventhubs_Consumergroup_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(gens map[string]gopter.Gen) { - gens["Name"] = gen.AlphaString() -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator()) -} - -func Test_Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM, Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM(subject Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM instances for property testing - lazily -// instantiated by Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator() -var namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM instances for property testing. -func Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator != nil { - return namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM(generators) - namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM{}), generators) - - return namespaces_Eventhubs_Consumergroup_Properties_Spec_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_Spec_ARM(gens map[string]gopter.Gen) { - gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go deleted file mode 100644 index df4cab0a031..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -type Namespaces_Eventhubs_Consumergroup_STATUS_ARM struct { - // Id: Fully qualified resource ID for the resource. Ex - - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - Id *string `json:"id,omitempty"` - - // Location: The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Name: The name of the resource - Name *string `json:"name,omitempty"` - - // Properties: Single item in List or Get Consumer group operation - Properties *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM `json:"properties,omitempty"` - - // SystemData: The system meta data relating to this resource. - SystemData *SystemData_STATUS_ARM `json:"systemData,omitempty"` - - // Type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" - Type *string `json:"type,omitempty"` -} - -type Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM struct { - // CreatedAt: Exact time the message was created. - CreatedAt *string `json:"createdAt,omitempty"` - - // UpdatedAt: The exact time the message was updated. - UpdatedAt *string `json:"updatedAt,omitempty"` - - // UserMetadata: User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be - // used to store descriptive data, such as list of teams and their contact information also user-defined configuration - // settings can be stored. - UserMetadata *string `json:"userMetadata,omitempty"` -} diff --git a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go b/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go deleted file mode 100644 index 670dacf5474..00000000000 --- a/v2/api/eventhub/v1api20240101/namespaces_eventhubs_consumergroup_status_arm_types_gen_test.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package v1api20240101 - -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_Namespaces_Eventhubs_Consumergroup_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS_ARM, Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(subject Namespaces_Eventhubs_Consumergroup_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_Consumergroup_STATUS_ARM instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator() -var namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_STATUS_ARM instances for property testing. -// We first initialize namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator 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 Namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator != nil { - return namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(generators) - namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS_ARM{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(generators) - namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS_ARM{}), generators) - - return namespaces_Eventhubs_Consumergroup_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS_ARM(gens map[string]gopter.Gen) { - gens["Properties"] = gen.PtrOf(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) -} - -func Test_Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM, Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM(subject Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM instances for property testing - lazily -// instantiated by Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator() -var namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM instances for property testing. -func Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator != nil { - return namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM(generators) - namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM{}), generators) - - return namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARMGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go b/v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go deleted file mode 100644 index acfd7c792f8..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/groupversion_info_gen.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (c) Microsoft Corporation. -Licensed under the MIT license. -*/ - -// Code generated by azure-service-operator-codegen. DO NOT EDIT. - -// Package storage contains API Schema definitions for the eventhub storage API group -// +kubebuilder:object:generate=true -// All object properties are optional by default, this will be overridden when needed: -// +kubebuilder:validation:Optional -// +groupName=eventhub.azure.com -// +versionName=v1api20240101storage -package storage - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "eventhub.azure.com", Version: "v1api20240101storage"} - - // 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/eventhub/v1api20240101/storage/namespace_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespace_types_gen.go deleted file mode 100644 index 73920897f91..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespace_types_gen.go +++ /dev/null @@ -1,391 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaces,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaces/status,namespaces/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 v1api20240101.Namespace -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} -type Namespace struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespace_Spec `json:"spec,omitempty"` - Status Namespace_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &Namespace{} - -// GetConditions returns the conditions of the resource -func (namespace *Namespace) GetConditions() conditions.Conditions { - return namespace.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (namespace *Namespace) SetConditions(conditions conditions.Conditions) { - namespace.Status.Conditions = conditions -} - -var _ genruntime.KubernetesResource = &Namespace{} - -// AzureName returns the Azure name of the resource -func (namespace *Namespace) AzureName() string { - return namespace.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (namespace Namespace) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (namespace *Namespace) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (namespace *Namespace) GetSpec() genruntime.ConvertibleSpec { - return &namespace.Spec -} - -// GetStatus returns the status of this resource -func (namespace *Namespace) GetStatus() genruntime.ConvertibleStatus { - return &namespace.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (namespace *Namespace) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces" -func (namespace *Namespace) GetType() string { - return "Microsoft.EventHub/namespaces" -} - -// NewEmptyStatus returns a new empty (blank) status -func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespace_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (namespace *Namespace) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) - return namespace.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespace_STATUS); ok { - namespace.Status = *st - return nil - } - - // Convert status to required version - var st Namespace_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - namespace.Status = st - return nil -} - -// Hub marks that this Namespace is the hub type for conversion -func (namespace *Namespace) Hub() {} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: namespace.Spec.OriginalVersion, - Kind: "Namespace", - } -} - -// +kubebuilder:object:root=true -// Storage version of v1api20240101.Namespace -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} -type NamespaceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Namespace `json:"items"` -} - -// Storage version of v1api20240101.APIVersion -// +kubebuilder:validation:Enum={"2024-01-01"} -type APIVersion string - -const APIVersion_Value = APIVersion("2024-01-01") - -// Storage version of v1api20240101.Namespace_Spec -type Namespace_Spec struct { - AlternateName *string `json:"alternateName,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"` - - // ClusterArmReference: Cluster ARM ID of the Namespace. - ClusterArmReference *genruntime.ResourceReference `armReference:"ClusterArmId" json:"clusterArmReference,omitempty"` - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - Identity *Identity `json:"identity,omitempty"` - IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` - KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` - Location *string `json:"location,omitempty"` - MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` - MinimumTlsVersion *string `json:"minimumTlsVersion,omitempty"` - OperatorSpec *NamespaceOperatorSpec `json:"operatorSpec,omitempty"` - OriginalVersion string `json:"originalVersion,omitempty"` - - // +kubebuilder:validation:Required - // Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also - // controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a - // reference to a resources.azure.com/ResourceGroup resource - Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -var _ genruntime.ConvertibleSpec = &Namespace_Spec{} - -// ConvertSpecFrom populates our Namespace_Spec from the provided source -func (namespace *Namespace_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return source.ConvertSpecTo(namespace) -} - -// ConvertSpecTo populates the provided destination from our Namespace_Spec -func (namespace *Namespace_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return destination.ConvertSpecFrom(namespace) -} - -// Storage version of v1api20240101.Namespace_STATUS -type Namespace_STATUS struct { - AlternateName *string `json:"alternateName,omitempty"` - ClusterArmId *string `json:"clusterArmId,omitempty"` - Conditions []conditions.Condition `json:"conditions,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - Encryption *Encryption_STATUS `json:"encryption,omitempty"` - Id *string `json:"id,omitempty"` - Identity *Identity_STATUS `json:"identity,omitempty"` - IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` - KafkaEnabled *bool `json:"kafkaEnabled,omitempty"` - Location *string `json:"location,omitempty"` - MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"` - MetricId *string `json:"metricId,omitempty"` - MinimumTlsVersion *string `json:"minimumTlsVersion,omitempty"` - Name *string `json:"name,omitempty"` - PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` - ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` - Sku *Sku_STATUS `json:"sku,omitempty"` - Status *string `json:"status,omitempty"` - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespace_STATUS{} - -// ConvertStatusFrom populates our Namespace_STATUS from the provided source -func (namespace *Namespace_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return source.ConvertStatusTo(namespace) -} - -// ConvertStatusTo populates the provided destination from our Namespace_STATUS -func (namespace *Namespace_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == namespace { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return destination.ConvertStatusFrom(namespace) -} - -// Storage version of v1api20240101.Encryption -// Properties to configure Encryption -type Encryption struct { - KeySource *string `json:"keySource,omitempty"` - KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -// Storage version of v1api20240101.Encryption_STATUS -// Properties to configure Encryption -type Encryption_STATUS struct { - KeySource *string `json:"keySource,omitempty"` - KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` -} - -// Storage version of v1api20240101.Identity -// Properties to configure Identity for Bring your Own Keys -type Identity struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Type *string `json:"type,omitempty"` - UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` -} - -// Storage version of v1api20240101.Identity_STATUS -// Properties to configure Identity for Bring your Own Keys -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 v1api20240101.NamespaceOperatorSpec -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type NamespaceOperatorSpec struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` -} - -// Storage version of v1api20240101.PrivateEndpointConnection_STATUS -// Properties of the PrivateEndpointConnection. -type PrivateEndpointConnection_STATUS struct { - Id *string `json:"id,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// Storage version of v1api20240101.Sku -// SKU parameters supplied to the create namespace operation -type Sku struct { - Capacity *int `json:"capacity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Tier *string `json:"tier,omitempty"` -} - -// Storage version of v1api20240101.Sku_STATUS -// SKU parameters supplied to the create namespace operation -type Sku_STATUS struct { - Capacity *int `json:"capacity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Tier *string `json:"tier,omitempty"` -} - -// Storage version of v1api20240101.SystemData_STATUS -// Metadata pertaining to creation and last modification of the resource. -type SystemData_STATUS struct { - CreatedAt *string `json:"createdAt,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - CreatedByType *string `json:"createdByType,omitempty"` - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedByType *string `json:"lastModifiedByType,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// Storage version of v1api20240101.KeyVaultProperties -// Properties to configure keyVault Properties -type KeyVaultProperties struct { - Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// Storage version of v1api20240101.KeyVaultProperties_STATUS -// Properties to configure keyVault Properties -type KeyVaultProperties_STATUS struct { - Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVaultUri *string `json:"keyVaultUri,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// Storage version of v1api20240101.NamespaceOperatorSecrets -type NamespaceOperatorSecrets struct { - PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -// Storage version of v1api20240101.UserAssignedIdentity_STATUS -// Recognized Dictionary value. -type UserAssignedIdentity_STATUS struct { - ClientId *string `json:"clientId,omitempty"` - PrincipalId *string `json:"principalId,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` -} - -// Storage version of v1api20240101.UserAssignedIdentityDetails -// Information about the user assigned identity for the resource -type UserAssignedIdentityDetails struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` -} - -// Storage version of v1api20240101.UserAssignedIdentityProperties -type UserAssignedIdentityProperties struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - - // UserAssignedIdentityReference: ARM ID of user Identity selected for encryption - UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` -} - -// Storage version of v1api20240101.UserAssignedIdentityProperties_STATUS -type UserAssignedIdentityProperties_STATUS struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} - -func init() { - SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go deleted file mode 100644 index 0811bd0e68b..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespace_types_gen_test.go +++ /dev/null @@ -1,1316 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "encoding/json" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_Namespace_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace, NamespaceGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace runs a test to see if a specific instance of Namespace round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace(subject Namespace) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Namespace instances for property testing - lazily instantiated by NamespaceGenerator() -var namespaceGenerator gopter.Gen - -// NamespaceGenerator returns a generator of Namespace instances for property testing. -func NamespaceGenerator() gopter.Gen { - if namespaceGenerator != nil { - return namespaceGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespace(generators) - namespaceGenerator = gen.Struct(reflect.TypeOf(Namespace{}), generators) - - return namespaceGenerator -} - -// AddRelatedPropertyGeneratorsForNamespace is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace(gens map[string]gopter.Gen) { - gens["Spec"] = Namespace_SpecGenerator() - gens["Status"] = Namespace_STATUSGenerator() -} - -func Test_Namespace_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_Spec, Namespace_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_Spec runs a test to see if a specific instance of Namespace_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_Spec(subject Namespace_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_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 Namespace_Spec instances for property testing - lazily instantiated by Namespace_SpecGenerator() -var namespace_SpecGenerator gopter.Gen - -// Namespace_SpecGenerator returns a generator of Namespace_Spec instances for property testing. -// We first initialize namespace_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespace_SpecGenerator() gopter.Gen { - if namespace_SpecGenerator != nil { - return namespace_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Spec(generators) - namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_Spec(generators) - AddRelatedPropertyGeneratorsForNamespace_Spec(generators) - namespace_SpecGenerator = gen.Struct(reflect.TypeOf(Namespace_Spec{}), generators) - - return namespace_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { - gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) - gens["AzureName"] = gen.AlphaString() - gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) - gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) - gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) - gens["MinimumTlsVersion"] = gen.PtrOf(gen.AlphaString()) - gens["OriginalVersion"] = gen.AlphaString() - gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString()) - gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) - gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { - gens["Encryption"] = gen.PtrOf(EncryptionGenerator()) - gens["Identity"] = gen.PtrOf(IdentityGenerator()) - gens["OperatorSpec"] = gen.PtrOf(NamespaceOperatorSpecGenerator()) - gens["Sku"] = gen.PtrOf(SkuGenerator()) -} - -func Test_Namespace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespace_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespace_STATUS, Namespace_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespace_STATUS runs a test to see if a specific instance of Namespace_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespace_STATUS(subject Namespace_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespace_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 Namespace_STATUS instances for property testing - lazily instantiated by Namespace_STATUSGenerator() -var namespace_STATUSGenerator gopter.Gen - -// Namespace_STATUSGenerator returns a generator of Namespace_STATUS instances for property testing. -// We first initialize namespace_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespace_STATUSGenerator() gopter.Gen { - if namespace_STATUSGenerator != nil { - return namespace_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) - namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespace_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespace_STATUS(generators) - namespace_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespace_STATUS{}), generators) - - return namespace_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { - gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) - gens["ClusterArmId"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["IsAutoInflateEnabled"] = gen.PtrOf(gen.Bool()) - gens["KafkaEnabled"] = gen.PtrOf(gen.Bool()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["MaximumThroughputUnits"] = gen.PtrOf(gen.Int()) - gens["MetricId"] = gen.PtrOf(gen.AlphaString()) - gens["MinimumTlsVersion"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) - gens["PublicNetworkAccess"] = gen.PtrOf(gen.AlphaString()) - gens["ServiceBusEndpoint"] = gen.PtrOf(gen.AlphaString()) - gens["Status"] = gen.PtrOf(gen.AlphaString()) - gens["Tags"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForNamespace_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { - gens["Encryption"] = gen.PtrOf(Encryption_STATUSGenerator()) - gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) - gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUSGenerator()) - gens["Sku"] = gen.PtrOf(Sku_STATUSGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_Encryption_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Encryption via JSON returns original", - prop.ForAll(RunJSONSerializationTestForEncryption, EncryptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForEncryption runs a test to see if a specific instance of Encryption round trips to JSON and back losslessly -func RunJSONSerializationTestForEncryption(subject Encryption) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Encryption - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Encryption instances for property testing - lazily instantiated by EncryptionGenerator() -var encryptionGenerator gopter.Gen - -// EncryptionGenerator returns a generator of Encryption instances for property testing. -// We first initialize encryptionGenerator 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 EncryptionGenerator() gopter.Gen { - if encryptionGenerator != nil { - return encryptionGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption(generators) - encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption(generators) - AddRelatedPropertyGeneratorsForEncryption(generators) - encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) - - return encryptionGenerator -} - -// AddIndependentPropertyGeneratorsForEncryption is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { - gens["KeySource"] = gen.PtrOf(gen.AlphaString()) - gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForEncryption is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { - gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) -} - -func Test_Encryption_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Encryption_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForEncryption_STATUS, Encryption_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForEncryption_STATUS runs a test to see if a specific instance of Encryption_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForEncryption_STATUS(subject Encryption_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Encryption_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 Encryption_STATUS instances for property testing - lazily instantiated by Encryption_STATUSGenerator() -var encryption_STATUSGenerator gopter.Gen - -// Encryption_STATUSGenerator returns a generator of Encryption_STATUS instances for property testing. -// We first initialize encryption_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Encryption_STATUSGenerator() gopter.Gen { - if encryption_STATUSGenerator != nil { - return encryption_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) - encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) - AddRelatedPropertyGeneratorsForEncryption_STATUS(generators) - encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) - - return encryption_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { - gens["KeySource"] = gen.PtrOf(gen.AlphaString()) - gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { - gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) -} - -func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Identity via JSON returns original", - prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly -func RunJSONSerializationTestForIdentity(subject Identity) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Identity - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() -var identityGenerator gopter.Gen - -// IdentityGenerator returns a generator of Identity instances for property testing. -// We first initialize identityGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func IdentityGenerator() gopter.Gen { - if identityGenerator != nil { - return identityGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity(generators) - identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity(generators) - AddRelatedPropertyGeneratorsForIdentity(generators) - identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) - - return identityGenerator -} - -// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { - gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) -} - -func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Identity_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Identity_STATUS - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() -var identity_STATUSGenerator gopter.Gen - -// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. -// We first initialize identity_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Identity_STATUSGenerator() gopter.Gen { - if identity_STATUSGenerator != nil { - return identity_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) - identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) - AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) - identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) - - return identity_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { - gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) - gens["TenantId"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { - gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), UserAssignedIdentity_STATUSGenerator()) -} - -func Test_NamespaceOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespaceOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaceOperatorSpec runs a test to see if a specific instance of NamespaceOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespaceOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespaceOperatorSpec instances for property testing - lazily instantiated by -// NamespaceOperatorSpecGenerator() -var namespaceOperatorSpecGenerator gopter.Gen - -// NamespaceOperatorSpecGenerator returns a generator of NamespaceOperatorSpec instances for property testing. -func NamespaceOperatorSpecGenerator() gopter.Gen { - if namespaceOperatorSpecGenerator != nil { - return namespaceOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(generators) - namespaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSpec{}), generators) - - return namespaceOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForNamespaceOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) -} - -func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of PrivateEndpointConnection_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForPrivateEndpointConnection_STATUS runs a test to see if a specific instance of PrivateEndpointConnection_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual PrivateEndpointConnection_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 PrivateEndpointConnection_STATUS instances for property testing - lazily instantiated by -// PrivateEndpointConnection_STATUSGenerator() -var privateEndpointConnection_STATUSGenerator gopter.Gen - -// PrivateEndpointConnection_STATUSGenerator returns a generator of PrivateEndpointConnection_STATUS instances for property testing. -func PrivateEndpointConnection_STATUSGenerator() gopter.Gen { - if privateEndpointConnection_STATUSGenerator != nil { - return privateEndpointConnection_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(generators) - privateEndpointConnection_STATUSGenerator = gen.Struct(reflect.TypeOf(PrivateEndpointConnection_STATUS{}), generators) - - return privateEndpointConnection_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_Sku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of 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["Capacity"] = gen.PtrOf(gen.Int()) - 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.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Sku_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSku_STATUS, Sku_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSku_STATUS runs a test to see if a specific instance of Sku_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForSku_STATUS(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 Sku_STATUSGenerator() -var sku_STATUSGenerator gopter.Gen - -// Sku_STATUSGenerator returns a generator of Sku_STATUS instances for property testing. -func Sku_STATUSGenerator() gopter.Gen { - if sku_STATUSGenerator != nil { - return sku_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForSku_STATUS(generators) - sku_STATUSGenerator = gen.Struct(reflect.TypeOf(Sku_STATUS{}), generators) - - return sku_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForSku_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForSku_STATUS(gens map[string]gopter.Gen) { - gens["Capacity"] = gen.PtrOf(gen.Int()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Tier"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of SystemData_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual SystemData_STATUS - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() -var systemData_STATUSGenerator gopter.Gen - -// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. -func SystemData_STATUSGenerator() gopter.Gen { - if systemData_STATUSGenerator != nil { - return systemData_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) - systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) - - return systemData_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) - gens["CreatedByType"] = gen.PtrOf(gen.AlphaString()) - gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) - gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) - gens["LastModifiedByType"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of 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. -// We first initialize keyVaultPropertiesGenerator 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 KeyVaultPropertiesGenerator() gopter.Gen { - if keyVaultPropertiesGenerator != nil { - return keyVaultPropertiesGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) - keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) - AddRelatedPropertyGeneratorsForKeyVaultProperties(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["KeyName"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) -} - -func Test_KeyVaultProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of KeyVaultProperties_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForKeyVaultProperties_STATUS runs a test to see if a specific instance of KeyVaultProperties_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForKeyVaultProperties_STATUS(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 -// KeyVaultProperties_STATUSGenerator() -var keyVaultProperties_STATUSGenerator gopter.Gen - -// KeyVaultProperties_STATUSGenerator returns a generator of KeyVaultProperties_STATUS instances for property testing. -// We first initialize keyVaultProperties_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func KeyVaultProperties_STATUSGenerator() gopter.Gen { - if keyVaultProperties_STATUSGenerator != nil { - return keyVaultProperties_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) - keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(generators) - AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(generators) - keyVaultProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties_STATUS{}), generators) - - return keyVaultProperties_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { - gens["KeyName"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) - gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) -} - -func Test_NamespaceOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespaceOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaceOperatorSecrets runs a test to see if a specific instance of NamespaceOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespaceOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespaceOperatorSecrets instances for property testing - lazily instantiated by -// NamespaceOperatorSecretsGenerator() -var namespaceOperatorSecretsGenerator gopter.Gen - -// NamespaceOperatorSecretsGenerator returns a generator of NamespaceOperatorSecrets instances for property testing. -func NamespaceOperatorSecretsGenerator() gopter.Gen { - if namespaceOperatorSecretsGenerator != nil { - return namespaceOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - namespaceOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSecrets{}), generators) - - return namespaceOperatorSecretsGenerator -} - -func Test_UserAssignedIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentity_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentity_STATUS runs a test to see if a specific instance of UserAssignedIdentity_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentity_STATUS(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 -// UserAssignedIdentity_STATUSGenerator() -var userAssignedIdentity_STATUSGenerator gopter.Gen - -// UserAssignedIdentity_STATUSGenerator returns a generator of UserAssignedIdentity_STATUS instances for property testing. -func UserAssignedIdentity_STATUSGenerator() gopter.Gen { - if userAssignedIdentity_STATUSGenerator != nil { - return userAssignedIdentity_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(generators) - userAssignedIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentity_STATUS{}), generators) - - return userAssignedIdentity_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForUserAssignedIdentity_STATUS(gens map[string]gopter.Gen) { - gens["ClientId"] = gen.PtrOf(gen.AlphaString()) - gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityDetails via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityDetails - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by -// UserAssignedIdentityDetailsGenerator() -var userAssignedIdentityDetailsGenerator gopter.Gen - -// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. -func UserAssignedIdentityDetailsGenerator() gopter.Gen { - if userAssignedIdentityDetailsGenerator != nil { - return userAssignedIdentityDetailsGenerator - } - - generators := make(map[string]gopter.Gen) - userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) - - return userAssignedIdentityDetailsGenerator -} - -func Test_UserAssignedIdentityProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityProperties via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityProperties runs a test to see if a specific instance of UserAssignedIdentityProperties round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityProperties - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of UserAssignedIdentityProperties instances for property testing - lazily instantiated by -// UserAssignedIdentityPropertiesGenerator() -var userAssignedIdentityPropertiesGenerator gopter.Gen - -// UserAssignedIdentityPropertiesGenerator returns a generator of UserAssignedIdentityProperties instances for property testing. -func UserAssignedIdentityPropertiesGenerator() gopter.Gen { - if userAssignedIdentityPropertiesGenerator != nil { - return userAssignedIdentityPropertiesGenerator - } - - generators := make(map[string]gopter.Gen) - userAssignedIdentityPropertiesGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties{}), generators) - - return userAssignedIdentityPropertiesGenerator -} - -func Test_UserAssignedIdentityProperties_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of UserAssignedIdentityProperties_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS runs a test to see if a specific instance of UserAssignedIdentityProperties_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS instances for property testing - lazily instantiated by -// UserAssignedIdentityProperties_STATUSGenerator() -var userAssignedIdentityProperties_STATUSGenerator gopter.Gen - -// UserAssignedIdentityProperties_STATUSGenerator returns a generator of UserAssignedIdentityProperties_STATUS instances for property testing. -func UserAssignedIdentityProperties_STATUSGenerator() gopter.Gen { - if userAssignedIdentityProperties_STATUSGenerator != nil { - return userAssignedIdentityProperties_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(generators) - userAssignedIdentityProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties_STATUS{}), generators) - - return userAssignedIdentityProperties_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(gens map[string]gopter.Gen) { - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go deleted file mode 100644 index edd4692a84c..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespacesauthorizationrules,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespacesauthorizationrules/status,namespacesauthorizationrules/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 v1api20240101.NamespacesAuthorizationRule -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} -type NamespacesAuthorizationRule struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_AuthorizationRule_Spec `json:"spec,omitempty"` - Status Namespaces_AuthorizationRule_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesAuthorizationRule{} - -// GetConditions returns the conditions of the resource -func (rule *NamespacesAuthorizationRule) GetConditions() conditions.Conditions { - return rule.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (rule *NamespacesAuthorizationRule) SetConditions(conditions conditions.Conditions) { - rule.Status.Conditions = conditions -} - -var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} - -// AzureName returns the Azure name of the resource -func (rule *NamespacesAuthorizationRule) AzureName() string { - return rule.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (rule NamespacesAuthorizationRule) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (rule *NamespacesAuthorizationRule) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (rule *NamespacesAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { - return &rule.Spec -} - -// GetStatus returns the status of this resource -func (rule *NamespacesAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { - return &rule.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (rule *NamespacesAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/authorizationRules" -func (rule *NamespacesAuthorizationRule) GetType() string { - return "Microsoft.EventHub/namespaces/authorizationRules" -} - -// NewEmptyStatus returns a new empty (blank) status -func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_AuthorizationRule_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) - return rule.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok { - rule.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_AuthorizationRule_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - rule.Status = st - return nil -} - -// Hub marks that this NamespacesAuthorizationRule is the hub type for conversion -func (rule *NamespacesAuthorizationRule) Hub() {} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: rule.Spec.OriginalVersion, - Kind: "NamespacesAuthorizationRule", - } -} - -// +kubebuilder:object:root=true -// Storage version of v1api20240101.NamespacesAuthorizationRule -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName} -type NamespacesAuthorizationRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesAuthorizationRule `json:"items"` -} - -// Storage version of v1api20240101.Namespaces_AuthorizationRule_Spec -type Namespaces_AuthorizationRule_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"` - OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `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 eventhub.azure.com/Namespace resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Rights []string `json:"rights,omitempty"` -} - -var _ genruntime.ConvertibleSpec = &Namespaces_AuthorizationRule_Spec{} - -// ConvertSpecFrom populates our Namespaces_AuthorizationRule_Spec from the provided source -func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return source.ConvertSpecTo(rule) -} - -// ConvertSpecTo populates the provided destination from our Namespaces_AuthorizationRule_Spec -func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return destination.ConvertSpecFrom(rule) -} - -// Storage version of v1api20240101.Namespaces_AuthorizationRule_STATUS -type Namespaces_AuthorizationRule_STATUS struct { - Conditions []conditions.Condition `json:"conditions,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Rights []string `json:"rights,omitempty"` - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_AuthorizationRule_STATUS{} - -// ConvertStatusFrom populates our Namespaces_AuthorizationRule_STATUS from the provided source -func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return source.ConvertStatusTo(rule) -} - -// ConvertStatusTo populates the provided destination from our Namespaces_AuthorizationRule_STATUS -func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return destination.ConvertStatusFrom(rule) -} - -// Storage version of v1api20240101.NamespacesAuthorizationRuleOperatorSpec -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type NamespacesAuthorizationRuleOperatorSpec struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` -} - -// Storage version of v1api20240101.NamespacesAuthorizationRuleOperatorSecrets -type NamespacesAuthorizationRuleOperatorSecrets struct { - PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -func init() { - SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go deleted file mode 100644 index bffb499b5ec..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go +++ /dev/null @@ -1,352 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "encoding/json" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesAuthorizationRule via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesAuthorizationRule runs a test to see if a specific instance of NamespacesAuthorizationRule round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesAuthorizationRule - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesAuthorizationRule instances for property testing - lazily instantiated by -// NamespacesAuthorizationRuleGenerator() -var namespacesAuthorizationRuleGenerator gopter.Gen - -// NamespacesAuthorizationRuleGenerator returns a generator of NamespacesAuthorizationRule instances for property testing. -func NamespacesAuthorizationRuleGenerator() gopter.Gen { - if namespacesAuthorizationRuleGenerator != nil { - return namespacesAuthorizationRuleGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(generators) - namespacesAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule{}), generators) - - return namespacesAuthorizationRuleGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_AuthorizationRule_SpecGenerator() - gens["Status"] = Namespaces_AuthorizationRule_STATUSGenerator() -} - -func Test_Namespaces_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec, Namespaces_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_AuthorizationRule_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_Spec(subject Namespaces_AuthorizationRule_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_Spec instances for property testing - lazily instantiated by -// Namespaces_AuthorizationRule_SpecGenerator() -var namespaces_AuthorizationRule_SpecGenerator gopter.Gen - -// Namespaces_AuthorizationRule_SpecGenerator returns a generator of Namespaces_AuthorizationRule_Spec instances for property testing. -// We first initialize namespaces_AuthorizationRule_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_AuthorizationRule_SpecGenerator() gopter.Gen { - if namespaces_AuthorizationRule_SpecGenerator != nil { - return namespaces_AuthorizationRule_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) - namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) - AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(generators) - namespaces_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Spec{}), generators) - - return namespaces_AuthorizationRule_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["OriginalVersion"] = gen.AlphaString() - gens["Rights"] = gen.SliceOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) -} - -func Test_Namespaces_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_AuthorizationRule_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS, Namespaces_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_AuthorizationRule_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_AuthorizationRule_STATUS(subject Namespaces_AuthorizationRule_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_AuthorizationRule_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 Namespaces_AuthorizationRule_STATUS instances for property testing - lazily instantiated by -// Namespaces_AuthorizationRule_STATUSGenerator() -var namespaces_AuthorizationRule_STATUSGenerator gopter.Gen - -// Namespaces_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_AuthorizationRule_STATUS instances for property testing. -// We first initialize namespaces_AuthorizationRule_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_AuthorizationRule_STATUSGenerator() gopter.Gen { - if namespaces_AuthorizationRule_STATUSGenerator != nil { - return namespaces_AuthorizationRule_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) - namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(generators) - namespaces_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_STATUS{}), generators) - - return namespaces_AuthorizationRule_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Rights"] = gen.SliceOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_NamespacesAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesAuthorizationRuleOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesAuthorizationRuleOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by -// NamespacesAuthorizationRuleOperatorSpecGenerator() -var namespacesAuthorizationRuleOperatorSpecGenerator gopter.Gen - -// NamespacesAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesAuthorizationRuleOperatorSpec instances for property testing. -func NamespacesAuthorizationRuleOperatorSpecGenerator() gopter.Gen { - if namespacesAuthorizationRuleOperatorSpecGenerator != nil { - return namespacesAuthorizationRuleOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(generators) - namespacesAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSpec{}), generators) - - return namespacesAuthorizationRuleOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) -} - -func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesAuthorizationRuleOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesAuthorizationRuleOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated by -// NamespacesAuthorizationRuleOperatorSecretsGenerator() -var namespacesAuthorizationRuleOperatorSecretsGenerator gopter.Gen - -// NamespacesAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesAuthorizationRuleOperatorSecrets instances for property testing. -func NamespacesAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { - if namespacesAuthorizationRuleOperatorSecretsGenerator != nil { - return namespacesAuthorizationRuleOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - namespacesAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRuleOperatorSecrets{}), generators) - - return namespacesAuthorizationRuleOperatorSecretsGenerator -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go deleted file mode 100644 index 2043d8c813a..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubs,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubs/status,namespaceseventhubs/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 v1api20240101.NamespacesEventhub -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} -type NamespacesEventhub struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_Eventhub_Spec `json:"spec,omitempty"` - Status Namespaces_Eventhub_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesEventhub{} - -// GetConditions returns the conditions of the resource -func (eventhub *NamespacesEventhub) GetConditions() conditions.Conditions { - return eventhub.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (eventhub *NamespacesEventhub) SetConditions(conditions conditions.Conditions) { - eventhub.Status.Conditions = conditions -} - -var _ genruntime.KubernetesResource = &NamespacesEventhub{} - -// AzureName returns the Azure name of the resource -func (eventhub *NamespacesEventhub) AzureName() string { - return eventhub.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (eventhub NamespacesEventhub) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (eventhub *NamespacesEventhub) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (eventhub *NamespacesEventhub) GetSpec() genruntime.ConvertibleSpec { - return &eventhub.Spec -} - -// GetStatus returns the status of this resource -func (eventhub *NamespacesEventhub) GetStatus() genruntime.ConvertibleStatus { - return &eventhub.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (eventhub *NamespacesEventhub) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs" -func (eventhub *NamespacesEventhub) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs" -} - -// NewEmptyStatus returns a new empty (blank) status -func (eventhub *NamespacesEventhub) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_Eventhub_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (eventhub *NamespacesEventhub) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(eventhub.Spec) - return eventhub.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (eventhub *NamespacesEventhub) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_Eventhub_STATUS); ok { - eventhub.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_Eventhub_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - eventhub.Status = st - return nil -} - -// Hub marks that this NamespacesEventhub is the hub type for conversion -func (eventhub *NamespacesEventhub) Hub() {} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (eventhub *NamespacesEventhub) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: eventhub.Spec.OriginalVersion, - Kind: "NamespacesEventhub", - } -} - -// +kubebuilder:object:root=true -// Storage version of v1api20240101.NamespacesEventhub -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} -type NamespacesEventhubList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesEventhub `json:"items"` -} - -// Storage version of v1api20240101.Namespaces_Eventhub_Spec -type Namespaces_Eventhub_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"` - CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"` - MessageRetentionInDays *int `json:"messageRetentionInDays,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 eventhub.azure.com/Namespace resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"Namespace"` - PartitionCount *int `json:"partitionCount,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RetentionDescription *RetentionDescription `json:"retentionDescription,omitempty"` -} - -var _ genruntime.ConvertibleSpec = &Namespaces_Eventhub_Spec{} - -// ConvertSpecFrom populates our Namespaces_Eventhub_Spec from the provided source -func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return source.ConvertSpecTo(eventhub) -} - -// ConvertSpecTo populates the provided destination from our Namespaces_Eventhub_Spec -func (eventhub *Namespaces_Eventhub_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return destination.ConvertSpecFrom(eventhub) -} - -// Storage version of v1api20240101.Namespaces_Eventhub_STATUS -type Namespaces_Eventhub_STATUS struct { - CaptureDescription *CaptureDescription_STATUS `json:"captureDescription,omitempty"` - Conditions []conditions.Condition `json:"conditions,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - MessageRetentionInDays *int `json:"messageRetentionInDays,omitempty"` - Name *string `json:"name,omitempty"` - PartitionCount *int `json:"partitionCount,omitempty"` - PartitionIds []string `json:"partitionIds,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RetentionDescription *RetentionDescription_STATUS `json:"retentionDescription,omitempty"` - Status *string `json:"status,omitempty"` - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_Eventhub_STATUS{} - -// ConvertStatusFrom populates our Namespaces_Eventhub_STATUS from the provided source -func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return source.ConvertStatusTo(eventhub) -} - -// ConvertStatusTo populates the provided destination from our Namespaces_Eventhub_STATUS -func (eventhub *Namespaces_Eventhub_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == eventhub { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return destination.ConvertStatusFrom(eventhub) -} - -// Storage version of v1api20240101.CaptureDescription -// Properties to configure capture description for eventhub -type CaptureDescription struct { - Destination *Destination `json:"destination,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Encoding *string `json:"encoding,omitempty"` - IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` - SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` -} - -// Storage version of v1api20240101.CaptureDescription_STATUS -// Properties to configure capture description for eventhub -type CaptureDescription_STATUS struct { - Destination *Destination_STATUS `json:"destination,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Encoding *string `json:"encoding,omitempty"` - IntervalInSeconds *int `json:"intervalInSeconds,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SizeLimitInBytes *int `json:"sizeLimitInBytes,omitempty"` - SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` -} - -// Storage version of v1api20240101.RetentionDescription -// Properties to configure retention settings for the eventhub -type RetentionDescription struct { - CleanupPolicy *string `json:"cleanupPolicy,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` - TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` -} - -// Storage version of v1api20240101.RetentionDescription_STATUS -// Properties to configure retention settings for the eventhub -type RetentionDescription_STATUS struct { - CleanupPolicy *string `json:"cleanupPolicy,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - RetentionTimeInHours *int `json:"retentionTimeInHours,omitempty"` - TombstoneRetentionTimeInHours *int `json:"tombstoneRetentionTimeInHours,omitempty"` -} - -// Storage version of v1api20240101.Destination -// Capture storage details for capture description -type Destination struct { - ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` - BlobContainer *string `json:"blobContainer,omitempty"` - DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` - DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` - DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` - Identity *CaptureIdentity `json:"identity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - - // StorageAccountResourceReference: Resource id of the storage account to be used to create the blobs - StorageAccountResourceReference *genruntime.ResourceReference `armReference:"StorageAccountResourceId" json:"storageAccountResourceReference,omitempty"` -} - -// Storage version of v1api20240101.Destination_STATUS -// Capture storage details for capture description -type Destination_STATUS struct { - ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` - BlobContainer *string `json:"blobContainer,omitempty"` - DataLakeAccountName *string `json:"dataLakeAccountName,omitempty"` - DataLakeFolderPath *string `json:"dataLakeFolderPath,omitempty"` - DataLakeSubscriptionId *string `json:"dataLakeSubscriptionId,omitempty"` - Identity *CaptureIdentity_STATUS `json:"identity,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - StorageAccountResourceId *string `json:"storageAccountResourceId,omitempty"` -} - -// Storage version of v1api20240101.CaptureIdentity -// A value that indicates whether capture description is enabled. -type CaptureIdentity struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Type *string `json:"type,omitempty"` - - // UserAssignedIdentityReference: ARM ID of Managed User Identity. This property is required is the type is - // UserAssignedIdentity. If type is SystemAssigned, then the System Assigned Identity Associated with the namespace will be - // used. - UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` -} - -// Storage version of v1api20240101.CaptureIdentity_STATUS -// A value that indicates whether capture description is enabled. -type CaptureIdentity_STATUS struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Type *string `json:"type,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} - -func init() { - SchemeBuilder.Register(&NamespacesEventhub{}, &NamespacesEventhubList{}) -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go deleted file mode 100644 index b55849cef9c..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhub_types_gen_test.go +++ /dev/null @@ -1,808 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "encoding/json" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesEventhub_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhub via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhub, NamespacesEventhubGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhub runs a test to see if a specific instance of NamespacesEventhub round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhub(subject NamespacesEventhub) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhub - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhub instances for property testing - lazily instantiated by NamespacesEventhubGenerator() -var namespacesEventhubGenerator gopter.Gen - -// NamespacesEventhubGenerator returns a generator of NamespacesEventhub instances for property testing. -func NamespacesEventhubGenerator() gopter.Gen { - if namespacesEventhubGenerator != nil { - return namespacesEventhubGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhub(generators) - namespacesEventhubGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhub{}), generators) - - return namespacesEventhubGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhub is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhub(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_Eventhub_SpecGenerator() - gens["Status"] = Namespaces_Eventhub_STATUSGenerator() -} - -func Test_Namespaces_Eventhub_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_Spec, Namespaces_Eventhub_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_Spec runs a test to see if a specific instance of Namespaces_Eventhub_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_Spec(subject Namespaces_Eventhub_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_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 Namespaces_Eventhub_Spec instances for property testing - lazily instantiated by -// Namespaces_Eventhub_SpecGenerator() -var namespaces_Eventhub_SpecGenerator gopter.Gen - -// Namespaces_Eventhub_SpecGenerator returns a generator of Namespaces_Eventhub_Spec instances for property testing. -// We first initialize namespaces_Eventhub_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhub_SpecGenerator() gopter.Gen { - if namespaces_Eventhub_SpecGenerator != nil { - return namespaces_Eventhub_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) - namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(generators) - namespaces_Eventhub_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_Spec{}), generators) - - return namespaces_Eventhub_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) - gens["OriginalVersion"] = gen.AlphaString() - gens["PartitionCount"] = gen.PtrOf(gen.Int()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_Spec(gens map[string]gopter.Gen) { - gens["CaptureDescription"] = gen.PtrOf(CaptureDescriptionGenerator()) - gens["RetentionDescription"] = gen.PtrOf(RetentionDescriptionGenerator()) -} - -func Test_Namespaces_Eventhub_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhub_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhub_STATUS, Namespaces_Eventhub_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhub_STATUS runs a test to see if a specific instance of Namespaces_Eventhub_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhub_STATUS(subject Namespaces_Eventhub_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhub_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 Namespaces_Eventhub_STATUS instances for property testing - lazily instantiated by -// Namespaces_Eventhub_STATUSGenerator() -var namespaces_Eventhub_STATUSGenerator gopter.Gen - -// Namespaces_Eventhub_STATUSGenerator returns a generator of Namespaces_Eventhub_STATUS instances for property testing. -// We first initialize namespaces_Eventhub_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhub_STATUSGenerator() gopter.Gen { - if namespaces_Eventhub_STATUSGenerator != nil { - return namespaces_Eventhub_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) - namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(generators) - namespaces_Eventhub_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhub_STATUS{}), generators) - - return namespaces_Eventhub_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["MessageRetentionInDays"] = gen.PtrOf(gen.Int()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["PartitionCount"] = gen.PtrOf(gen.Int()) - gens["PartitionIds"] = gen.SliceOf(gen.AlphaString()) - gens["Status"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhub_STATUS(gens map[string]gopter.Gen) { - gens["CaptureDescription"] = gen.PtrOf(CaptureDescription_STATUSGenerator()) - gens["RetentionDescription"] = gen.PtrOf(RetentionDescription_STATUSGenerator()) - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_CaptureDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureDescription via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureDescription, CaptureDescriptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureDescription runs a test to see if a specific instance of CaptureDescription round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureDescription(subject CaptureDescription) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureDescription - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureDescription instances for property testing - lazily instantiated by CaptureDescriptionGenerator() -var captureDescriptionGenerator gopter.Gen - -// CaptureDescriptionGenerator returns a generator of CaptureDescription instances for property testing. -// We first initialize captureDescriptionGenerator 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 CaptureDescriptionGenerator() gopter.Gen { - if captureDescriptionGenerator != nil { - return captureDescriptionGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription(generators) - captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription(generators) - AddRelatedPropertyGeneratorsForCaptureDescription(generators) - captureDescriptionGenerator = gen.Struct(reflect.TypeOf(CaptureDescription{}), generators) - - return captureDescriptionGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { - gens["Enabled"] = gen.PtrOf(gen.Bool()) - gens["Encoding"] = gen.PtrOf(gen.AlphaString()) - gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) - gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) - gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForCaptureDescription is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForCaptureDescription(gens map[string]gopter.Gen) { - gens["Destination"] = gen.PtrOf(DestinationGenerator()) -} - -func Test_CaptureDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureDescription_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureDescription_STATUS, CaptureDescription_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureDescription_STATUS runs a test to see if a specific instance of CaptureDescription_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureDescription_STATUS(subject CaptureDescription_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureDescription_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 CaptureDescription_STATUS instances for property testing - lazily instantiated by -// CaptureDescription_STATUSGenerator() -var captureDescription_STATUSGenerator gopter.Gen - -// CaptureDescription_STATUSGenerator returns a generator of CaptureDescription_STATUS instances for property testing. -// We first initialize captureDescription_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func CaptureDescription_STATUSGenerator() gopter.Gen { - if captureDescription_STATUSGenerator != nil { - return captureDescription_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) - captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(generators) - AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(generators) - captureDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureDescription_STATUS{}), generators) - - return captureDescription_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { - gens["Enabled"] = gen.PtrOf(gen.Bool()) - gens["Encoding"] = gen.PtrOf(gen.AlphaString()) - gens["IntervalInSeconds"] = gen.PtrOf(gen.Int()) - gens["SizeLimitInBytes"] = gen.PtrOf(gen.Int()) - gens["SkipEmptyArchives"] = gen.PtrOf(gen.Bool()) -} - -// AddRelatedPropertyGeneratorsForCaptureDescription_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForCaptureDescription_STATUS(gens map[string]gopter.Gen) { - gens["Destination"] = gen.PtrOf(Destination_STATUSGenerator()) -} - -func Test_RetentionDescription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of RetentionDescription via JSON returns original", - prop.ForAll(RunJSONSerializationTestForRetentionDescription, RetentionDescriptionGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForRetentionDescription runs a test to see if a specific instance of RetentionDescription round trips to JSON and back losslessly -func RunJSONSerializationTestForRetentionDescription(subject RetentionDescription) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual RetentionDescription - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of RetentionDescription instances for property testing - lazily instantiated by -// RetentionDescriptionGenerator() -var retentionDescriptionGenerator gopter.Gen - -// RetentionDescriptionGenerator returns a generator of RetentionDescription instances for property testing. -func RetentionDescriptionGenerator() gopter.Gen { - if retentionDescriptionGenerator != nil { - return retentionDescriptionGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForRetentionDescription(generators) - retentionDescriptionGenerator = gen.Struct(reflect.TypeOf(RetentionDescription{}), generators) - - return retentionDescriptionGenerator -} - -// AddIndependentPropertyGeneratorsForRetentionDescription is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForRetentionDescription(gens map[string]gopter.Gen) { - gens["CleanupPolicy"] = gen.PtrOf(gen.AlphaString()) - gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) - gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) -} - -func Test_RetentionDescription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of RetentionDescription_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForRetentionDescription_STATUS, RetentionDescription_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForRetentionDescription_STATUS runs a test to see if a specific instance of RetentionDescription_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForRetentionDescription_STATUS(subject RetentionDescription_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual RetentionDescription_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 RetentionDescription_STATUS instances for property testing - lazily instantiated by -// RetentionDescription_STATUSGenerator() -var retentionDescription_STATUSGenerator gopter.Gen - -// RetentionDescription_STATUSGenerator returns a generator of RetentionDescription_STATUS instances for property testing. -func RetentionDescription_STATUSGenerator() gopter.Gen { - if retentionDescription_STATUSGenerator != nil { - return retentionDescription_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(generators) - retentionDescription_STATUSGenerator = gen.Struct(reflect.TypeOf(RetentionDescription_STATUS{}), generators) - - return retentionDescription_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForRetentionDescription_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForRetentionDescription_STATUS(gens map[string]gopter.Gen) { - gens["CleanupPolicy"] = gen.PtrOf(gen.AlphaString()) - gens["RetentionTimeInHours"] = gen.PtrOf(gen.Int()) - gens["TombstoneRetentionTimeInHours"] = gen.PtrOf(gen.Int()) -} - -func Test_Destination_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination, DestinationGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination runs a test to see if a specific instance of Destination round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination(subject Destination) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of Destination instances for property testing - lazily instantiated by DestinationGenerator() -var destinationGenerator gopter.Gen - -// DestinationGenerator returns a generator of Destination instances for property testing. -// We first initialize destinationGenerator 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 DestinationGenerator() gopter.Gen { - if destinationGenerator != nil { - return destinationGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination(generators) - destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination(generators) - AddRelatedPropertyGeneratorsForDestination(generators) - destinationGenerator = gen.Struct(reflect.TypeOf(Destination{}), generators) - - return destinationGenerator -} - -// AddIndependentPropertyGeneratorsForDestination is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { - gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) - gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForDestination is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForDestination(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(CaptureIdentityGenerator()) -} - -func Test_Destination_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Destination_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForDestination_STATUS, Destination_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForDestination_STATUS runs a test to see if a specific instance of Destination_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForDestination_STATUS(subject Destination_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Destination_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 Destination_STATUS instances for property testing - lazily instantiated by Destination_STATUSGenerator() -var destination_STATUSGenerator gopter.Gen - -// Destination_STATUSGenerator returns a generator of Destination_STATUS instances for property testing. -// We first initialize destination_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Destination_STATUSGenerator() gopter.Gen { - if destination_STATUSGenerator != nil { - return destination_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_STATUS(generators) - destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForDestination_STATUS(generators) - AddRelatedPropertyGeneratorsForDestination_STATUS(generators) - destination_STATUSGenerator = gen.Struct(reflect.TypeOf(Destination_STATUS{}), generators) - - return destination_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { - gens["ArchiveNameFormat"] = gen.PtrOf(gen.AlphaString()) - gens["BlobContainer"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeAccountName"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeFolderPath"] = gen.PtrOf(gen.AlphaString()) - gens["DataLakeSubscriptionId"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["StorageAccountResourceId"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForDestination_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForDestination_STATUS(gens map[string]gopter.Gen) { - gens["Identity"] = gen.PtrOf(CaptureIdentity_STATUSGenerator()) -} - -func Test_CaptureIdentity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureIdentity via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureIdentity, CaptureIdentityGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureIdentity runs a test to see if a specific instance of CaptureIdentity round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureIdentity(subject CaptureIdentity) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureIdentity - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of CaptureIdentity instances for property testing - lazily instantiated by CaptureIdentityGenerator() -var captureIdentityGenerator gopter.Gen - -// CaptureIdentityGenerator returns a generator of CaptureIdentity instances for property testing. -func CaptureIdentityGenerator() gopter.Gen { - if captureIdentityGenerator != nil { - return captureIdentityGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureIdentity(generators) - captureIdentityGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity{}), generators) - - return captureIdentityGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureIdentity is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureIdentity(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_CaptureIdentity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of CaptureIdentity_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForCaptureIdentity_STATUS, CaptureIdentity_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForCaptureIdentity_STATUS runs a test to see if a specific instance of CaptureIdentity_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForCaptureIdentity_STATUS(subject CaptureIdentity_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual CaptureIdentity_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 CaptureIdentity_STATUS instances for property testing - lazily instantiated by -// CaptureIdentity_STATUSGenerator() -var captureIdentity_STATUSGenerator gopter.Gen - -// CaptureIdentity_STATUSGenerator returns a generator of CaptureIdentity_STATUS instances for property testing. -func CaptureIdentity_STATUSGenerator() gopter.Gen { - if captureIdentity_STATUSGenerator != nil { - return captureIdentity_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(generators) - captureIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(CaptureIdentity_STATUS{}), generators) - - return captureIdentity_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForCaptureIdentity_STATUS(gens map[string]gopter.Gen) { - gens["Type"] = gen.PtrOf(gen.AlphaString()) - gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go deleted file mode 100644 index cc4bcfc953a..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsauthorizationrules,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsauthorizationrules/status,namespaceseventhubsauthorizationrules/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 v1api20240101.NamespacesEventhubsAuthorizationRule -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} -type NamespacesEventhubsAuthorizationRule struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_Eventhubs_AuthorizationRule_Spec `json:"spec,omitempty"` - Status Namespaces_Eventhubs_AuthorizationRule_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesEventhubsAuthorizationRule{} - -// GetConditions returns the conditions of the resource -func (rule *NamespacesEventhubsAuthorizationRule) GetConditions() conditions.Conditions { - return rule.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (rule *NamespacesEventhubsAuthorizationRule) SetConditions(conditions conditions.Conditions) { - rule.Status.Conditions = conditions -} - -var _ genruntime.KubernetesResource = &NamespacesEventhubsAuthorizationRule{} - -// AzureName returns the Azure name of the resource -func (rule *NamespacesEventhubsAuthorizationRule) AzureName() string { - return rule.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (rule NamespacesEventhubsAuthorizationRule) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (rule *NamespacesEventhubsAuthorizationRule) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (rule *NamespacesEventhubsAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { - return &rule.Spec -} - -// GetStatus returns the status of this resource -func (rule *NamespacesEventhubsAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { - return &rule.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (rule *NamespacesEventhubsAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" -func (rule *NamespacesEventhubsAuthorizationRule) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs/authorizationRules" -} - -// NewEmptyStatus returns a new empty (blank) status -func (rule *NamespacesEventhubsAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_Eventhubs_AuthorizationRule_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (rule *NamespacesEventhubsAuthorizationRule) Owner() *genruntime.ResourceReference { - group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) - return rule.Spec.Owner.AsResourceReference(group, kind) -} - -// SetStatus sets the status of this resource -func (rule *NamespacesEventhubsAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_Eventhubs_AuthorizationRule_STATUS); ok { - rule.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_Eventhubs_AuthorizationRule_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - rule.Status = st - return nil -} - -// Hub marks that this NamespacesEventhubsAuthorizationRule is the hub type for conversion -func (rule *NamespacesEventhubsAuthorizationRule) Hub() {} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (rule *NamespacesEventhubsAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: rule.Spec.OriginalVersion, - Kind: "NamespacesEventhubsAuthorizationRule", - } -} - -// +kubebuilder:object:root=true -// Storage version of v1api20240101.NamespacesEventhubsAuthorizationRule -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/AuthorizationRules.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName} -type NamespacesEventhubsAuthorizationRuleList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesEventhubsAuthorizationRule `json:"items"` -} - -// Storage version of v1api20240101.Namespaces_Eventhubs_AuthorizationRule_Spec -type Namespaces_Eventhubs_AuthorizationRule_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"` - OperatorSpec *NamespacesEventhubsAuthorizationRuleOperatorSpec `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 eventhub.azure.com/NamespacesEventhub resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Rights []string `json:"rights,omitempty"` -} - -var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_AuthorizationRule_Spec{} - -// ConvertSpecFrom populates our Namespaces_Eventhubs_AuthorizationRule_Spec from the provided source -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return source.ConvertSpecTo(rule) -} - -// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_Spec -func (rule *Namespaces_Eventhubs_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return destination.ConvertSpecFrom(rule) -} - -// Storage version of v1api20240101.Namespaces_Eventhubs_AuthorizationRule_STATUS -type Namespaces_Eventhubs_AuthorizationRule_STATUS struct { - Conditions []conditions.Condition `json:"conditions,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Rights []string `json:"rights,omitempty"` - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_AuthorizationRule_STATUS{} - -// ConvertStatusFrom populates our Namespaces_Eventhubs_AuthorizationRule_STATUS from the provided source -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return source.ConvertStatusTo(rule) -} - -// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_AuthorizationRule_STATUS -func (rule *Namespaces_Eventhubs_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == rule { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return destination.ConvertStatusFrom(rule) -} - -// Storage version of v1api20240101.NamespacesEventhubsAuthorizationRuleOperatorSpec -// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure -type NamespacesEventhubsAuthorizationRuleOperatorSpec struct { - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - Secrets *NamespacesEventhubsAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` -} - -// Storage version of v1api20240101.NamespacesEventhubsAuthorizationRuleOperatorSecrets -type NamespacesEventhubsAuthorizationRuleOperatorSecrets struct { - PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` - PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` - SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` -} - -func init() { - SchemeBuilder.Register(&NamespacesEventhubsAuthorizationRule{}, &NamespacesEventhubsAuthorizationRuleList{}) -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go deleted file mode 100644 index b8969f255e3..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_authorization_rule_types_gen_test.go +++ /dev/null @@ -1,352 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "encoding/json" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesEventhubsAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsAuthorizationRule via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule, NamespacesEventhubsAuthorizationRuleGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRule round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRule(subject NamespacesEventhubsAuthorizationRule) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsAuthorizationRule - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsAuthorizationRule instances for property testing - lazily instantiated by -// NamespacesEventhubsAuthorizationRuleGenerator() -var namespacesEventhubsAuthorizationRuleGenerator gopter.Gen - -// NamespacesEventhubsAuthorizationRuleGenerator returns a generator of NamespacesEventhubsAuthorizationRule instances for property testing. -func NamespacesEventhubsAuthorizationRuleGenerator() gopter.Gen { - if namespacesEventhubsAuthorizationRuleGenerator != nil { - return namespacesEventhubsAuthorizationRuleGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(generators) - namespacesEventhubsAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRule{}), generators) - - return namespacesEventhubsAuthorizationRuleGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRule(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() - gens["Status"] = Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec, Namespaces_Eventhubs_AuthorizationRule_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_Spec(subject Namespaces_Eventhubs_AuthorizationRule_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() -var namespaces_Eventhubs_AuthorizationRule_SpecGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_SpecGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_Spec instances for property testing. -// We first initialize namespaces_Eventhubs_AuthorizationRule_SpecGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhubs_AuthorizationRule_SpecGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_SpecGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) - namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(generators) - namespaces_Eventhubs_AuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_Spec{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["OriginalVersion"] = gen.AlphaString() - gens["Rights"] = gen.SliceOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_Spec(gens map[string]gopter.Gen) { - gens["OperatorSpec"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator()) -} - -func Test_Namespaces_Eventhubs_AuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_AuthorizationRule_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS, Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_AuthorizationRule_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_AuthorizationRule_STATUS(subject Namespaces_Eventhubs_AuthorizationRule_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_AuthorizationRule_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 Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() -var namespaces_Eventhubs_AuthorizationRule_STATUSGenerator gopter.Gen - -// Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator returns a generator of Namespaces_Eventhubs_AuthorizationRule_STATUS instances for property testing. -// We first initialize namespaces_Eventhubs_AuthorizationRule_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhubs_AuthorizationRule_STATUSGenerator() gopter.Gen { - if namespaces_Eventhubs_AuthorizationRule_STATUSGenerator != nil { - return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) - namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(generators) - namespaces_Eventhubs_AuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_AuthorizationRule_STATUS{}), generators) - - return namespaces_Eventhubs_AuthorizationRule_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Rights"] = gen.SliceOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_AuthorizationRule_STATUS(gens map[string]gopter.Gen) { - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} - -func Test_NamespacesEventhubsAuthorizationRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSpec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec, NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSpec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSpec(subject NamespacesEventhubsAuthorizationRuleOperatorSpec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsAuthorizationRuleOperatorSpec - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing - lazily instantiated by -// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() -var namespacesEventhubsAuthorizationRuleOperatorSpecGenerator gopter.Gen - -// NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSpec instances for property testing. -func NamespacesEventhubsAuthorizationRuleOperatorSpecGenerator() gopter.Gen { - if namespacesEventhubsAuthorizationRuleOperatorSpecGenerator != nil { - return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(generators) - namespacesEventhubsAuthorizationRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSpec{}), generators) - - return namespacesEventhubsAuthorizationRuleOperatorSpecGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhubsAuthorizationRuleOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator()) -} - -func Test_NamespacesEventhubsAuthorizationRuleOperatorSecrets_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 100 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsAuthorizationRuleOperatorSecrets via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets, NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets runs a test to see if a specific instance of NamespacesEventhubsAuthorizationRuleOperatorSecrets round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsAuthorizationRuleOperatorSecrets(subject NamespacesEventhubsAuthorizationRuleOperatorSecrets) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsAuthorizationRuleOperatorSecrets - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing - lazily instantiated -// by NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() -var namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator gopter.Gen - -// NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator returns a generator of NamespacesEventhubsAuthorizationRuleOperatorSecrets instances for property testing. -func NamespacesEventhubsAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { - if namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator != nil { - return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator - } - - generators := make(map[string]gopter.Gen) - namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsAuthorizationRuleOperatorSecrets{}), generators) - - return namespacesEventhubsAuthorizationRuleOperatorSecretsGenerator -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go deleted file mode 100644 index 87e7d940108..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// +kubebuilder:rbac:groups=eventhub.azure.com,resources=namespaceseventhubsconsumergroups,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=eventhub.azure.com,resources={namespaceseventhubsconsumergroups/status,namespaceseventhubsconsumergroups/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 v1api20240101.NamespacesEventhubsConsumerGroup -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} -type NamespacesEventhubsConsumerGroup struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec Namespaces_Eventhubs_Consumergroup_Spec `json:"spec,omitempty"` - Status Namespaces_Eventhubs_Consumergroup_STATUS `json:"status,omitempty"` -} - -var _ conditions.Conditioner = &NamespacesEventhubsConsumerGroup{} - -// GetConditions returns the conditions of the resource -func (group *NamespacesEventhubsConsumerGroup) GetConditions() conditions.Conditions { - return group.Status.Conditions -} - -// SetConditions sets the conditions on the resource status -func (group *NamespacesEventhubsConsumerGroup) SetConditions(conditions conditions.Conditions) { - group.Status.Conditions = conditions -} - -var _ genruntime.KubernetesResource = &NamespacesEventhubsConsumerGroup{} - -// AzureName returns the Azure name of the resource -func (group *NamespacesEventhubsConsumerGroup) AzureName() string { - return group.Spec.AzureName -} - -// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" -func (group NamespacesEventhubsConsumerGroup) GetAPIVersion() string { - return string(APIVersion_Value) -} - -// GetResourceScope returns the scope of the resource -func (group *NamespacesEventhubsConsumerGroup) GetResourceScope() genruntime.ResourceScope { - return genruntime.ResourceScopeResourceGroup -} - -// GetSpec returns the specification of this resource -func (group *NamespacesEventhubsConsumerGroup) GetSpec() genruntime.ConvertibleSpec { - return &group.Spec -} - -// GetStatus returns the status of this resource -func (group *NamespacesEventhubsConsumerGroup) GetStatus() genruntime.ConvertibleStatus { - return &group.Status -} - -// GetSupportedOperations returns the operations supported by the resource -func (group *NamespacesEventhubsConsumerGroup) GetSupportedOperations() []genruntime.ResourceOperation { - return []genruntime.ResourceOperation{ - genruntime.ResourceOperationDelete, - genruntime.ResourceOperationGet, - genruntime.ResourceOperationPut, - } -} - -// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces/eventhubs/consumergroups" -func (group *NamespacesEventhubsConsumerGroup) GetType() string { - return "Microsoft.EventHub/namespaces/eventhubs/consumergroups" -} - -// NewEmptyStatus returns a new empty (blank) status -func (group *NamespacesEventhubsConsumerGroup) NewEmptyStatus() genruntime.ConvertibleStatus { - return &Namespaces_Eventhubs_Consumergroup_STATUS{} -} - -// Owner returns the ResourceReference of the owner -func (group *NamespacesEventhubsConsumerGroup) Owner() *genruntime.ResourceReference { - ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec) - return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind) -} - -// SetStatus sets the status of this resource -func (group *NamespacesEventhubsConsumerGroup) SetStatus(status genruntime.ConvertibleStatus) error { - // If we have exactly the right type of status, assign it - if st, ok := status.(*Namespaces_Eventhubs_Consumergroup_STATUS); ok { - group.Status = *st - return nil - } - - // Convert status to required version - var st Namespaces_Eventhubs_Consumergroup_STATUS - err := status.ConvertStatusTo(&st) - if err != nil { - return errors.Wrap(err, "failed to convert status") - } - - group.Status = st - return nil -} - -// Hub marks that this NamespacesEventhubsConsumerGroup is the hub type for conversion -func (group *NamespacesEventhubsConsumerGroup) Hub() {} - -// OriginalGVK returns a GroupValueKind for the original API version used to create the resource -func (group *NamespacesEventhubsConsumerGroup) OriginalGVK() *schema.GroupVersionKind { - return &schema.GroupVersionKind{ - Group: GroupVersion.Group, - Version: group.Spec.OriginalVersion, - Kind: "NamespacesEventhubsConsumerGroup", - } -} - -// +kubebuilder:object:root=true -// Storage version of v1api20240101.NamespacesEventhubsConsumerGroup -// Generator information: -// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/consumergroups.json -// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName} -type NamespacesEventhubsConsumerGroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NamespacesEventhubsConsumerGroup `json:"items"` -} - -// Storage version of v1api20240101.Namespaces_Eventhubs_Consumergroup_Spec -type Namespaces_Eventhubs_Consumergroup_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"` - 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 eventhub.azure.com/NamespacesEventhub resource - Owner *genruntime.KnownResourceReference `group:"eventhub.azure.com" json:"owner,omitempty" kind:"NamespacesEventhub"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - UserMetadata *string `json:"userMetadata,omitempty"` -} - -var _ genruntime.ConvertibleSpec = &Namespaces_Eventhubs_Consumergroup_Spec{} - -// ConvertSpecFrom populates our Namespaces_Eventhubs_Consumergroup_Spec from the provided source -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return source.ConvertSpecTo(consumergroup) -} - -// ConvertSpecTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_Spec -func (consumergroup *Namespaces_Eventhubs_Consumergroup_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") - } - - return destination.ConvertSpecFrom(consumergroup) -} - -// Storage version of v1api20240101.Namespaces_Eventhubs_Consumergroup_STATUS -type Namespaces_Eventhubs_Consumergroup_STATUS struct { - Conditions []conditions.Condition `json:"conditions,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` - SystemData *SystemData_STATUS `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` - UserMetadata *string `json:"userMetadata,omitempty"` -} - -var _ genruntime.ConvertibleStatus = &Namespaces_Eventhubs_Consumergroup_STATUS{} - -// ConvertStatusFrom populates our Namespaces_Eventhubs_Consumergroup_STATUS from the provided source -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return source.ConvertStatusTo(consumergroup) -} - -// ConvertStatusTo populates the provided destination from our Namespaces_Eventhubs_Consumergroup_STATUS -func (consumergroup *Namespaces_Eventhubs_Consumergroup_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == consumergroup { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") - } - - return destination.ConvertStatusFrom(consumergroup) -} - -func init() { - SchemeBuilder.Register(&NamespacesEventhubsConsumerGroup{}, &NamespacesEventhubsConsumerGroupList{}) -} diff --git a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go b/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go deleted file mode 100644 index bd224b18b28..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/namespaces_eventhubs_consumer_group_types_gen_test.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -package storage - -import ( - "encoding/json" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/kr/pretty" - "github.com/kylelemons/godebug/diff" - "github.com/leanovate/gopter" - "github.com/leanovate/gopter/gen" - "github.com/leanovate/gopter/prop" - "os" - "reflect" - "testing" -) - -func Test_NamespacesEventhubsConsumerGroup_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 20 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of NamespacesEventhubsConsumerGroup via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespacesEventhubsConsumerGroup, NamespacesEventhubsConsumerGroupGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespacesEventhubsConsumerGroup runs a test to see if a specific instance of NamespacesEventhubsConsumerGroup round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespacesEventhubsConsumerGroup(subject NamespacesEventhubsConsumerGroup) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual NamespacesEventhubsConsumerGroup - err = json.Unmarshal(bin, &actual) - if err != nil { - return err.Error() - } - - // Check for outcome - match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) - if !match { - actualFmt := pretty.Sprint(actual) - subjectFmt := pretty.Sprint(subject) - result := diff.Diff(subjectFmt, actualFmt) - return result - } - - return "" -} - -// Generator of NamespacesEventhubsConsumerGroup instances for property testing - lazily instantiated by -// NamespacesEventhubsConsumerGroupGenerator() -var namespacesEventhubsConsumerGroupGenerator gopter.Gen - -// NamespacesEventhubsConsumerGroupGenerator returns a generator of NamespacesEventhubsConsumerGroup instances for property testing. -func NamespacesEventhubsConsumerGroupGenerator() gopter.Gen { - if namespacesEventhubsConsumerGroupGenerator != nil { - return namespacesEventhubsConsumerGroupGenerator - } - - generators := make(map[string]gopter.Gen) - AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(generators) - namespacesEventhubsConsumerGroupGenerator = gen.Struct(reflect.TypeOf(NamespacesEventhubsConsumerGroup{}), generators) - - return namespacesEventhubsConsumerGroupGenerator -} - -// AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespacesEventhubsConsumerGroup(gens map[string]gopter.Gen) { - gens["Spec"] = Namespaces_Eventhubs_Consumergroup_SpecGenerator() - gens["Status"] = Namespaces_Eventhubs_Consumergroup_STATUSGenerator() -} - -func Test_Namespaces_Eventhubs_Consumergroup_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_Spec via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec, Namespaces_Eventhubs_Consumergroup_SpecGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_Spec round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_Spec(subject Namespaces_Eventhubs_Consumergroup_Spec) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_Spec instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_Consumergroup_SpecGenerator() -var namespaces_Eventhubs_Consumergroup_SpecGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_SpecGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_Spec instances for property testing. -func Namespaces_Eventhubs_Consumergroup_SpecGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_SpecGenerator != nil { - return namespaces_Eventhubs_Consumergroup_SpecGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(generators) - namespaces_Eventhubs_Consumergroup_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_Spec{}), generators) - - return namespaces_Eventhubs_Consumergroup_SpecGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_Spec(gens map[string]gopter.Gen) { - gens["AzureName"] = gen.AlphaString() - gens["OriginalVersion"] = gen.AlphaString() - gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) -} - -func Test_Namespaces_Eventhubs_Consumergroup_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { - t.Parallel() - parameters := gopter.DefaultTestParameters() - parameters.MinSuccessfulTests = 80 - parameters.MaxSize = 3 - properties := gopter.NewProperties(parameters) - properties.Property( - "Round trip of Namespaces_Eventhubs_Consumergroup_STATUS via JSON returns original", - prop.ForAll(RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS, Namespaces_Eventhubs_Consumergroup_STATUSGenerator())) - properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) -} - -// RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS runs a test to see if a specific instance of Namespaces_Eventhubs_Consumergroup_STATUS round trips to JSON and back losslessly -func RunJSONSerializationTestForNamespaces_Eventhubs_Consumergroup_STATUS(subject Namespaces_Eventhubs_Consumergroup_STATUS) string { - // Serialize to JSON - bin, err := json.Marshal(subject) - if err != nil { - return err.Error() - } - - // Deserialize back into memory - var actual Namespaces_Eventhubs_Consumergroup_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 Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing - lazily instantiated by -// Namespaces_Eventhubs_Consumergroup_STATUSGenerator() -var namespaces_Eventhubs_Consumergroup_STATUSGenerator gopter.Gen - -// Namespaces_Eventhubs_Consumergroup_STATUSGenerator returns a generator of Namespaces_Eventhubs_Consumergroup_STATUS instances for property testing. -// We first initialize namespaces_Eventhubs_Consumergroup_STATUSGenerator with a simplified generator based on the -// fields with primitive types then replacing it with a more complex one that also handles complex fields -// to ensure any cycles in the object graph properly terminate. -func Namespaces_Eventhubs_Consumergroup_STATUSGenerator() gopter.Gen { - if namespaces_Eventhubs_Consumergroup_STATUSGenerator != nil { - return namespaces_Eventhubs_Consumergroup_STATUSGenerator - } - - generators := make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) - namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) - - // The above call to gen.Struct() captures the map, so create a new one - generators = make(map[string]gopter.Gen) - AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) - AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(generators) - namespaces_Eventhubs_Consumergroup_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Eventhubs_Consumergroup_STATUS{}), generators) - - return namespaces_Eventhubs_Consumergroup_STATUSGenerator -} - -// AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators -func AddIndependentPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { - gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["Id"] = gen.PtrOf(gen.AlphaString()) - gens["Location"] = gen.PtrOf(gen.AlphaString()) - gens["Name"] = gen.PtrOf(gen.AlphaString()) - gens["Type"] = gen.PtrOf(gen.AlphaString()) - gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) - gens["UserMetadata"] = gen.PtrOf(gen.AlphaString()) -} - -// AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaces_Eventhubs_Consumergroup_STATUS(gens map[string]gopter.Gen) { - gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) -} diff --git a/v2/api/eventhub/v1api20240101/storage/structure.txt b/v2/api/eventhub/v1api20240101/storage/structure.txt deleted file mode 100644 index c148579b240..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/structure.txt +++ /dev/null @@ -1,283 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage -├── APIVersion: Enum (1 value) -│ └── "2024-01-01" -├── Namespace: Resource -│ ├── Owner: resources/v1apiv20191001.ResourceGroup -│ ├── Spec: Object (19 properties) -│ │ ├── AlternateName: *string -│ │ ├── AzureName: string -│ │ ├── ClusterArmReference: *genruntime.ResourceReference -│ │ ├── DisableLocalAuth: *bool -│ │ ├── Encryption: *Object (4 properties) -│ │ │ ├── KeySource: *string -│ │ │ ├── KeyVaultProperties: Object (5 properties)[] -│ │ │ │ ├── Identity: *Object (2 properties) -│ │ │ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference -│ │ │ │ ├── KeyName: *string -│ │ │ │ ├── KeyVaultUri: *string -│ │ │ │ ├── KeyVersion: *string -│ │ │ │ └── PropertyBag: genruntime.PropertyBag -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── RequireInfrastructureEncryption: *bool -│ │ ├── Identity: *Object (3 properties) -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ ├── Type: *string -│ │ │ └── UserAssignedIdentities: Object (2 properties)[] -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── Reference: genruntime.ResourceReference -│ │ ├── IsAutoInflateEnabled: *bool -│ │ ├── KafkaEnabled: *bool -│ │ ├── Location: *string -│ │ ├── MaximumThroughputUnits: *int -│ │ ├── MinimumTlsVersion: *string -│ │ ├── OperatorSpec: *Object (2 properties) -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── Secrets: *Object (5 properties) -│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination -│ │ │ └── SecondaryKey: *genruntime.SecretDestination -│ │ ├── OriginalVersion: string -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ ├── PublicNetworkAccess: *string -│ │ ├── Sku: *Object (4 properties) -│ │ │ ├── Capacity: *int -│ │ │ ├── Name: *string -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── Tier: *string -│ │ ├── Tags: map[string]string -│ │ └── ZoneRedundant: *bool -│ └── Status: Object (27 properties) -│ ├── AlternateName: *string -│ ├── ClusterArmId: *string -│ ├── Conditions: conditions.Condition[] -│ ├── CreatedAt: *string -│ ├── DisableLocalAuth: *bool -│ ├── Encryption: *Object (4 properties) -│ │ ├── KeySource: *string -│ │ ├── KeyVaultProperties: Object (5 properties)[] -│ │ │ ├── Identity: *Object (2 properties) -│ │ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ │ └── UserAssignedIdentity: *string -│ │ │ ├── KeyName: *string -│ │ │ ├── KeyVaultUri: *string -│ │ │ ├── KeyVersion: *string -│ │ │ └── PropertyBag: genruntime.PropertyBag -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ └── RequireInfrastructureEncryption: *bool -│ ├── Id: *string -│ ├── Identity: *Object (5 properties) -│ │ ├── PrincipalId: *string -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ ├── TenantId: *string -│ │ ├── Type: *string -│ │ └── UserAssignedIdentities: map[string]Object (3 properties) -│ │ ├── ClientId: *string -│ │ ├── PrincipalId: *string -│ │ └── PropertyBag: genruntime.PropertyBag -│ ├── IsAutoInflateEnabled: *bool -│ ├── KafkaEnabled: *bool -│ ├── Location: *string -│ ├── MaximumThroughputUnits: *int -│ ├── MetricId: *string -│ ├── MinimumTlsVersion: *string -│ ├── Name: *string -│ ├── PrivateEndpointConnections: Object (2 properties)[] -│ │ ├── Id: *string -│ │ └── PropertyBag: genruntime.PropertyBag -│ ├── PropertyBag: genruntime.PropertyBag -│ ├── ProvisioningState: *string -│ ├── PublicNetworkAccess: *string -│ ├── ServiceBusEndpoint: *string -│ ├── Sku: *Object (4 properties) -│ │ ├── Capacity: *int -│ │ ├── Name: *string -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ └── Tier: *string -│ ├── Status: *string -│ ├── SystemData: *Object (7 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *string -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ ├── LastModifiedByType: *string -│ │ └── PropertyBag: genruntime.PropertyBag -│ ├── Tags: map[string]string -│ ├── Type: *string -│ ├── UpdatedAt: *string -│ └── ZoneRedundant: *bool -├── NamespacesAuthorizationRule: Resource -│ ├── Owner: eventhub/v1api20240101.Namespace -│ ├── Spec: Object (6 properties) -│ │ ├── AzureName: string -│ │ ├── OperatorSpec: *Object (2 properties) -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── Secrets: *Object (5 properties) -│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination -│ │ │ └── SecondaryKey: *genruntime.SecretDestination -│ │ ├── OriginalVersion: string -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ └── Rights: string[] -│ └── Status: Object (8 properties) -│ ├── Conditions: conditions.Condition[] -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── PropertyBag: genruntime.PropertyBag -│ ├── Rights: string[] -│ ├── SystemData: *Object (7 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *string -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ ├── LastModifiedByType: *string -│ │ └── PropertyBag: genruntime.PropertyBag -│ └── Type: *string -├── NamespacesEventhub: Resource -│ ├── Owner: eventhub/v1api20240101.Namespace -│ ├── Spec: Object (8 properties) -│ │ ├── AzureName: string -│ │ ├── CaptureDescription: *Object (7 properties) -│ │ │ ├── Destination: *Object (9 properties) -│ │ │ │ ├── ArchiveNameFormat: *string -│ │ │ │ ├── BlobContainer: *string -│ │ │ │ ├── DataLakeAccountName: *string -│ │ │ │ ├── DataLakeFolderPath: *string -│ │ │ │ ├── DataLakeSubscriptionId: *string -│ │ │ │ ├── Identity: *Object (3 properties) -│ │ │ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ │ │ ├── Type: *string -│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference -│ │ │ │ ├── Name: *string -│ │ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ │ └── StorageAccountResourceReference: *genruntime.ResourceReference -│ │ │ ├── Enabled: *bool -│ │ │ ├── Encoding: *string -│ │ │ ├── IntervalInSeconds: *int -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ ├── SizeLimitInBytes: *int -│ │ │ └── SkipEmptyArchives: *bool -│ │ ├── MessageRetentionInDays: *int -│ │ ├── OriginalVersion: string -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PartitionCount: *int -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ └── RetentionDescription: *Object (4 properties) -│ │ ├── CleanupPolicy: *string -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ ├── RetentionTimeInHours: *int -│ │ └── TombstoneRetentionTimeInHours: *int -│ └── Status: Object (15 properties) -│ ├── CaptureDescription: *Object (7 properties) -│ │ ├── Destination: *Object (9 properties) -│ │ │ ├── ArchiveNameFormat: *string -│ │ │ ├── BlobContainer: *string -│ │ │ ├── DataLakeAccountName: *string -│ │ │ ├── DataLakeFolderPath: *string -│ │ │ ├── DataLakeSubscriptionId: *string -│ │ │ ├── Identity: *Object (3 properties) -│ │ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ │ ├── Type: *string -│ │ │ │ └── UserAssignedIdentity: *string -│ │ │ ├── Name: *string -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── StorageAccountResourceId: *string -│ │ ├── Enabled: *bool -│ │ ├── Encoding: *string -│ │ ├── IntervalInSeconds: *int -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ ├── SizeLimitInBytes: *int -│ │ └── SkipEmptyArchives: *bool -│ ├── Conditions: conditions.Condition[] -│ ├── CreatedAt: *string -│ ├── Id: *string -│ ├── Location: *string -│ ├── MessageRetentionInDays: *int -│ ├── Name: *string -│ ├── PartitionCount: *int -│ ├── PartitionIds: string[] -│ ├── PropertyBag: genruntime.PropertyBag -│ ├── RetentionDescription: *Object (4 properties) -│ │ ├── CleanupPolicy: *string -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ ├── RetentionTimeInHours: *int -│ │ └── TombstoneRetentionTimeInHours: *int -│ ├── Status: *string -│ ├── SystemData: *Object (7 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *string -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ ├── LastModifiedByType: *string -│ │ └── PropertyBag: genruntime.PropertyBag -│ ├── Type: *string -│ └── UpdatedAt: *string -├── NamespacesEventhubsAuthorizationRule: Resource -│ ├── Owner: eventhub/v1api20240101.NamespacesEventhub -│ ├── Spec: Object (6 properties) -│ │ ├── AzureName: string -│ │ ├── OperatorSpec: *Object (2 properties) -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ └── Secrets: *Object (5 properties) -│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ ├── PropertyBag: genruntime.PropertyBag -│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination -│ │ │ └── SecondaryKey: *genruntime.SecretDestination -│ │ ├── OriginalVersion: string -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PropertyBag: genruntime.PropertyBag -│ │ └── Rights: string[] -│ └── Status: Object (8 properties) -│ ├── Conditions: conditions.Condition[] -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── PropertyBag: genruntime.PropertyBag -│ ├── Rights: string[] -│ ├── SystemData: *Object (7 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *string -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ ├── LastModifiedByType: *string -│ │ └── PropertyBag: genruntime.PropertyBag -│ └── Type: *string -└── NamespacesEventhubsConsumerGroup: Resource - ├── Owner: eventhub/v1api20240101.NamespacesEventhub - ├── Spec: Object (5 properties) - │ ├── AzureName: string - │ ├── OriginalVersion: string - │ ├── Owner: *genruntime.KnownResourceReference - │ ├── PropertyBag: genruntime.PropertyBag - │ └── UserMetadata: *string - └── Status: Object (10 properties) - ├── Conditions: conditions.Condition[] - ├── CreatedAt: *string - ├── Id: *string - ├── Location: *string - ├── Name: *string - ├── PropertyBag: genruntime.PropertyBag - ├── SystemData: *Object (7 properties) - │ ├── CreatedAt: *string - │ ├── CreatedBy: *string - │ ├── CreatedByType: *string - │ ├── LastModifiedAt: *string - │ ├── LastModifiedBy: *string - │ ├── LastModifiedByType: *string - │ └── PropertyBag: genruntime.PropertyBag - ├── Type: *string - ├── UpdatedAt: *string - └── UserMetadata: *string diff --git a/v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go b/v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go deleted file mode 100644 index 9d235de3676..00000000000 --- a/v2/api/eventhub/v1api20240101/storage/zz_generated.deepcopy.go +++ /dev/null @@ -1,2082 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright (c) Microsoft Corporation. -Licensed under the MIT license. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package storage - -import ( - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - 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 *CaptureDescription) DeepCopyInto(out *CaptureDescription) { - *out = *in - if in.Destination != nil { - in, out := &in.Destination, &out.Destination - *out = new(Destination) - (*in).DeepCopyInto(*out) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.Encoding != nil { - in, out := &in.Encoding, &out.Encoding - *out = new(string) - **out = **in - } - if in.IntervalInSeconds != nil { - in, out := &in.IntervalInSeconds, &out.IntervalInSeconds - *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.SizeLimitInBytes != nil { - in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes - *out = new(int) - **out = **in - } - if in.SkipEmptyArchives != nil { - in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription. -func (in *CaptureDescription) DeepCopy() *CaptureDescription { - if in == nil { - return nil - } - out := new(CaptureDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureDescription_STATUS) DeepCopyInto(out *CaptureDescription_STATUS) { - *out = *in - if in.Destination != nil { - in, out := &in.Destination, &out.Destination - *out = new(Destination_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.Encoding != nil { - in, out := &in.Encoding, &out.Encoding - *out = new(string) - **out = **in - } - if in.IntervalInSeconds != nil { - in, out := &in.IntervalInSeconds, &out.IntervalInSeconds - *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.SizeLimitInBytes != nil { - in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes - *out = new(int) - **out = **in - } - if in.SkipEmptyArchives != nil { - in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_STATUS. -func (in *CaptureDescription_STATUS) DeepCopy() *CaptureDescription_STATUS { - if in == nil { - return nil - } - out := new(CaptureDescription_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 *CaptureIdentity) DeepCopyInto(out *CaptureIdentity) { - *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.UserAssignedIdentityReference != nil { - in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference - *out = new(genruntime.ResourceReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureIdentity. -func (in *CaptureIdentity) DeepCopy() *CaptureIdentity { - if in == nil { - return nil - } - out := new(CaptureIdentity) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureIdentity_STATUS) DeepCopyInto(out *CaptureIdentity_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.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **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 CaptureIdentity_STATUS. -func (in *CaptureIdentity_STATUS) DeepCopy() *CaptureIdentity_STATUS { - if in == nil { - return nil - } - out := new(CaptureIdentity_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 *Destination) DeepCopyInto(out *Destination) { - *out = *in - if in.ArchiveNameFormat != nil { - in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat - *out = new(string) - **out = **in - } - if in.BlobContainer != nil { - in, out := &in.BlobContainer, &out.BlobContainer - *out = new(string) - **out = **in - } - if in.DataLakeAccountName != nil { - in, out := &in.DataLakeAccountName, &out.DataLakeAccountName - *out = new(string) - **out = **in - } - if in.DataLakeFolderPath != nil { - in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath - *out = new(string) - **out = **in - } - if in.DataLakeSubscriptionId != nil { - in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId - *out = new(string) - **out = **in - } - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(CaptureIdentity) - (*in).DeepCopyInto(*out) - } - 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.StorageAccountResourceReference != nil { - in, out := &in.StorageAccountResourceReference, &out.StorageAccountResourceReference - *out = new(genruntime.ResourceReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination. -func (in *Destination) DeepCopy() *Destination { - if in == nil { - return nil - } - out := new(Destination) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Destination_STATUS) DeepCopyInto(out *Destination_STATUS) { - *out = *in - if in.ArchiveNameFormat != nil { - in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat - *out = new(string) - **out = **in - } - if in.BlobContainer != nil { - in, out := &in.BlobContainer, &out.BlobContainer - *out = new(string) - **out = **in - } - if in.DataLakeAccountName != nil { - in, out := &in.DataLakeAccountName, &out.DataLakeAccountName - *out = new(string) - **out = **in - } - if in.DataLakeFolderPath != nil { - in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath - *out = new(string) - **out = **in - } - if in.DataLakeSubscriptionId != nil { - in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId - *out = new(string) - **out = **in - } - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(CaptureIdentity_STATUS) - (*in).DeepCopyInto(*out) - } - 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.StorageAccountResourceId != nil { - in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_STATUS. -func (in *Destination_STATUS) DeepCopy() *Destination_STATUS { - if in == nil { - return nil - } - out := new(Destination_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 *Encryption) DeepCopyInto(out *Encryption) { - *out = *in - if in.KeySource != nil { - in, out := &in.KeySource, &out.KeySource - *out = new(string) - **out = **in - } - if in.KeyVaultProperties != nil { - in, out := &in.KeyVaultProperties, &out.KeyVaultProperties - *out = make([]KeyVaultProperties, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.RequireInfrastructureEncryption != nil { - in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption. -func (in *Encryption) DeepCopy() *Encryption { - if in == nil { - return nil - } - out := new(Encryption) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Encryption_STATUS) DeepCopyInto(out *Encryption_STATUS) { - *out = *in - if in.KeySource != nil { - in, out := &in.KeySource, &out.KeySource - *out = new(string) - **out = **in - } - if in.KeyVaultProperties != nil { - in, out := &in.KeyVaultProperties, &out.KeyVaultProperties - *out = make([]KeyVaultProperties_STATUS, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.RequireInfrastructureEncryption != nil { - in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_STATUS. -func (in *Encryption_STATUS) DeepCopy() *Encryption_STATUS { - if in == nil { - return nil - } - out := new(Encryption_STATUS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Identity) DeepCopyInto(out *Identity) { - *out = *in - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UserAssignedIdentities != nil { - in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities - *out = make([]UserAssignedIdentityDetails, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. -func (in *Identity) DeepCopy() *Identity { - if in == nil { - return nil - } - out := new(Identity) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Identity_STATUS) DeepCopyInto(out *Identity_STATUS) { - *out = *in - if in.PrincipalId != nil { - in, out := &in.PrincipalId, &out.PrincipalId - *out = new(string) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.TenantId != nil { - in, out := &in.TenantId, &out.TenantId - *out = new(string) - **out = **in - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UserAssignedIdentities != nil { - in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities - *out = make(map[string]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.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(UserAssignedIdentityProperties) - (*in).DeepCopyInto(*out) - } - if in.KeyName != nil { - in, out := &in.KeyName, &out.KeyName - *out = new(string) - **out = **in - } - if in.KeyVaultUri != nil { - in, out := &in.KeyVaultUri, &out.KeyVaultUri - *out = new(string) - **out = **in - } - if in.KeyVersion != nil { - in, out := &in.KeyVersion, &out.KeyVersion - *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.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(UserAssignedIdentityProperties_STATUS) - (*in).DeepCopyInto(*out) - } - if in.KeyName != nil { - in, out := &in.KeyName, &out.KeyName - *out = new(string) - **out = **in - } - if in.KeyVaultUri != nil { - in, out := &in.KeyVaultUri, &out.KeyVaultUri - *out = new(string) - **out = **in - } - if in.KeyVersion != nil { - in, out := &in.KeyVersion, &out.KeyVersion - *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 *Namespace) DeepCopyInto(out *Namespace) { - *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 Namespace. -func (in *Namespace) DeepCopy() *Namespace { - if in == nil { - return nil - } - out := new(Namespace) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Namespace) 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 *NamespaceList) DeepCopyInto(out *NamespaceList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Namespace, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceList. -func (in *NamespaceList) DeepCopy() *NamespaceList { - if in == nil { - return nil - } - out := new(NamespaceList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespaceList) 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 *NamespaceOperatorSecrets) DeepCopyInto(out *NamespaceOperatorSecrets) { - *out = *in - if in.PrimaryConnectionString != nil { - in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *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.SecondaryConnectionString != nil { - in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSecrets. -func (in *NamespaceOperatorSecrets) DeepCopy() *NamespaceOperatorSecrets { - if in == nil { - return nil - } - out := new(NamespaceOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespaceOperatorSpec) DeepCopyInto(out *NamespaceOperatorSpec) { - *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(NamespaceOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSpec. -func (in *NamespaceOperatorSpec) DeepCopy() *NamespaceOperatorSpec { - if in == nil { - return nil - } - out := new(NamespaceOperatorSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespace_STATUS) DeepCopyInto(out *Namespace_STATUS) { - *out = *in - if in.AlternateName != nil { - in, out := &in.AlternateName, &out.AlternateName - *out = new(string) - **out = **in - } - if in.ClusterArmId != nil { - in, out := &in.ClusterArmId, &out.ClusterArmId - *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.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.DisableLocalAuth != nil { - in, out := &in.DisableLocalAuth, &out.DisableLocalAuth - *out = new(bool) - **out = **in - } - if in.Encryption != nil { - in, out := &in.Encryption, &out.Encryption - *out = new(Encryption_STATUS) - (*in).DeepCopyInto(*out) - } - 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.IsAutoInflateEnabled != nil { - in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled - *out = new(bool) - **out = **in - } - if in.KafkaEnabled != nil { - in, out := &in.KafkaEnabled, &out.KafkaEnabled - *out = new(bool) - **out = **in - } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } - if in.MaximumThroughputUnits != nil { - in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits - *out = new(int) - **out = **in - } - if in.MetricId != nil { - in, out := &in.MetricId, &out.MetricId - *out = new(string) - **out = **in - } - if in.MinimumTlsVersion != nil { - in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion - *out = new(string) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.PrivateEndpointConnections != nil { - in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections - *out = make([]PrivateEndpointConnection_STATUS, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ProvisioningState != nil { - in, out := &in.ProvisioningState, &out.ProvisioningState - *out = new(string) - **out = **in - } - if in.PublicNetworkAccess != nil { - in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess - *out = new(string) - **out = **in - } - if in.ServiceBusEndpoint != nil { - in, out := &in.ServiceBusEndpoint, &out.ServiceBusEndpoint - *out = new(string) - **out = **in - } - if in.Sku != nil { - in, out := &in.Sku, &out.Sku - *out = new(Sku_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **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.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } - if in.ZoneRedundant != nil { - in, out := &in.ZoneRedundant, &out.ZoneRedundant - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_STATUS. -func (in *Namespace_STATUS) DeepCopy() *Namespace_STATUS { - if in == nil { - return nil - } - out := new(Namespace_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 *Namespace_Spec) DeepCopyInto(out *Namespace_Spec) { - *out = *in - if in.AlternateName != nil { - in, out := &in.AlternateName, &out.AlternateName - *out = new(string) - **out = **in - } - if in.ClusterArmReference != nil { - in, out := &in.ClusterArmReference, &out.ClusterArmReference - *out = new(genruntime.ResourceReference) - **out = **in - } - if in.DisableLocalAuth != nil { - in, out := &in.DisableLocalAuth, &out.DisableLocalAuth - *out = new(bool) - **out = **in - } - if in.Encryption != nil { - in, out := &in.Encryption, &out.Encryption - *out = new(Encryption) - (*in).DeepCopyInto(*out) - } - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(Identity) - (*in).DeepCopyInto(*out) - } - if in.IsAutoInflateEnabled != nil { - in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled - *out = new(bool) - **out = **in - } - if in.KafkaEnabled != nil { - in, out := &in.KafkaEnabled, &out.KafkaEnabled - *out = new(bool) - **out = **in - } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } - if in.MaximumThroughputUnits != nil { - in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits - *out = new(int) - **out = **in - } - if in.MinimumTlsVersion != nil { - in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion - *out = new(string) - **out = **in - } - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(NamespaceOperatorSpec) - (*in).DeepCopyInto(*out) - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.PublicNetworkAccess != nil { - in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess - *out = new(string) - **out = **in - } - if in.Sku != nil { - in, out := &in.Sku, &out.Sku - *out = new(Sku) - (*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.ZoneRedundant != nil { - in, out := &in.ZoneRedundant, &out.ZoneRedundant - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Spec. -func (in *Namespace_Spec) DeepCopy() *Namespace_Spec { - if in == nil { - return nil - } - out := new(Namespace_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 *NamespacesAuthorizationRule) DeepCopyInto(out *NamespacesAuthorizationRule) { - *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 NamespacesAuthorizationRule. -func (in *NamespacesAuthorizationRule) DeepCopy() *NamespacesAuthorizationRule { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesAuthorizationRule) 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 *NamespacesAuthorizationRuleList) DeepCopyInto(out *NamespacesAuthorizationRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesAuthorizationRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleList. -func (in *NamespacesAuthorizationRuleList) DeepCopy() *NamespacesAuthorizationRuleList { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesAuthorizationRuleList) 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 *NamespacesAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSecrets) { - *out = *in - if in.PrimaryConnectionString != nil { - in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *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.SecondaryConnectionString != nil { - in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSecrets. -func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesAuthorizationRuleOperatorSecrets { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRuleOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSpec) { - *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(NamespacesAuthorizationRuleOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSpec. -func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesAuthorizationRuleOperatorSpec { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRuleOperatorSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesEventhub) DeepCopyInto(out *NamespacesEventhub) { - *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 NamespacesEventhub. -func (in *NamespacesEventhub) DeepCopy() *NamespacesEventhub { - if in == nil { - return nil - } - out := new(NamespacesEventhub) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhub) 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 *NamespacesEventhubList) DeepCopyInto(out *NamespacesEventhubList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesEventhub, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubList. -func (in *NamespacesEventhubList) DeepCopy() *NamespacesEventhubList { - if in == nil { - return nil - } - out := new(NamespacesEventhubList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubList) 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 *NamespacesEventhubsAuthorizationRule) DeepCopyInto(out *NamespacesEventhubsAuthorizationRule) { - *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 NamespacesEventhubsAuthorizationRule. -func (in *NamespacesEventhubsAuthorizationRule) DeepCopy() *NamespacesEventhubsAuthorizationRule { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsAuthorizationRule) 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 *NamespacesEventhubsAuthorizationRuleList) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesEventhubsAuthorizationRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleList. -func (in *NamespacesEventhubsAuthorizationRuleList) DeepCopy() *NamespacesEventhubsAuthorizationRuleList { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsAuthorizationRuleList) 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 *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSecrets) { - *out = *in - if in.PrimaryConnectionString != nil { - in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *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.SecondaryConnectionString != nil { - in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSecrets. -func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSecrets { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSpec) { - *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(NamespacesEventhubsAuthorizationRuleOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSpec. -func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSpec { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRuleOperatorSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesEventhubsConsumerGroup) DeepCopyInto(out *NamespacesEventhubsConsumerGroup) { - *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 NamespacesEventhubsConsumerGroup. -func (in *NamespacesEventhubsConsumerGroup) DeepCopy() *NamespacesEventhubsConsumerGroup { - if in == nil { - return nil - } - out := new(NamespacesEventhubsConsumerGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsConsumerGroup) 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 *NamespacesEventhubsConsumerGroupList) DeepCopyInto(out *NamespacesEventhubsConsumerGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesEventhubsConsumerGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsConsumerGroupList. -func (in *NamespacesEventhubsConsumerGroupList) DeepCopy() *NamespacesEventhubsConsumerGroupList { - if in == nil { - return nil - } - out := new(NamespacesEventhubsConsumerGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsConsumerGroupList) 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 *Namespaces_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_AuthorizationRule_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.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.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*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 Namespaces_AuthorizationRule_STATUS. -func (in *Namespaces_AuthorizationRule_STATUS) DeepCopy() *Namespaces_AuthorizationRule_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_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 *Namespaces_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec) { - *out = *in - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(NamespacesAuthorizationRuleOperatorSpec) - (*in).DeepCopyInto(*out) - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Spec. -func (in *Namespaces_AuthorizationRule_Spec) DeepCopy() *Namespaces_AuthorizationRule_Spec { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_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 *Namespaces_Eventhub_STATUS) DeepCopyInto(out *Namespaces_Eventhub_STATUS) { - *out = *in - if in.CaptureDescription != nil { - in, out := &in.CaptureDescription, &out.CaptureDescription - *out = new(CaptureDescription_STATUS) - (*in).DeepCopyInto(*out) - } - 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.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } - if in.MessageRetentionInDays != nil { - in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.PartitionCount != nil { - in, out := &in.PartitionCount, &out.PartitionCount - *out = new(int) - **out = **in - } - if in.PartitionIds != nil { - in, out := &in.PartitionIds, &out.PartitionIds - *out = make([]string, len(*in)) - copy(*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.RetentionDescription != nil { - in, out := &in.RetentionDescription, &out.RetentionDescription - *out = new(RetentionDescription_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_STATUS. -func (in *Namespaces_Eventhub_STATUS) DeepCopy() *Namespaces_Eventhub_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_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 *Namespaces_Eventhub_Spec) DeepCopyInto(out *Namespaces_Eventhub_Spec) { - *out = *in - if in.CaptureDescription != nil { - in, out := &in.CaptureDescription, &out.CaptureDescription - *out = new(CaptureDescription) - (*in).DeepCopyInto(*out) - } - if in.MessageRetentionInDays != nil { - in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays - *out = new(int) - **out = **in - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.PartitionCount != nil { - in, out := &in.PartitionCount, &out.PartitionCount - *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.RetentionDescription != nil { - in, out := &in.RetentionDescription, &out.RetentionDescription - *out = new(RetentionDescription) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Spec. -func (in *Namespaces_Eventhub_Spec) DeepCopy() *Namespaces_Eventhub_Spec { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_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 *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_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.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.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*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 Namespaces_Eventhubs_AuthorizationRule_STATUS. -func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec) { - *out = *in - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(NamespacesEventhubsAuthorizationRuleOperatorSpec) - (*in).DeepCopyInto(*out) - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Spec. -func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Spec { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_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.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - 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.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } - if in.UserMetadata != nil { - in, out := &in.UserMetadata, &out.UserMetadata - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_STATUS. -func (in *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopy() *Namespaces_Eventhubs_Consumergroup_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_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 *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Spec) { - *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.UserMetadata != nil { - in, out := &in.UserMetadata, &out.UserMetadata - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Spec. -func (in *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Spec { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_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 *PrivateEndpointConnection_STATUS) DeepCopyInto(out *PrivateEndpointConnection_STATUS) { - *out = *in - if in.Id != nil { - in, out := &in.Id, &out.Id - *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 PrivateEndpointConnection_STATUS. -func (in *PrivateEndpointConnection_STATUS) DeepCopy() *PrivateEndpointConnection_STATUS { - if in == nil { - return nil - } - out := new(PrivateEndpointConnection_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 *RetentionDescription) DeepCopyInto(out *RetentionDescription) { - *out = *in - if in.CleanupPolicy != nil { - in, out := &in.CleanupPolicy, &out.CleanupPolicy - *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.RetentionTimeInHours != nil { - in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours - *out = new(int) - **out = **in - } - if in.TombstoneRetentionTimeInHours != nil { - in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours - *out = new(int) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription. -func (in *RetentionDescription) DeepCopy() *RetentionDescription { - if in == nil { - return nil - } - out := new(RetentionDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetentionDescription_STATUS) DeepCopyInto(out *RetentionDescription_STATUS) { - *out = *in - if in.CleanupPolicy != nil { - in, out := &in.CleanupPolicy, &out.CleanupPolicy - *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.RetentionTimeInHours != nil { - in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours - *out = new(int) - **out = **in - } - if in.TombstoneRetentionTimeInHours != nil { - in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours - *out = new(int) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_STATUS. -func (in *RetentionDescription_STATUS) DeepCopy() *RetentionDescription_STATUS { - if in == nil { - return nil - } - out := new(RetentionDescription_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.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - 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.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - 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 *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { - *out = *in - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.CreatedBy != nil { - in, out := &in.CreatedBy, &out.CreatedBy - *out = new(string) - **out = **in - } - if in.CreatedByType != nil { - in, out := &in.CreatedByType, &out.CreatedByType - *out = new(string) - **out = **in - } - if in.LastModifiedAt != nil { - in, out := &in.LastModifiedAt, &out.LastModifiedAt - *out = new(string) - **out = **in - } - if in.LastModifiedBy != nil { - in, out := &in.LastModifiedBy, &out.LastModifiedBy - *out = new(string) - **out = **in - } - if in.LastModifiedByType != nil { - in, out := &in.LastModifiedByType, &out.LastModifiedByType - *out = new(string) - **out = **in - } - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS. -func (in *SystemData_STATUS) DeepCopy() *SystemData_STATUS { - if in == nil { - return nil - } - out := new(SystemData_STATUS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityDetails) DeepCopyInto(out *UserAssignedIdentityDetails) { - *out = *in - if in.PropertyBag != nil { - in, out := &in.PropertyBag, &out.PropertyBag - *out = make(genruntime.PropertyBag, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - out.Reference = in.Reference -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails. -func (in *UserAssignedIdentityDetails) DeepCopy() *UserAssignedIdentityDetails { - if in == nil { - return nil - } - out := new(UserAssignedIdentityDetails) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityProperties) DeepCopyInto(out *UserAssignedIdentityProperties) { - *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.UserAssignedIdentityReference != nil { - in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference - *out = new(genruntime.ResourceReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityProperties. -func (in *UserAssignedIdentityProperties) DeepCopy() *UserAssignedIdentityProperties { - if in == nil { - return nil - } - out := new(UserAssignedIdentityProperties) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityProperties_STATUS) DeepCopyInto(out *UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS. -func (in *UserAssignedIdentityProperties_STATUS) DeepCopy() *UserAssignedIdentityProperties_STATUS { - if in == nil { - return nil - } - out := new(UserAssignedIdentityProperties_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_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 - } - } -} - -// 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 -} diff --git a/v2/api/eventhub/v1api20240101/structure.txt b/v2/api/eventhub/v1api20240101/structure.txt deleted file mode 100644 index 25f4b188e51..00000000000 --- a/v2/api/eventhub/v1api20240101/structure.txt +++ /dev/null @@ -1,669 +0,0 @@ -// Code generated by azure-service-operator-codegen. DO NOT EDIT. -github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101 -├── APIVersion: Enum (1 value) -│ └── "2024-01-01" -├── Namespace: Resource -│ ├── Owner: resources/v1apiv20191001.ResourceGroup -│ ├── Spec: Object (17 properties) -│ │ ├── AlternateName: *string -│ │ ├── AzureName: Validated (3 rules) -│ │ │ ├── Rule 0: MaxLength: 50 -│ │ │ ├── Rule 1: MinLength: 6 -│ │ │ └── Rule 2: Pattern: "^[a-zA-Z][a-zA-Z0-9-]{6,50}[a-zA-Z0-9]$" -│ │ ├── ClusterArmReference: *genruntime.ResourceReference -│ │ ├── DisableLocalAuth: *bool -│ │ ├── Encryption: *Object (3 properties) -│ │ │ ├── KeySource: *Enum (1 value) -│ │ │ │ └── "Microsoft.KeyVault" -│ │ │ ├── KeyVaultProperties: Object (4 properties)[] -│ │ │ │ ├── Identity: *Object (1 property) -│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference -│ │ │ │ ├── KeyName: *string -│ │ │ │ ├── KeyVaultUri: *string -│ │ │ │ └── KeyVersion: *string -│ │ │ └── RequireInfrastructureEncryption: *bool -│ │ ├── Identity: *Object (2 properties) -│ │ │ ├── Type: *Enum (4 values) -│ │ │ │ ├── "None" -│ │ │ │ ├── "SystemAssigned" -│ │ │ │ ├── "SystemAssigned, UserAssigned" -│ │ │ │ └── "UserAssigned" -│ │ │ └── UserAssignedIdentities: Object (1 property)[] -│ │ │ └── Reference: genruntime.ResourceReference -│ │ ├── IsAutoInflateEnabled: *bool -│ │ ├── KafkaEnabled: *bool -│ │ ├── Location: *string -│ │ ├── MaximumThroughputUnits: Validated<*int> (1 rule) -│ │ │ └── Rule 0: Minimum: 0 -│ │ ├── MinimumTlsVersion: *Enum (3 values) -│ │ │ ├── "1.0" -│ │ │ ├── "1.1" -│ │ │ └── "1.2" -│ │ ├── OperatorSpec: *Object (1 property) -│ │ │ └── Secrets: *Object (4 properties) -│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination -│ │ │ └── SecondaryKey: *genruntime.SecretDestination -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PublicNetworkAccess: *Enum (3 values) -│ │ │ ├── "Disabled" -│ │ │ ├── "Enabled" -│ │ │ └── "SecuredByPerimeter" -│ │ ├── Sku: *Object (3 properties) -│ │ │ ├── Capacity: Validated<*int> (1 rule) -│ │ │ │ └── Rule 0: Minimum: 0 -│ │ │ ├── Name: *Enum (3 values) -│ │ │ │ ├── "Basic" -│ │ │ │ ├── "Premium" -│ │ │ │ └── "Standard" -│ │ │ └── Tier: *Enum (3 values) -│ │ │ ├── "Basic" -│ │ │ ├── "Premium" -│ │ │ └── "Standard" -│ │ ├── Tags: map[string]string -│ │ └── ZoneRedundant: *bool -│ └── Status: Object (26 properties) -│ ├── AlternateName: *string -│ ├── ClusterArmId: *string -│ ├── Conditions: conditions.Condition[] -│ ├── CreatedAt: *string -│ ├── DisableLocalAuth: *bool -│ ├── Encryption: *Object (3 properties) -│ │ ├── KeySource: *Enum (1 value) -│ │ │ └── "Microsoft.KeyVault" -│ │ ├── KeyVaultProperties: Object (4 properties)[] -│ │ │ ├── Identity: *Object (1 property) -│ │ │ │ └── UserAssignedIdentity: *string -│ │ │ ├── KeyName: *string -│ │ │ ├── KeyVaultUri: *string -│ │ │ └── KeyVersion: *string -│ │ └── RequireInfrastructureEncryption: *bool -│ ├── Id: *string -│ ├── Identity: *Object (4 properties) -│ │ ├── PrincipalId: *string -│ │ ├── TenantId: *string -│ │ ├── Type: *Enum (4 values) -│ │ │ ├── "None" -│ │ │ ├── "SystemAssigned" -│ │ │ ├── "SystemAssigned, UserAssigned" -│ │ │ └── "UserAssigned" -│ │ └── UserAssignedIdentities: map[string]Object (2 properties) -│ │ ├── ClientId: *string -│ │ └── PrincipalId: *string -│ ├── IsAutoInflateEnabled: *bool -│ ├── KafkaEnabled: *bool -│ ├── Location: *string -│ ├── MaximumThroughputUnits: *int -│ ├── MetricId: *string -│ ├── MinimumTlsVersion: *Enum (3 values) -│ │ ├── "1.0" -│ │ ├── "1.1" -│ │ └── "1.2" -│ ├── Name: *string -│ ├── PrivateEndpointConnections: Object (1 property)[] -│ │ └── Id: *string -│ ├── ProvisioningState: *string -│ ├── PublicNetworkAccess: *Enum (3 values) -│ │ ├── "Disabled" -│ │ ├── "Enabled" -│ │ └── "SecuredByPerimeter" -│ ├── ServiceBusEndpoint: *string -│ ├── Sku: *Object (3 properties) -│ │ ├── Capacity: *int -│ │ ├── Name: *Enum (3 values) -│ │ │ ├── "Basic" -│ │ │ ├── "Premium" -│ │ │ └── "Standard" -│ │ └── Tier: *Enum (3 values) -│ │ ├── "Basic" -│ │ ├── "Premium" -│ │ └── "Standard" -│ ├── Status: *string -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ ├── Tags: map[string]string -│ ├── Type: *string -│ ├── UpdatedAt: *string -│ └── ZoneRedundant: *bool -├── Namespace_STATUS_ARM: Object (9 properties) -│ ├── Id: *string -│ ├── Identity: *Object (4 properties) -│ │ ├── PrincipalId: *string -│ │ ├── TenantId: *string -│ │ ├── Type: *Enum (4 values) -│ │ │ ├── "None" -│ │ │ ├── "SystemAssigned" -│ │ │ ├── "SystemAssigned, UserAssigned" -│ │ │ └── "UserAssigned" -│ │ └── UserAssignedIdentities: map[string]Object (2 properties) -│ │ ├── ClientId: *string -│ │ └── PrincipalId: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── Properties: *Object (17 properties) -│ │ ├── AlternateName: *string -│ │ ├── ClusterArmId: *string -│ │ ├── CreatedAt: *string -│ │ ├── DisableLocalAuth: *bool -│ │ ├── Encryption: *Object (3 properties) -│ │ │ ├── KeySource: *Enum (1 value) -│ │ │ │ └── "Microsoft.KeyVault" -│ │ │ ├── KeyVaultProperties: Object (4 properties)[] -│ │ │ │ ├── Identity: *Object (1 property) -│ │ │ │ │ └── UserAssignedIdentity: *string -│ │ │ │ ├── KeyName: *string -│ │ │ │ ├── KeyVaultUri: *string -│ │ │ │ └── KeyVersion: *string -│ │ │ └── RequireInfrastructureEncryption: *bool -│ │ ├── IsAutoInflateEnabled: *bool -│ │ ├── KafkaEnabled: *bool -│ │ ├── MaximumThroughputUnits: *int -│ │ ├── MetricId: *string -│ │ ├── MinimumTlsVersion: *Enum (3 values) -│ │ │ ├── "1.0" -│ │ │ ├── "1.1" -│ │ │ └── "1.2" -│ │ ├── PrivateEndpointConnections: Object (1 property)[] -│ │ │ └── Id: *string -│ │ ├── ProvisioningState: *string -│ │ ├── PublicNetworkAccess: *Enum (3 values) -│ │ │ ├── "Disabled" -│ │ │ ├── "Enabled" -│ │ │ └── "SecuredByPerimeter" -│ │ ├── ServiceBusEndpoint: *string -│ │ ├── Status: *string -│ │ ├── UpdatedAt: *string -│ │ └── ZoneRedundant: *bool -│ ├── Sku: *Object (3 properties) -│ │ ├── Capacity: *int -│ │ ├── Name: *Enum (3 values) -│ │ │ ├── "Basic" -│ │ │ ├── "Premium" -│ │ │ └── "Standard" -│ │ └── Tier: *Enum (3 values) -│ │ ├── "Basic" -│ │ ├── "Premium" -│ │ └── "Standard" -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ ├── Tags: map[string]string -│ └── Type: *string -├── Namespace_Spec_ARM: Object (6 properties) -│ ├── Identity: *Object (2 properties) -│ │ ├── Type: *Enum (4 values) -│ │ │ ├── "None" -│ │ │ ├── "SystemAssigned" -│ │ │ ├── "SystemAssigned, UserAssigned" -│ │ │ └── "UserAssigned" -│ │ └── UserAssignedIdentities: map[string]Object (0 properties) -│ ├── Location: *string -│ ├── Name: string -│ ├── Properties: *Object (10 properties) -│ │ ├── AlternateName: *string -│ │ ├── ClusterArmId: *string -│ │ ├── DisableLocalAuth: *bool -│ │ ├── Encryption: *Object (3 properties) -│ │ │ ├── KeySource: *Enum (1 value) -│ │ │ │ └── "Microsoft.KeyVault" -│ │ │ ├── KeyVaultProperties: Object (4 properties)[] -│ │ │ │ ├── Identity: *Object (1 property) -│ │ │ │ │ └── UserAssignedIdentity: *string -│ │ │ │ ├── KeyName: *string -│ │ │ │ ├── KeyVaultUri: *string -│ │ │ │ └── KeyVersion: *string -│ │ │ └── RequireInfrastructureEncryption: *bool -│ │ ├── IsAutoInflateEnabled: *bool -│ │ ├── KafkaEnabled: *bool -│ │ ├── MaximumThroughputUnits: *int -│ │ ├── MinimumTlsVersion: *Enum (3 values) -│ │ │ ├── "1.0" -│ │ │ ├── "1.1" -│ │ │ └── "1.2" -│ │ ├── PublicNetworkAccess: *Enum (3 values) -│ │ │ ├── "Disabled" -│ │ │ ├── "Enabled" -│ │ │ └── "SecuredByPerimeter" -│ │ └── ZoneRedundant: *bool -│ ├── Sku: *Object (3 properties) -│ │ ├── Capacity: *int -│ │ ├── Name: *Enum (3 values) -│ │ │ ├── "Basic" -│ │ │ ├── "Premium" -│ │ │ └── "Standard" -│ │ └── Tier: *Enum (3 values) -│ │ ├── "Basic" -│ │ ├── "Premium" -│ │ └── "Standard" -│ └── Tags: map[string]string -├── NamespacesAuthorizationRule: Resource -│ ├── Owner: Namespace -│ ├── Spec: Object (4 properties) -│ │ ├── AzureName: Validated (1 rule) -│ │ │ └── Rule 0: MinLength: 1 -│ │ ├── OperatorSpec: *Object (1 property) -│ │ │ └── Secrets: *Object (4 properties) -│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination -│ │ │ └── SecondaryKey: *genruntime.SecretDestination -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ └── Rights: Enum (3 values)[] -│ │ ├── "Listen" -│ │ ├── "Manage" -│ │ └── "Send" -│ └── Status: Object (7 properties) -│ ├── Conditions: conditions.Condition[] -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── Rights: Enum (3 values)[] -│ │ ├── "Listen" -│ │ ├── "Manage" -│ │ └── "Send" -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ └── Type: *string -├── NamespacesEventhub: Resource -│ ├── Owner: Namespace -│ ├── Spec: Object (6 properties) -│ │ ├── AzureName: Validated (2 rules) -│ │ │ ├── Rule 0: MaxLength: 256 -│ │ │ └── Rule 1: MinLength: 1 -│ │ ├── CaptureDescription: *Object (6 properties) -│ │ │ ├── Destination: *Object (8 properties) -│ │ │ │ ├── ArchiveNameFormat: *string -│ │ │ │ ├── BlobContainer: *string -│ │ │ │ ├── DataLakeAccountName: *string -│ │ │ │ ├── DataLakeFolderPath: *string -│ │ │ │ ├── DataLakeSubscriptionId: Validated<*string> (1 rule) -│ │ │ │ │ └── Rule 0: Pattern: "^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$" -│ │ │ │ ├── Identity: *Object (2 properties) -│ │ │ │ │ ├── Type: *Enum (2 values) -│ │ │ │ │ │ ├── "SystemAssigned" -│ │ │ │ │ │ └── "UserAssigned" -│ │ │ │ │ └── UserAssignedIdentityReference: *genruntime.ResourceReference -│ │ │ │ ├── Name: *string -│ │ │ │ └── StorageAccountResourceReference: *genruntime.ResourceReference -│ │ │ ├── Enabled: *bool -│ │ │ ├── Encoding: *Enum (2 values) -│ │ │ │ ├── "Avro" -│ │ │ │ └── "AvroDeflate" -│ │ │ ├── IntervalInSeconds: *int -│ │ │ ├── SizeLimitInBytes: *int -│ │ │ └── SkipEmptyArchives: *bool -│ │ ├── MessageRetentionInDays: Validated<*int> (1 rule) -│ │ │ └── Rule 0: Minimum: 1 -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ ├── PartitionCount: Validated<*int> (1 rule) -│ │ │ └── Rule 0: Minimum: 1 -│ │ └── RetentionDescription: *Object (3 properties) -│ │ ├── CleanupPolicy: *Enum (2 values) -│ │ │ ├── "Compact" -│ │ │ └── "Delete" -│ │ ├── RetentionTimeInHours: *int -│ │ └── TombstoneRetentionTimeInHours: *int -│ └── Status: Object (14 properties) -│ ├── CaptureDescription: *Object (6 properties) -│ │ ├── Destination: *Object (8 properties) -│ │ │ ├── ArchiveNameFormat: *string -│ │ │ ├── BlobContainer: *string -│ │ │ ├── DataLakeAccountName: *string -│ │ │ ├── DataLakeFolderPath: *string -│ │ │ ├── DataLakeSubscriptionId: *string -│ │ │ ├── Identity: *Object (2 properties) -│ │ │ │ ├── Type: *Enum (2 values) -│ │ │ │ │ ├── "SystemAssigned" -│ │ │ │ │ └── "UserAssigned" -│ │ │ │ └── UserAssignedIdentity: *string -│ │ │ ├── Name: *string -│ │ │ └── StorageAccountResourceId: *string -│ │ ├── Enabled: *bool -│ │ ├── Encoding: *Enum (2 values) -│ │ │ ├── "Avro" -│ │ │ └── "AvroDeflate" -│ │ ├── IntervalInSeconds: *int -│ │ ├── SizeLimitInBytes: *int -│ │ └── SkipEmptyArchives: *bool -│ ├── Conditions: conditions.Condition[] -│ ├── CreatedAt: *string -│ ├── Id: *string -│ ├── Location: *string -│ ├── MessageRetentionInDays: *int -│ ├── Name: *string -│ ├── PartitionCount: *int -│ ├── PartitionIds: string[] -│ ├── RetentionDescription: *Object (3 properties) -│ │ ├── CleanupPolicy: *Enum (2 values) -│ │ │ ├── "Compact" -│ │ │ └── "Delete" -│ │ ├── RetentionTimeInHours: *int -│ │ └── TombstoneRetentionTimeInHours: *int -│ ├── Status: *Enum (9 values) -│ │ ├── "Active" -│ │ ├── "Creating" -│ │ ├── "Deleting" -│ │ ├── "Disabled" -│ │ ├── "ReceiveDisabled" -│ │ ├── "Renaming" -│ │ ├── "Restoring" -│ │ ├── "SendDisabled" -│ │ └── "Unknown" -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ ├── Type: *string -│ └── UpdatedAt: *string -├── NamespacesEventhubsAuthorizationRule: Resource -│ ├── Owner: NamespacesEventhub -│ ├── Spec: Object (4 properties) -│ │ ├── AzureName: Validated (1 rule) -│ │ │ └── Rule 0: MinLength: 1 -│ │ ├── OperatorSpec: *Object (1 property) -│ │ │ └── Secrets: *Object (4 properties) -│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination -│ │ │ ├── PrimaryKey: *genruntime.SecretDestination -│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination -│ │ │ └── SecondaryKey: *genruntime.SecretDestination -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ └── Rights: Enum (3 values)[] -│ │ ├── "Listen" -│ │ ├── "Manage" -│ │ └── "Send" -│ └── Status: Object (7 properties) -│ ├── Conditions: conditions.Condition[] -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── Rights: Enum (3 values)[] -│ │ ├── "Listen" -│ │ ├── "Manage" -│ │ └── "Send" -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ └── Type: *string -├── NamespacesEventhubsConsumerGroup: Resource -│ ├── Owner: NamespacesEventhub -│ ├── Spec: Object (3 properties) -│ │ ├── AzureName: Validated (2 rules) -│ │ │ ├── Rule 0: MaxLength: 50 -│ │ │ └── Rule 1: MinLength: 1 -│ │ ├── Owner: *genruntime.KnownResourceReference -│ │ └── UserMetadata: *string -│ └── Status: Object (9 properties) -│ ├── Conditions: conditions.Condition[] -│ ├── CreatedAt: *string -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ ├── Type: *string -│ ├── UpdatedAt: *string -│ └── UserMetadata: *string -├── Namespaces_AuthorizationRule_STATUS_ARM: Object (6 properties) -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── Properties: *Object (1 property) -│ │ └── Rights: Enum (3 values)[] -│ │ ├── "Listen" -│ │ ├── "Manage" -│ │ └── "Send" -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ └── Type: *string -├── Namespaces_AuthorizationRule_Spec_ARM: Object (2 properties) -│ ├── Name: string -│ └── Properties: *Object (1 property) -│ └── Rights: Enum (3 values)[] -│ ├── "Listen" -│ ├── "Manage" -│ └── "Send" -├── Namespaces_Eventhub_STATUS_ARM: Object (6 properties) -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── Properties: *Object (8 properties) -│ │ ├── CaptureDescription: *Object (6 properties) -│ │ │ ├── Destination: *Object (3 properties) -│ │ │ │ ├── Identity: *Object (2 properties) -│ │ │ │ │ ├── Type: *Enum (2 values) -│ │ │ │ │ │ ├── "SystemAssigned" -│ │ │ │ │ │ └── "UserAssigned" -│ │ │ │ │ └── UserAssignedIdentity: *string -│ │ │ │ ├── Name: *string -│ │ │ │ └── Properties: *Object (6 properties) -│ │ │ │ ├── ArchiveNameFormat: *string -│ │ │ │ ├── BlobContainer: *string -│ │ │ │ ├── DataLakeAccountName: *string -│ │ │ │ ├── DataLakeFolderPath: *string -│ │ │ │ ├── DataLakeSubscriptionId: *string -│ │ │ │ └── StorageAccountResourceId: *string -│ │ │ ├── Enabled: *bool -│ │ │ ├── Encoding: *Enum (2 values) -│ │ │ │ ├── "Avro" -│ │ │ │ └── "AvroDeflate" -│ │ │ ├── IntervalInSeconds: *int -│ │ │ ├── SizeLimitInBytes: *int -│ │ │ └── SkipEmptyArchives: *bool -│ │ ├── CreatedAt: *string -│ │ ├── MessageRetentionInDays: *int -│ │ ├── PartitionCount: *int -│ │ ├── PartitionIds: string[] -│ │ ├── RetentionDescription: *Object (3 properties) -│ │ │ ├── CleanupPolicy: *Enum (2 values) -│ │ │ │ ├── "Compact" -│ │ │ │ └── "Delete" -│ │ │ ├── RetentionTimeInHours: *int -│ │ │ └── TombstoneRetentionTimeInHours: *int -│ │ ├── Status: *Enum (9 values) -│ │ │ ├── "Active" -│ │ │ ├── "Creating" -│ │ │ ├── "Deleting" -│ │ │ ├── "Disabled" -│ │ │ ├── "ReceiveDisabled" -│ │ │ ├── "Renaming" -│ │ │ ├── "Restoring" -│ │ │ ├── "SendDisabled" -│ │ │ └── "Unknown" -│ │ └── UpdatedAt: *string -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ └── Type: *string -├── Namespaces_Eventhub_Spec_ARM: Object (2 properties) -│ ├── Name: string -│ └── Properties: *Object (4 properties) -│ ├── CaptureDescription: *Object (6 properties) -│ │ ├── Destination: *Object (3 properties) -│ │ │ ├── Identity: *Object (2 properties) -│ │ │ │ ├── Type: *Enum (2 values) -│ │ │ │ │ ├── "SystemAssigned" -│ │ │ │ │ └── "UserAssigned" -│ │ │ │ └── UserAssignedIdentity: *string -│ │ │ ├── Name: *string -│ │ │ └── Properties: *Object (6 properties) -│ │ │ ├── ArchiveNameFormat: *string -│ │ │ ├── BlobContainer: *string -│ │ │ ├── DataLakeAccountName: *string -│ │ │ ├── DataLakeFolderPath: *string -│ │ │ ├── DataLakeSubscriptionId: *string -│ │ │ └── StorageAccountResourceId: *string -│ │ ├── Enabled: *bool -│ │ ├── Encoding: *Enum (2 values) -│ │ │ ├── "Avro" -│ │ │ └── "AvroDeflate" -│ │ ├── IntervalInSeconds: *int -│ │ ├── SizeLimitInBytes: *int -│ │ └── SkipEmptyArchives: *bool -│ ├── MessageRetentionInDays: *int -│ ├── PartitionCount: *int -│ └── RetentionDescription: *Object (3 properties) -│ ├── CleanupPolicy: *Enum (2 values) -│ │ ├── "Compact" -│ │ └── "Delete" -│ ├── RetentionTimeInHours: *int -│ └── TombstoneRetentionTimeInHours: *int -├── Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM: Object (6 properties) -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── Properties: *Object (1 property) -│ │ └── Rights: Enum (3 values)[] -│ │ ├── "Listen" -│ │ ├── "Manage" -│ │ └── "Send" -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ └── Type: *string -├── Namespaces_Eventhubs_AuthorizationRule_Spec_ARM: Object (2 properties) -│ ├── Name: string -│ └── Properties: *Object (1 property) -│ └── Rights: Enum (3 values)[] -│ ├── "Listen" -│ ├── "Manage" -│ └── "Send" -├── Namespaces_Eventhubs_Consumergroup_STATUS_ARM: Object (6 properties) -│ ├── Id: *string -│ ├── Location: *string -│ ├── Name: *string -│ ├── Properties: *Object (3 properties) -│ │ ├── CreatedAt: *string -│ │ ├── UpdatedAt: *string -│ │ └── UserMetadata: *string -│ ├── SystemData: *Object (6 properties) -│ │ ├── CreatedAt: *string -│ │ ├── CreatedBy: *string -│ │ ├── CreatedByType: *Enum (4 values) -│ │ │ ├── "Application" -│ │ │ ├── "Key" -│ │ │ ├── "ManagedIdentity" -│ │ │ └── "User" -│ │ ├── LastModifiedAt: *string -│ │ ├── LastModifiedBy: *string -│ │ └── LastModifiedByType: *Enum (4 values) -│ │ ├── "Application" -│ │ ├── "Key" -│ │ ├── "ManagedIdentity" -│ │ └── "User" -│ └── Type: *string -└── Namespaces_Eventhubs_Consumergroup_Spec_ARM: Object (2 properties) - ├── Name: string - └── Properties: *Object (1 property) - └── UserMetadata: *string diff --git a/v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go b/v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go deleted file mode 100644 index bcbd04a6b9c..00000000000 --- a/v2/api/eventhub/v1api20240101/zz_generated.deepcopy.go +++ /dev/null @@ -1,3318 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright (c) Microsoft Corporation. -Licensed under the MIT license. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1api20240101 - -import ( - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureDescription) DeepCopyInto(out *CaptureDescription) { - *out = *in - if in.Destination != nil { - in, out := &in.Destination, &out.Destination - *out = new(Destination) - (*in).DeepCopyInto(*out) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.Encoding != nil { - in, out := &in.Encoding, &out.Encoding - *out = new(CaptureDescription_Encoding) - **out = **in - } - if in.IntervalInSeconds != nil { - in, out := &in.IntervalInSeconds, &out.IntervalInSeconds - *out = new(int) - **out = **in - } - if in.SizeLimitInBytes != nil { - in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes - *out = new(int) - **out = **in - } - if in.SkipEmptyArchives != nil { - in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription. -func (in *CaptureDescription) DeepCopy() *CaptureDescription { - if in == nil { - return nil - } - out := new(CaptureDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureDescription_ARM) DeepCopyInto(out *CaptureDescription_ARM) { - *out = *in - if in.Destination != nil { - in, out := &in.Destination, &out.Destination - *out = new(Destination_ARM) - (*in).DeepCopyInto(*out) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.Encoding != nil { - in, out := &in.Encoding, &out.Encoding - *out = new(CaptureDescription_Encoding) - **out = **in - } - if in.IntervalInSeconds != nil { - in, out := &in.IntervalInSeconds, &out.IntervalInSeconds - *out = new(int) - **out = **in - } - if in.SizeLimitInBytes != nil { - in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes - *out = new(int) - **out = **in - } - if in.SkipEmptyArchives != nil { - in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_ARM. -func (in *CaptureDescription_ARM) DeepCopy() *CaptureDescription_ARM { - if in == nil { - return nil - } - out := new(CaptureDescription_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureDescription_STATUS) DeepCopyInto(out *CaptureDescription_STATUS) { - *out = *in - if in.Destination != nil { - in, out := &in.Destination, &out.Destination - *out = new(Destination_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.Encoding != nil { - in, out := &in.Encoding, &out.Encoding - *out = new(CaptureDescription_Encoding_STATUS) - **out = **in - } - if in.IntervalInSeconds != nil { - in, out := &in.IntervalInSeconds, &out.IntervalInSeconds - *out = new(int) - **out = **in - } - if in.SizeLimitInBytes != nil { - in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes - *out = new(int) - **out = **in - } - if in.SkipEmptyArchives != nil { - in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_STATUS. -func (in *CaptureDescription_STATUS) DeepCopy() *CaptureDescription_STATUS { - if in == nil { - return nil - } - out := new(CaptureDescription_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 *CaptureDescription_STATUS_ARM) DeepCopyInto(out *CaptureDescription_STATUS_ARM) { - *out = *in - if in.Destination != nil { - in, out := &in.Destination, &out.Destination - *out = new(Destination_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } - if in.Encoding != nil { - in, out := &in.Encoding, &out.Encoding - *out = new(CaptureDescription_Encoding_STATUS) - **out = **in - } - if in.IntervalInSeconds != nil { - in, out := &in.IntervalInSeconds, &out.IntervalInSeconds - *out = new(int) - **out = **in - } - if in.SizeLimitInBytes != nil { - in, out := &in.SizeLimitInBytes, &out.SizeLimitInBytes - *out = new(int) - **out = **in - } - if in.SkipEmptyArchives != nil { - in, out := &in.SkipEmptyArchives, &out.SkipEmptyArchives - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureDescription_STATUS_ARM. -func (in *CaptureDescription_STATUS_ARM) DeepCopy() *CaptureDescription_STATUS_ARM { - if in == nil { - return nil - } - out := new(CaptureDescription_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureIdentity) DeepCopyInto(out *CaptureIdentity) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(CaptureIdentity_Type) - **out = **in - } - if in.UserAssignedIdentityReference != nil { - in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference - *out = new(genruntime.ResourceReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptureIdentity. -func (in *CaptureIdentity) DeepCopy() *CaptureIdentity { - if in == nil { - return nil - } - out := new(CaptureIdentity) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureIdentity_ARM) DeepCopyInto(out *CaptureIdentity_ARM) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(CaptureIdentity_Type) - **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 CaptureIdentity_ARM. -func (in *CaptureIdentity_ARM) DeepCopy() *CaptureIdentity_ARM { - if in == nil { - return nil - } - out := new(CaptureIdentity_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CaptureIdentity_STATUS) DeepCopyInto(out *CaptureIdentity_STATUS) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(CaptureIdentity_Type_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 CaptureIdentity_STATUS. -func (in *CaptureIdentity_STATUS) DeepCopy() *CaptureIdentity_STATUS { - if in == nil { - return nil - } - out := new(CaptureIdentity_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 *CaptureIdentity_STATUS_ARM) DeepCopyInto(out *CaptureIdentity_STATUS_ARM) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(CaptureIdentity_Type_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 CaptureIdentity_STATUS_ARM. -func (in *CaptureIdentity_STATUS_ARM) DeepCopy() *CaptureIdentity_STATUS_ARM { - if in == nil { - return nil - } - out := new(CaptureIdentity_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Destination) DeepCopyInto(out *Destination) { - *out = *in - if in.ArchiveNameFormat != nil { - in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat - *out = new(string) - **out = **in - } - if in.BlobContainer != nil { - in, out := &in.BlobContainer, &out.BlobContainer - *out = new(string) - **out = **in - } - if in.DataLakeAccountName != nil { - in, out := &in.DataLakeAccountName, &out.DataLakeAccountName - *out = new(string) - **out = **in - } - if in.DataLakeFolderPath != nil { - in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath - *out = new(string) - **out = **in - } - if in.DataLakeSubscriptionId != nil { - in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId - *out = new(string) - **out = **in - } - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(CaptureIdentity) - (*in).DeepCopyInto(*out) - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.StorageAccountResourceReference != nil { - in, out := &in.StorageAccountResourceReference, &out.StorageAccountResourceReference - *out = new(genruntime.ResourceReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination. -func (in *Destination) DeepCopy() *Destination { - if in == nil { - return nil - } - out := new(Destination) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Destination_ARM) DeepCopyInto(out *Destination_ARM) { - *out = *in - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(CaptureIdentity_ARM) - (*in).DeepCopyInto(*out) - } - 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(Destination_Properties_ARM) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_ARM. -func (in *Destination_ARM) DeepCopy() *Destination_ARM { - if in == nil { - return nil - } - out := new(Destination_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Destination_Properties_ARM) DeepCopyInto(out *Destination_Properties_ARM) { - *out = *in - if in.ArchiveNameFormat != nil { - in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat - *out = new(string) - **out = **in - } - if in.BlobContainer != nil { - in, out := &in.BlobContainer, &out.BlobContainer - *out = new(string) - **out = **in - } - if in.DataLakeAccountName != nil { - in, out := &in.DataLakeAccountName, &out.DataLakeAccountName - *out = new(string) - **out = **in - } - if in.DataLakeFolderPath != nil { - in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath - *out = new(string) - **out = **in - } - if in.DataLakeSubscriptionId != nil { - in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId - *out = new(string) - **out = **in - } - if in.StorageAccountResourceId != nil { - in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_Properties_ARM. -func (in *Destination_Properties_ARM) DeepCopy() *Destination_Properties_ARM { - if in == nil { - return nil - } - out := new(Destination_Properties_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Destination_Properties_STATUS_ARM) DeepCopyInto(out *Destination_Properties_STATUS_ARM) { - *out = *in - if in.ArchiveNameFormat != nil { - in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat - *out = new(string) - **out = **in - } - if in.BlobContainer != nil { - in, out := &in.BlobContainer, &out.BlobContainer - *out = new(string) - **out = **in - } - if in.DataLakeAccountName != nil { - in, out := &in.DataLakeAccountName, &out.DataLakeAccountName - *out = new(string) - **out = **in - } - if in.DataLakeFolderPath != nil { - in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath - *out = new(string) - **out = **in - } - if in.DataLakeSubscriptionId != nil { - in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId - *out = new(string) - **out = **in - } - if in.StorageAccountResourceId != nil { - in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_Properties_STATUS_ARM. -func (in *Destination_Properties_STATUS_ARM) DeepCopy() *Destination_Properties_STATUS_ARM { - if in == nil { - return nil - } - out := new(Destination_Properties_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Destination_STATUS) DeepCopyInto(out *Destination_STATUS) { - *out = *in - if in.ArchiveNameFormat != nil { - in, out := &in.ArchiveNameFormat, &out.ArchiveNameFormat - *out = new(string) - **out = **in - } - if in.BlobContainer != nil { - in, out := &in.BlobContainer, &out.BlobContainer - *out = new(string) - **out = **in - } - if in.DataLakeAccountName != nil { - in, out := &in.DataLakeAccountName, &out.DataLakeAccountName - *out = new(string) - **out = **in - } - if in.DataLakeFolderPath != nil { - in, out := &in.DataLakeFolderPath, &out.DataLakeFolderPath - *out = new(string) - **out = **in - } - if in.DataLakeSubscriptionId != nil { - in, out := &in.DataLakeSubscriptionId, &out.DataLakeSubscriptionId - *out = new(string) - **out = **in - } - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(CaptureIdentity_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.StorageAccountResourceId != nil { - in, out := &in.StorageAccountResourceId, &out.StorageAccountResourceId - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_STATUS. -func (in *Destination_STATUS) DeepCopy() *Destination_STATUS { - if in == nil { - return nil - } - out := new(Destination_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 *Destination_STATUS_ARM) DeepCopyInto(out *Destination_STATUS_ARM) { - *out = *in - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(CaptureIdentity_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - 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(Destination_Properties_STATUS_ARM) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination_STATUS_ARM. -func (in *Destination_STATUS_ARM) DeepCopy() *Destination_STATUS_ARM { - if in == nil { - return nil - } - out := new(Destination_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Encryption) DeepCopyInto(out *Encryption) { - *out = *in - if in.KeySource != nil { - in, out := &in.KeySource, &out.KeySource - *out = new(Encryption_KeySource) - **out = **in - } - if in.KeyVaultProperties != nil { - in, out := &in.KeyVaultProperties, &out.KeyVaultProperties - *out = make([]KeyVaultProperties, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RequireInfrastructureEncryption != nil { - in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption. -func (in *Encryption) DeepCopy() *Encryption { - if in == nil { - return nil - } - out := new(Encryption) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Encryption_ARM) DeepCopyInto(out *Encryption_ARM) { - *out = *in - if in.KeySource != nil { - in, out := &in.KeySource, &out.KeySource - *out = new(Encryption_KeySource) - **out = **in - } - if in.KeyVaultProperties != nil { - in, out := &in.KeyVaultProperties, &out.KeyVaultProperties - *out = make([]KeyVaultProperties_ARM, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RequireInfrastructureEncryption != nil { - in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_ARM. -func (in *Encryption_ARM) DeepCopy() *Encryption_ARM { - if in == nil { - return nil - } - out := new(Encryption_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Encryption_STATUS) DeepCopyInto(out *Encryption_STATUS) { - *out = *in - if in.KeySource != nil { - in, out := &in.KeySource, &out.KeySource - *out = new(Encryption_KeySource_STATUS) - **out = **in - } - if in.KeyVaultProperties != nil { - in, out := &in.KeyVaultProperties, &out.KeyVaultProperties - *out = make([]KeyVaultProperties_STATUS, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RequireInfrastructureEncryption != nil { - in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_STATUS. -func (in *Encryption_STATUS) DeepCopy() *Encryption_STATUS { - if in == nil { - return nil - } - out := new(Encryption_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 *Encryption_STATUS_ARM) DeepCopyInto(out *Encryption_STATUS_ARM) { - *out = *in - if in.KeySource != nil { - in, out := &in.KeySource, &out.KeySource - *out = new(Encryption_KeySource_STATUS) - **out = **in - } - if in.KeyVaultProperties != nil { - in, out := &in.KeyVaultProperties, &out.KeyVaultProperties - *out = make([]KeyVaultProperties_STATUS_ARM, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RequireInfrastructureEncryption != nil { - in, out := &in.RequireInfrastructureEncryption, &out.RequireInfrastructureEncryption - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Encryption_STATUS_ARM. -func (in *Encryption_STATUS_ARM) DeepCopy() *Encryption_STATUS_ARM { - if in == nil { - return nil - } - out := new(Encryption_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Identity) DeepCopyInto(out *Identity) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(Identity_Type) - **out = **in - } - if in.UserAssignedIdentities != nil { - in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities - *out = make([]UserAssignedIdentityDetails, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. -func (in *Identity) DeepCopy() *Identity { - if in == nil { - return nil - } - out := new(Identity) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Identity_ARM) DeepCopyInto(out *Identity_ARM) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(Identity_Type) - **out = **in - } - if in.UserAssignedIdentities != nil { - in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities - *out = make(map[string]UserAssignedIdentityDetails_ARM, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity_ARM. -func (in *Identity_ARM) DeepCopy() *Identity_ARM { - if in == nil { - return nil - } - out := new(Identity_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Identity_STATUS) DeepCopyInto(out *Identity_STATUS) { - *out = *in - if in.PrincipalId != nil { - in, out := &in.PrincipalId, &out.PrincipalId - *out = new(string) - **out = **in - } - if in.TenantId != nil { - in, out := &in.TenantId, &out.TenantId - *out = new(string) - **out = **in - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(Identity_Type_STATUS) - **out = **in - } - if in.UserAssignedIdentities != nil { - in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities - *out = make(map[string]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_STATUS_ARM) DeepCopyInto(out *Identity_STATUS_ARM) { - *out = *in - if in.PrincipalId != nil { - in, out := &in.PrincipalId, &out.PrincipalId - *out = new(string) - **out = **in - } - if in.TenantId != nil { - in, out := &in.TenantId, &out.TenantId - *out = new(string) - **out = **in - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(Identity_Type_STATUS) - **out = **in - } - if in.UserAssignedIdentities != nil { - in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities - *out = make(map[string]UserAssignedIdentity_STATUS_ARM, 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_ARM. -func (in *Identity_STATUS_ARM) DeepCopy() *Identity_STATUS_ARM { - if in == nil { - return nil - } - out := new(Identity_STATUS_ARM) - 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.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(UserAssignedIdentityProperties) - (*in).DeepCopyInto(*out) - } - if in.KeyName != nil { - in, out := &in.KeyName, &out.KeyName - *out = new(string) - **out = **in - } - if in.KeyVaultUri != nil { - in, out := &in.KeyVaultUri, &out.KeyVaultUri - *out = new(string) - **out = **in - } - if in.KeyVersion != nil { - in, out := &in.KeyVersion, &out.KeyVersion - *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 *KeyVaultProperties_ARM) DeepCopyInto(out *KeyVaultProperties_ARM) { - *out = *in - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(UserAssignedIdentityProperties_ARM) - (*in).DeepCopyInto(*out) - } - if in.KeyName != nil { - in, out := &in.KeyName, &out.KeyName - *out = new(string) - **out = **in - } - if in.KeyVaultUri != nil { - in, out := &in.KeyVaultUri, &out.KeyVaultUri - *out = new(string) - **out = **in - } - if in.KeyVersion != nil { - in, out := &in.KeyVersion, &out.KeyVersion - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultProperties_ARM. -func (in *KeyVaultProperties_ARM) DeepCopy() *KeyVaultProperties_ARM { - if in == nil { - return nil - } - out := new(KeyVaultProperties_ARM) - 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.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(UserAssignedIdentityProperties_STATUS) - (*in).DeepCopyInto(*out) - } - if in.KeyName != nil { - in, out := &in.KeyName, &out.KeyName - *out = new(string) - **out = **in - } - if in.KeyVaultUri != nil { - in, out := &in.KeyVaultUri, &out.KeyVaultUri - *out = new(string) - **out = **in - } - if in.KeyVersion != nil { - in, out := &in.KeyVersion, &out.KeyVersion - *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_STATUS_ARM) DeepCopyInto(out *KeyVaultProperties_STATUS_ARM) { - *out = *in - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(UserAssignedIdentityProperties_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.KeyName != nil { - in, out := &in.KeyName, &out.KeyName - *out = new(string) - **out = **in - } - if in.KeyVaultUri != nil { - in, out := &in.KeyVaultUri, &out.KeyVaultUri - *out = new(string) - **out = **in - } - if in.KeyVersion != nil { - in, out := &in.KeyVersion, &out.KeyVersion - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyVaultProperties_STATUS_ARM. -func (in *KeyVaultProperties_STATUS_ARM) DeepCopy() *KeyVaultProperties_STATUS_ARM { - if in == nil { - return nil - } - out := new(KeyVaultProperties_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespace) DeepCopyInto(out *Namespace) { - *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 Namespace. -func (in *Namespace) DeepCopy() *Namespace { - if in == nil { - return nil - } - out := new(Namespace) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Namespace) 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 *NamespaceList) DeepCopyInto(out *NamespaceList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Namespace, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceList. -func (in *NamespaceList) DeepCopy() *NamespaceList { - if in == nil { - return nil - } - out := new(NamespaceList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespaceList) 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 *NamespaceOperatorSecrets) DeepCopyInto(out *NamespaceOperatorSecrets) { - *out = *in - if in.PrimaryConnectionString != nil { - in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryConnectionString != nil { - in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSecrets. -func (in *NamespaceOperatorSecrets) DeepCopy() *NamespaceOperatorSecrets { - if in == nil { - return nil - } - out := new(NamespaceOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespaceOperatorSpec) DeepCopyInto(out *NamespaceOperatorSpec) { - *out = *in - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = new(NamespaceOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceOperatorSpec. -func (in *NamespaceOperatorSpec) DeepCopy() *NamespaceOperatorSpec { - if in == nil { - return nil - } - out := new(NamespaceOperatorSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespace_Properties_STATUS_ARM) DeepCopyInto(out *Namespace_Properties_STATUS_ARM) { - *out = *in - if in.AlternateName != nil { - in, out := &in.AlternateName, &out.AlternateName - *out = new(string) - **out = **in - } - if in.ClusterArmId != nil { - in, out := &in.ClusterArmId, &out.ClusterArmId - *out = new(string) - **out = **in - } - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.DisableLocalAuth != nil { - in, out := &in.DisableLocalAuth, &out.DisableLocalAuth - *out = new(bool) - **out = **in - } - if in.Encryption != nil { - in, out := &in.Encryption, &out.Encryption - *out = new(Encryption_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.IsAutoInflateEnabled != nil { - in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled - *out = new(bool) - **out = **in - } - if in.KafkaEnabled != nil { - in, out := &in.KafkaEnabled, &out.KafkaEnabled - *out = new(bool) - **out = **in - } - if in.MaximumThroughputUnits != nil { - in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits - *out = new(int) - **out = **in - } - if in.MetricId != nil { - in, out := &in.MetricId, &out.MetricId - *out = new(string) - **out = **in - } - if in.MinimumTlsVersion != nil { - in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion - *out = new(Namespace_Properties_MinimumTlsVersion_STATUS) - **out = **in - } - if in.PrivateEndpointConnections != nil { - in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections - *out = make([]PrivateEndpointConnection_STATUS_ARM, 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.PublicNetworkAccess != nil { - in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess - *out = new(Namespace_Properties_PublicNetworkAccess_STATUS) - **out = **in - } - if in.ServiceBusEndpoint != nil { - in, out := &in.ServiceBusEndpoint, &out.ServiceBusEndpoint - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } - if in.ZoneRedundant != nil { - in, out := &in.ZoneRedundant, &out.ZoneRedundant - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Properties_STATUS_ARM. -func (in *Namespace_Properties_STATUS_ARM) DeepCopy() *Namespace_Properties_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespace_Properties_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespace_Properties_Spec_ARM) DeepCopyInto(out *Namespace_Properties_Spec_ARM) { - *out = *in - if in.AlternateName != nil { - in, out := &in.AlternateName, &out.AlternateName - *out = new(string) - **out = **in - } - if in.ClusterArmId != nil { - in, out := &in.ClusterArmId, &out.ClusterArmId - *out = new(string) - **out = **in - } - if in.DisableLocalAuth != nil { - in, out := &in.DisableLocalAuth, &out.DisableLocalAuth - *out = new(bool) - **out = **in - } - if in.Encryption != nil { - in, out := &in.Encryption, &out.Encryption - *out = new(Encryption_ARM) - (*in).DeepCopyInto(*out) - } - if in.IsAutoInflateEnabled != nil { - in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled - *out = new(bool) - **out = **in - } - if in.KafkaEnabled != nil { - in, out := &in.KafkaEnabled, &out.KafkaEnabled - *out = new(bool) - **out = **in - } - if in.MaximumThroughputUnits != nil { - in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits - *out = new(int) - **out = **in - } - if in.MinimumTlsVersion != nil { - in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion - *out = new(Namespace_Properties_MinimumTlsVersion_Spec) - **out = **in - } - if in.PublicNetworkAccess != nil { - in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess - *out = new(Namespace_Properties_PublicNetworkAccess_Spec) - **out = **in - } - if in.ZoneRedundant != nil { - in, out := &in.ZoneRedundant, &out.ZoneRedundant - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Properties_Spec_ARM. -func (in *Namespace_Properties_Spec_ARM) DeepCopy() *Namespace_Properties_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespace_Properties_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespace_STATUS) DeepCopyInto(out *Namespace_STATUS) { - *out = *in - if in.AlternateName != nil { - in, out := &in.AlternateName, &out.AlternateName - *out = new(string) - **out = **in - } - if in.ClusterArmId != nil { - in, out := &in.ClusterArmId, &out.ClusterArmId - *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.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.DisableLocalAuth != nil { - in, out := &in.DisableLocalAuth, &out.DisableLocalAuth - *out = new(bool) - **out = **in - } - if in.Encryption != nil { - in, out := &in.Encryption, &out.Encryption - *out = new(Encryption_STATUS) - (*in).DeepCopyInto(*out) - } - 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.IsAutoInflateEnabled != nil { - in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled - *out = new(bool) - **out = **in - } - if in.KafkaEnabled != nil { - in, out := &in.KafkaEnabled, &out.KafkaEnabled - *out = new(bool) - **out = **in - } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } - if in.MaximumThroughputUnits != nil { - in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits - *out = new(int) - **out = **in - } - if in.MetricId != nil { - in, out := &in.MetricId, &out.MetricId - *out = new(string) - **out = **in - } - if in.MinimumTlsVersion != nil { - in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion - *out = new(Namespace_Properties_MinimumTlsVersion_STATUS) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.PrivateEndpointConnections != nil { - in, out := &in.PrivateEndpointConnections, &out.PrivateEndpointConnections - *out = make([]PrivateEndpointConnection_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.PublicNetworkAccess != nil { - in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess - *out = new(Namespace_Properties_PublicNetworkAccess_STATUS) - **out = **in - } - if in.ServiceBusEndpoint != nil { - in, out := &in.ServiceBusEndpoint, &out.ServiceBusEndpoint - *out = new(string) - **out = **in - } - if in.Sku != nil { - in, out := &in.Sku, &out.Sku - *out = new(Sku_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **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.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } - if in.ZoneRedundant != nil { - in, out := &in.ZoneRedundant, &out.ZoneRedundant - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_STATUS. -func (in *Namespace_STATUS) DeepCopy() *Namespace_STATUS { - if in == nil { - return nil - } - out := new(Namespace_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 *Namespace_STATUS_ARM) DeepCopyInto(out *Namespace_STATUS_ARM) { - *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_ARM) - (*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(Namespace_Properties_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.Sku != nil { - in, out := &in.Sku, &out.Sku - *out = new(Sku_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS_ARM) - (*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 Namespace_STATUS_ARM. -func (in *Namespace_STATUS_ARM) DeepCopy() *Namespace_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespace_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespace_Spec) DeepCopyInto(out *Namespace_Spec) { - *out = *in - if in.AlternateName != nil { - in, out := &in.AlternateName, &out.AlternateName - *out = new(string) - **out = **in - } - if in.ClusterArmReference != nil { - in, out := &in.ClusterArmReference, &out.ClusterArmReference - *out = new(genruntime.ResourceReference) - **out = **in - } - if in.DisableLocalAuth != nil { - in, out := &in.DisableLocalAuth, &out.DisableLocalAuth - *out = new(bool) - **out = **in - } - if in.Encryption != nil { - in, out := &in.Encryption, &out.Encryption - *out = new(Encryption) - (*in).DeepCopyInto(*out) - } - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(Identity) - (*in).DeepCopyInto(*out) - } - if in.IsAutoInflateEnabled != nil { - in, out := &in.IsAutoInflateEnabled, &out.IsAutoInflateEnabled - *out = new(bool) - **out = **in - } - if in.KafkaEnabled != nil { - in, out := &in.KafkaEnabled, &out.KafkaEnabled - *out = new(bool) - **out = **in - } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } - if in.MaximumThroughputUnits != nil { - in, out := &in.MaximumThroughputUnits, &out.MaximumThroughputUnits - *out = new(int) - **out = **in - } - if in.MinimumTlsVersion != nil { - in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion - *out = new(Namespace_Properties_MinimumTlsVersion_Spec) - **out = **in - } - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(NamespaceOperatorSpec) - (*in).DeepCopyInto(*out) - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.PublicNetworkAccess != nil { - in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess - *out = new(Namespace_Properties_PublicNetworkAccess_Spec) - **out = **in - } - if in.Sku != nil { - in, out := &in.Sku, &out.Sku - *out = new(Sku) - (*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.ZoneRedundant != nil { - in, out := &in.ZoneRedundant, &out.ZoneRedundant - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespace_Spec. -func (in *Namespace_Spec) DeepCopy() *Namespace_Spec { - if in == nil { - return nil - } - out := new(Namespace_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 *Namespace_Spec_ARM) DeepCopyInto(out *Namespace_Spec_ARM) { - *out = *in - if in.Identity != nil { - in, out := &in.Identity, &out.Identity - *out = new(Identity_ARM) - (*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(Namespace_Properties_Spec_ARM) - (*in).DeepCopyInto(*out) - } - if in.Sku != nil { - in, out := &in.Sku, &out.Sku - *out = new(Sku_ARM) - (*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 Namespace_Spec_ARM. -func (in *Namespace_Spec_ARM) DeepCopy() *Namespace_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespace_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesAuthorizationRule) DeepCopyInto(out *NamespacesAuthorizationRule) { - *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 NamespacesAuthorizationRule. -func (in *NamespacesAuthorizationRule) DeepCopy() *NamespacesAuthorizationRule { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesAuthorizationRule) 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 *NamespacesAuthorizationRuleList) DeepCopyInto(out *NamespacesAuthorizationRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesAuthorizationRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleList. -func (in *NamespacesAuthorizationRuleList) DeepCopy() *NamespacesAuthorizationRuleList { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesAuthorizationRuleList) 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 *NamespacesAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSecrets) { - *out = *in - if in.PrimaryConnectionString != nil { - in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryConnectionString != nil { - in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSecrets. -func (in *NamespacesAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesAuthorizationRuleOperatorSecrets { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRuleOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesAuthorizationRuleOperatorSpec) { - *out = *in - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = new(NamespacesAuthorizationRuleOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesAuthorizationRuleOperatorSpec. -func (in *NamespacesAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesAuthorizationRuleOperatorSpec { - if in == nil { - return nil - } - out := new(NamespacesAuthorizationRuleOperatorSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesEventhub) DeepCopyInto(out *NamespacesEventhub) { - *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 NamespacesEventhub. -func (in *NamespacesEventhub) DeepCopy() *NamespacesEventhub { - if in == nil { - return nil - } - out := new(NamespacesEventhub) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhub) 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 *NamespacesEventhubList) DeepCopyInto(out *NamespacesEventhubList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesEventhub, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubList. -func (in *NamespacesEventhubList) DeepCopy() *NamespacesEventhubList { - if in == nil { - return nil - } - out := new(NamespacesEventhubList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubList) 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 *NamespacesEventhubsAuthorizationRule) DeepCopyInto(out *NamespacesEventhubsAuthorizationRule) { - *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 NamespacesEventhubsAuthorizationRule. -func (in *NamespacesEventhubsAuthorizationRule) DeepCopy() *NamespacesEventhubsAuthorizationRule { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsAuthorizationRule) 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 *NamespacesEventhubsAuthorizationRuleList) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesEventhubsAuthorizationRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleList. -func (in *NamespacesEventhubsAuthorizationRuleList) DeepCopy() *NamespacesEventhubsAuthorizationRuleList { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRuleList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsAuthorizationRuleList) 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 *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSecrets) { - *out = *in - if in.PrimaryConnectionString != nil { - in, out := &in.PrimaryConnectionString, &out.PrimaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.PrimaryKey != nil { - in, out := &in.PrimaryKey, &out.PrimaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryConnectionString != nil { - in, out := &in.SecondaryConnectionString, &out.SecondaryConnectionString - *out = new(genruntime.SecretDestination) - **out = **in - } - if in.SecondaryKey != nil { - in, out := &in.SecondaryKey, &out.SecondaryKey - *out = new(genruntime.SecretDestination) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSecrets. -func (in *NamespacesEventhubsAuthorizationRuleOperatorSecrets) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSecrets { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopyInto(out *NamespacesEventhubsAuthorizationRuleOperatorSpec) { - *out = *in - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = new(NamespacesEventhubsAuthorizationRuleOperatorSecrets) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsAuthorizationRuleOperatorSpec. -func (in *NamespacesEventhubsAuthorizationRuleOperatorSpec) DeepCopy() *NamespacesEventhubsAuthorizationRuleOperatorSpec { - if in == nil { - return nil - } - out := new(NamespacesEventhubsAuthorizationRuleOperatorSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacesEventhubsConsumerGroup) DeepCopyInto(out *NamespacesEventhubsConsumerGroup) { - *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 NamespacesEventhubsConsumerGroup. -func (in *NamespacesEventhubsConsumerGroup) DeepCopy() *NamespacesEventhubsConsumerGroup { - if in == nil { - return nil - } - out := new(NamespacesEventhubsConsumerGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsConsumerGroup) 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 *NamespacesEventhubsConsumerGroupList) DeepCopyInto(out *NamespacesEventhubsConsumerGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NamespacesEventhubsConsumerGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesEventhubsConsumerGroupList. -func (in *NamespacesEventhubsConsumerGroupList) DeepCopy() *NamespacesEventhubsConsumerGroupList { - if in == nil { - return nil - } - out := new(NamespacesEventhubsConsumerGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NamespacesEventhubsConsumerGroupList) 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 *Namespaces_AuthorizationRule_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_Properties_STATUS_ARM) { - *out = *in - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_AuthorizationRule_Properties_Rights_STATUS, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Properties_STATUS_ARM. -func (in *Namespaces_AuthorizationRule_Properties_STATUS_ARM) DeepCopy() *Namespaces_AuthorizationRule_Properties_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_Properties_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_AuthorizationRule_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_Properties_Spec_ARM) { - *out = *in - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Properties_Spec_ARM. -func (in *Namespaces_AuthorizationRule_Properties_Spec_ARM) DeepCopy() *Namespaces_AuthorizationRule_Properties_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_Properties_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_AuthorizationRule_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.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.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_AuthorizationRule_Properties_Rights_STATUS, len(*in)) - copy(*out, *in) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*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 Namespaces_AuthorizationRule_STATUS. -func (in *Namespaces_AuthorizationRule_STATUS) DeepCopy() *Namespaces_AuthorizationRule_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_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 *Namespaces_AuthorizationRule_STATUS_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_STATUS_ARM) { - *out = *in - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - 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(Namespaces_AuthorizationRule_Properties_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS_ARM) - (*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 Namespaces_AuthorizationRule_STATUS_ARM. -func (in *Namespaces_AuthorizationRule_STATUS_ARM) DeepCopy() *Namespaces_AuthorizationRule_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec) { - *out = *in - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(NamespacesAuthorizationRuleOperatorSpec) - (*in).DeepCopyInto(*out) - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_AuthorizationRule_Properties_Rights_Spec, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Spec. -func (in *Namespaces_AuthorizationRule_Spec) DeepCopy() *Namespaces_AuthorizationRule_Spec { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_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 *Namespaces_AuthorizationRule_Spec_ARM) DeepCopyInto(out *Namespaces_AuthorizationRule_Spec_ARM) { - *out = *in - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = new(Namespaces_AuthorizationRule_Properties_Spec_ARM) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_AuthorizationRule_Spec_ARM. -func (in *Namespaces_AuthorizationRule_Spec_ARM) DeepCopy() *Namespaces_AuthorizationRule_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_AuthorizationRule_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhub_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhub_Properties_STATUS_ARM) { - *out = *in - if in.CaptureDescription != nil { - in, out := &in.CaptureDescription, &out.CaptureDescription - *out = new(CaptureDescription_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.MessageRetentionInDays != nil { - in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays - *out = new(int) - **out = **in - } - if in.PartitionCount != nil { - in, out := &in.PartitionCount, &out.PartitionCount - *out = new(int) - **out = **in - } - if in.PartitionIds != nil { - in, out := &in.PartitionIds, &out.PartitionIds - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.RetentionDescription != nil { - in, out := &in.RetentionDescription, &out.RetentionDescription - *out = new(RetentionDescription_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(Namespaces_Eventhub_Properties_Status_STATUS) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Properties_STATUS_ARM. -func (in *Namespaces_Eventhub_Properties_STATUS_ARM) DeepCopy() *Namespaces_Eventhub_Properties_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_Properties_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhub_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhub_Properties_Spec_ARM) { - *out = *in - if in.CaptureDescription != nil { - in, out := &in.CaptureDescription, &out.CaptureDescription - *out = new(CaptureDescription_ARM) - (*in).DeepCopyInto(*out) - } - if in.MessageRetentionInDays != nil { - in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays - *out = new(int) - **out = **in - } - if in.PartitionCount != nil { - in, out := &in.PartitionCount, &out.PartitionCount - *out = new(int) - **out = **in - } - if in.RetentionDescription != nil { - in, out := &in.RetentionDescription, &out.RetentionDescription - *out = new(RetentionDescription_ARM) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Properties_Spec_ARM. -func (in *Namespaces_Eventhub_Properties_Spec_ARM) DeepCopy() *Namespaces_Eventhub_Properties_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_Properties_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhub_STATUS) DeepCopyInto(out *Namespaces_Eventhub_STATUS) { - *out = *in - if in.CaptureDescription != nil { - in, out := &in.CaptureDescription, &out.CaptureDescription - *out = new(CaptureDescription_STATUS) - (*in).DeepCopyInto(*out) - } - 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.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } - if in.MessageRetentionInDays != nil { - in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.PartitionCount != nil { - in, out := &in.PartitionCount, &out.PartitionCount - *out = new(int) - **out = **in - } - if in.PartitionIds != nil { - in, out := &in.PartitionIds, &out.PartitionIds - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.RetentionDescription != nil { - in, out := &in.RetentionDescription, &out.RetentionDescription - *out = new(RetentionDescription_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(Namespaces_Eventhub_Properties_Status_STATUS) - **out = **in - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_STATUS. -func (in *Namespaces_Eventhub_STATUS) DeepCopy() *Namespaces_Eventhub_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_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 *Namespaces_Eventhub_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhub_STATUS_ARM) { - *out = *in - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - 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(Namespaces_Eventhub_Properties_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS_ARM) - (*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 Namespaces_Eventhub_STATUS_ARM. -func (in *Namespaces_Eventhub_STATUS_ARM) DeepCopy() *Namespaces_Eventhub_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhub_Spec) DeepCopyInto(out *Namespaces_Eventhub_Spec) { - *out = *in - if in.CaptureDescription != nil { - in, out := &in.CaptureDescription, &out.CaptureDescription - *out = new(CaptureDescription) - (*in).DeepCopyInto(*out) - } - if in.MessageRetentionInDays != nil { - in, out := &in.MessageRetentionInDays, &out.MessageRetentionInDays - *out = new(int) - **out = **in - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.PartitionCount != nil { - in, out := &in.PartitionCount, &out.PartitionCount - *out = new(int) - **out = **in - } - if in.RetentionDescription != nil { - in, out := &in.RetentionDescription, &out.RetentionDescription - *out = new(RetentionDescription) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Spec. -func (in *Namespaces_Eventhub_Spec) DeepCopy() *Namespaces_Eventhub_Spec { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_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 *Namespaces_Eventhub_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhub_Spec_ARM) { - *out = *in - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = new(Namespaces_Eventhub_Properties_Spec_ARM) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhub_Spec_ARM. -func (in *Namespaces_Eventhub_Spec_ARM) DeepCopy() *Namespaces_Eventhub_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhub_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) { - *out = *in - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM. -func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) { - *out = *in - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM. -func (in *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_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.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.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS, len(*in)) - copy(*out, *in) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*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 Namespaces_Eventhubs_AuthorizationRule_STATUS. -func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) { - *out = *in - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - 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(Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS_ARM) - (*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 Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM. -func (in *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec) { - *out = *in - if in.OperatorSpec != nil { - in, out := &in.OperatorSpec, &out.OperatorSpec - *out = new(NamespacesEventhubsAuthorizationRuleOperatorSpec) - (*in).DeepCopyInto(*out) - } - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.Rights != nil { - in, out := &in.Rights, &out.Rights - *out = make([]Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Spec. -func (in *Namespaces_Eventhubs_AuthorizationRule_Spec) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Spec { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_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 *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) { - *out = *in - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = new(Namespaces_Eventhubs_AuthorizationRule_Properties_Spec_ARM) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_AuthorizationRule_Spec_ARM. -func (in *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_AuthorizationRule_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_AuthorizationRule_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) { - *out = *in - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } - if in.UserMetadata != nil { - in, out := &in.UserMetadata, &out.UserMetadata - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM. -func (in *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) { - *out = *in - if in.UserMetadata != nil { - in, out := &in.UserMetadata, &out.UserMetadata - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM. -func (in *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_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.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - 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.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS) - (*in).DeepCopyInto(*out) - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - if in.UpdatedAt != nil { - in, out := &in.UpdatedAt, &out.UpdatedAt - *out = new(string) - **out = **in - } - if in.UserMetadata != nil { - in, out := &in.UserMetadata, &out.UserMetadata - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_STATUS. -func (in *Namespaces_Eventhubs_Consumergroup_STATUS) DeepCopy() *Namespaces_Eventhubs_Consumergroup_STATUS { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_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 *Namespaces_Eventhubs_Consumergroup_STATUS_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_STATUS_ARM) { - *out = *in - if in.Id != nil { - in, out := &in.Id, &out.Id - *out = new(string) - **out = **in - } - 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(Namespaces_Eventhubs_Consumergroup_Properties_STATUS_ARM) - (*in).DeepCopyInto(*out) - } - if in.SystemData != nil { - in, out := &in.SystemData, &out.SystemData - *out = new(SystemData_STATUS_ARM) - (*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 Namespaces_Eventhubs_Consumergroup_STATUS_ARM. -func (in *Namespaces_Eventhubs_Consumergroup_STATUS_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_STATUS_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Spec) { - *out = *in - if in.Owner != nil { - in, out := &in.Owner, &out.Owner - *out = new(genruntime.KnownResourceReference) - **out = **in - } - if in.UserMetadata != nil { - in, out := &in.UserMetadata, &out.UserMetadata - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Spec. -func (in *Namespaces_Eventhubs_Consumergroup_Spec) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Spec { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_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 *Namespaces_Eventhubs_Consumergroup_Spec_ARM) DeepCopyInto(out *Namespaces_Eventhubs_Consumergroup_Spec_ARM) { - *out = *in - if in.Properties != nil { - in, out := &in.Properties, &out.Properties - *out = new(Namespaces_Eventhubs_Consumergroup_Properties_Spec_ARM) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Eventhubs_Consumergroup_Spec_ARM. -func (in *Namespaces_Eventhubs_Consumergroup_Spec_ARM) DeepCopy() *Namespaces_Eventhubs_Consumergroup_Spec_ARM { - if in == nil { - return nil - } - out := new(Namespaces_Eventhubs_Consumergroup_Spec_ARM) - 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) DeepCopyInto(out *PrivateEndpointConnection_STATUS) { - *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 PrivateEndpointConnection_STATUS. -func (in *PrivateEndpointConnection_STATUS) DeepCopy() *PrivateEndpointConnection_STATUS { - if in == nil { - return nil - } - out := new(PrivateEndpointConnection_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 *PrivateEndpointConnection_STATUS_ARM) DeepCopyInto(out *PrivateEndpointConnection_STATUS_ARM) { - *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 PrivateEndpointConnection_STATUS_ARM. -func (in *PrivateEndpointConnection_STATUS_ARM) DeepCopy() *PrivateEndpointConnection_STATUS_ARM { - if in == nil { - return nil - } - out := new(PrivateEndpointConnection_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetentionDescription) DeepCopyInto(out *RetentionDescription) { - *out = *in - if in.CleanupPolicy != nil { - in, out := &in.CleanupPolicy, &out.CleanupPolicy - *out = new(RetentionDescription_CleanupPolicy) - **out = **in - } - if in.RetentionTimeInHours != nil { - in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours - *out = new(int) - **out = **in - } - if in.TombstoneRetentionTimeInHours != nil { - in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours - *out = new(int) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription. -func (in *RetentionDescription) DeepCopy() *RetentionDescription { - if in == nil { - return nil - } - out := new(RetentionDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetentionDescription_ARM) DeepCopyInto(out *RetentionDescription_ARM) { - *out = *in - if in.CleanupPolicy != nil { - in, out := &in.CleanupPolicy, &out.CleanupPolicy - *out = new(RetentionDescription_CleanupPolicy) - **out = **in - } - if in.RetentionTimeInHours != nil { - in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours - *out = new(int) - **out = **in - } - if in.TombstoneRetentionTimeInHours != nil { - in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours - *out = new(int) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_ARM. -func (in *RetentionDescription_ARM) DeepCopy() *RetentionDescription_ARM { - if in == nil { - return nil - } - out := new(RetentionDescription_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetentionDescription_STATUS) DeepCopyInto(out *RetentionDescription_STATUS) { - *out = *in - if in.CleanupPolicy != nil { - in, out := &in.CleanupPolicy, &out.CleanupPolicy - *out = new(RetentionDescription_CleanupPolicy_STATUS) - **out = **in - } - if in.RetentionTimeInHours != nil { - in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours - *out = new(int) - **out = **in - } - if in.TombstoneRetentionTimeInHours != nil { - in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours - *out = new(int) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_STATUS. -func (in *RetentionDescription_STATUS) DeepCopy() *RetentionDescription_STATUS { - if in == nil { - return nil - } - out := new(RetentionDescription_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 *RetentionDescription_STATUS_ARM) DeepCopyInto(out *RetentionDescription_STATUS_ARM) { - *out = *in - if in.CleanupPolicy != nil { - in, out := &in.CleanupPolicy, &out.CleanupPolicy - *out = new(RetentionDescription_CleanupPolicy_STATUS) - **out = **in - } - if in.RetentionTimeInHours != nil { - in, out := &in.RetentionTimeInHours, &out.RetentionTimeInHours - *out = new(int) - **out = **in - } - if in.TombstoneRetentionTimeInHours != nil { - in, out := &in.TombstoneRetentionTimeInHours, &out.TombstoneRetentionTimeInHours - *out = new(int) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetentionDescription_STATUS_ARM. -func (in *RetentionDescription_STATUS_ARM) DeepCopy() *RetentionDescription_STATUS_ARM { - if in == nil { - return nil - } - out := new(RetentionDescription_STATUS_ARM) - 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.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(Sku_Name) - **out = **in - } - if in.Tier != nil { - in, out := &in.Tier, &out.Tier - *out = new(Sku_Tier) - **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_ARM) DeepCopyInto(out *Sku_ARM) { - *out = *in - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(Sku_Name) - **out = **in - } - if in.Tier != nil { - in, out := &in.Tier, &out.Tier - *out = new(Sku_Tier) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku_ARM. -func (in *Sku_ARM) DeepCopy() *Sku_ARM { - if in == nil { - return nil - } - out := new(Sku_ARM) - 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.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(Sku_Name_STATUS) - **out = **in - } - if in.Tier != nil { - in, out := &in.Tier, &out.Tier - *out = new(Sku_Tier_STATUS) - **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_STATUS_ARM) DeepCopyInto(out *Sku_STATUS_ARM) { - *out = *in - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = new(int) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(Sku_Name_STATUS) - **out = **in - } - if in.Tier != nil { - in, out := &in.Tier, &out.Tier - *out = new(Sku_Tier_STATUS) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sku_STATUS_ARM. -func (in *Sku_STATUS_ARM) DeepCopy() *Sku_STATUS_ARM { - if in == nil { - return nil - } - out := new(Sku_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { - *out = *in - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.CreatedBy != nil { - in, out := &in.CreatedBy, &out.CreatedBy - *out = new(string) - **out = **in - } - if in.CreatedByType != nil { - in, out := &in.CreatedByType, &out.CreatedByType - *out = new(SystemData_CreatedByType_STATUS) - **out = **in - } - if in.LastModifiedAt != nil { - in, out := &in.LastModifiedAt, &out.LastModifiedAt - *out = new(string) - **out = **in - } - if in.LastModifiedBy != nil { - in, out := &in.LastModifiedBy, &out.LastModifiedBy - *out = new(string) - **out = **in - } - if in.LastModifiedByType != nil { - in, out := &in.LastModifiedByType, &out.LastModifiedByType - *out = new(SystemData_LastModifiedByType_STATUS) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS. -func (in *SystemData_STATUS) DeepCopy() *SystemData_STATUS { - if in == nil { - return nil - } - out := new(SystemData_STATUS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemData_STATUS_ARM) DeepCopyInto(out *SystemData_STATUS_ARM) { - *out = *in - if in.CreatedAt != nil { - in, out := &in.CreatedAt, &out.CreatedAt - *out = new(string) - **out = **in - } - if in.CreatedBy != nil { - in, out := &in.CreatedBy, &out.CreatedBy - *out = new(string) - **out = **in - } - if in.CreatedByType != nil { - in, out := &in.CreatedByType, &out.CreatedByType - *out = new(SystemData_CreatedByType_STATUS) - **out = **in - } - if in.LastModifiedAt != nil { - in, out := &in.LastModifiedAt, &out.LastModifiedAt - *out = new(string) - **out = **in - } - if in.LastModifiedBy != nil { - in, out := &in.LastModifiedBy, &out.LastModifiedBy - *out = new(string) - **out = **in - } - if in.LastModifiedByType != nil { - in, out := &in.LastModifiedByType, &out.LastModifiedByType - *out = new(SystemData_LastModifiedByType_STATUS) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS_ARM. -func (in *SystemData_STATUS_ARM) DeepCopy() *SystemData_STATUS_ARM { - if in == nil { - return nil - } - out := new(SystemData_STATUS_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityDetails) DeepCopyInto(out *UserAssignedIdentityDetails) { - *out = *in - out.Reference = in.Reference -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails. -func (in *UserAssignedIdentityDetails) DeepCopy() *UserAssignedIdentityDetails { - if in == nil { - return nil - } - out := new(UserAssignedIdentityDetails) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityDetails_ARM) DeepCopyInto(out *UserAssignedIdentityDetails_ARM) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails_ARM. -func (in *UserAssignedIdentityDetails_ARM) DeepCopy() *UserAssignedIdentityDetails_ARM { - if in == nil { - return nil - } - out := new(UserAssignedIdentityDetails_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityProperties) DeepCopyInto(out *UserAssignedIdentityProperties) { - *out = *in - if in.UserAssignedIdentityReference != nil { - in, out := &in.UserAssignedIdentityReference, &out.UserAssignedIdentityReference - *out = new(genruntime.ResourceReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityProperties. -func (in *UserAssignedIdentityProperties) DeepCopy() *UserAssignedIdentityProperties { - if in == nil { - return nil - } - out := new(UserAssignedIdentityProperties) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityProperties_ARM) DeepCopyInto(out *UserAssignedIdentityProperties_ARM) { - *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 UserAssignedIdentityProperties_ARM. -func (in *UserAssignedIdentityProperties_ARM) DeepCopy() *UserAssignedIdentityProperties_ARM { - if in == nil { - return nil - } - out := new(UserAssignedIdentityProperties_ARM) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserAssignedIdentityProperties_STATUS) DeepCopyInto(out *UserAssignedIdentityProperties_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 UserAssignedIdentityProperties_STATUS. -func (in *UserAssignedIdentityProperties_STATUS) DeepCopy() *UserAssignedIdentityProperties_STATUS { - if in == nil { - return nil - } - out := new(UserAssignedIdentityProperties_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 *UserAssignedIdentityProperties_STATUS_ARM) DeepCopyInto(out *UserAssignedIdentityProperties_STATUS_ARM) { - *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 UserAssignedIdentityProperties_STATUS_ARM. -func (in *UserAssignedIdentityProperties_STATUS_ARM) DeepCopy() *UserAssignedIdentityProperties_STATUS_ARM { - if in == nil { - return nil - } - out := new(UserAssignedIdentityProperties_STATUS_ARM) - 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 - } -} - -// 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_STATUS_ARM) DeepCopyInto(out *UserAssignedIdentity_STATUS_ARM) { - *out = *in - if in.ClientId != nil { - in, out := &in.ClientId, &out.ClientId - *out = new(string) - **out = **in - } - if in.PrincipalId != nil { - in, out := &in.PrincipalId, &out.PrincipalId - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentity_STATUS_ARM. -func (in *UserAssignedIdentity_STATUS_ARM) DeepCopy() *UserAssignedIdentity_STATUS_ARM { - if in == nil { - return nil - } - out := new(UserAssignedIdentity_STATUS_ARM) - in.DeepCopyInto(out) - return out -} diff --git a/v2/api/eventhub/versions_matrix.md b/v2/api/eventhub/versions_matrix.md index 8ad1607ca10..f5b3d5c9008 100644 --- a/v2/api/eventhub/versions_matrix.md +++ b/v2/api/eventhub/versions_matrix.md @@ -1,77 +1,65 @@ -| Type Definitions in package "eventhub" | v1api20211101 | v1api20240101 | -|-----------------------------------------------------------------|---------------|---------------| -| APIVersion | v1api20211101 | v1api20240101 | -| CaptureDescription | v1api20211101 | v1api20240101 | -| CaptureDescription_Encoding | v1api20211101 | v1api20240101 | -| CaptureDescription_Encoding_STATUS | v1api20211101 | v1api20240101 | -| CaptureDescription_STATUS | v1api20211101 | v1api20240101 | -| CaptureIdentity | | v1api20240101 | -| CaptureIdentity_STATUS | | v1api20240101 | -| CaptureIdentity_Type | | v1api20240101 | -| CaptureIdentity_Type_STATUS | | v1api20240101 | -| Destination | v1api20211101 | v1api20240101 | -| Destination_Properties | v1api20211101 | v1api20240101 | -| Destination_Properties_STATUS | v1api20211101 | v1api20240101 | -| Destination_STATUS | v1api20211101 | v1api20240101 | -| Encryption | v1api20211101 | v1api20240101 | -| Encryption_KeySource | v1api20211101 | v1api20240101 | -| Encryption_KeySource_STATUS | v1api20211101 | v1api20240101 | -| Encryption_STATUS | v1api20211101 | v1api20240101 | -| Identity | v1api20211101 | v1api20240101 | -| Identity_STATUS | v1api20211101 | v1api20240101 | -| Identity_Type | v1api20211101 | v1api20240101 | -| Identity_Type_STATUS | v1api20211101 | v1api20240101 | -| KeyVaultProperties | v1api20211101 | v1api20240101 | -| KeyVaultProperties_STATUS | v1api20211101 | v1api20240101 | -| Namespace | v1api20211101 | v1api20240101 | -| Namespace_Properties_MinimumTlsVersion_STATUS | | v1api20240101 | -| Namespace_Properties_MinimumTlsVersion_Spec | | v1api20240101 | -| Namespace_Properties_PublicNetworkAccess_STATUS | | v1api20240101 | -| Namespace_Properties_PublicNetworkAccess_Spec | | v1api20240101 | -| Namespace_Properties_STATUS | v1api20211101 | v1api20240101 | -| Namespace_Properties_Spec | v1api20211101 | v1api20240101 | -| Namespace_STATUS | v1api20211101 | v1api20240101 | -| Namespace_Spec | v1api20211101 | v1api20240101 | -| NamespacesAuthorizationRule | v1api20211101 | v1api20240101 | -| NamespacesEventhub | v1api20211101 | v1api20240101 | -| NamespacesEventhubsAuthorizationRule | v1api20211101 | v1api20240101 | -| NamespacesEventhubsConsumerGroup | v1api20211101 | v1api20240101 | -| Namespaces_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | v1api20240101 | -| Namespaces_AuthorizationRule_Properties_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_AuthorizationRule_Properties_Spec | v1api20211101 | v1api20240101 | -| Namespaces_AuthorizationRule_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_AuthorizationRule_Spec | v1api20211101 | v1api20240101 | -| Namespaces_Eventhub_Properties_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhub_Properties_Spec | v1api20211101 | v1api20240101 | -| Namespaces_Eventhub_Properties_Status_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhub_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhub_Spec | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_AuthorizationRule_Properties_Spec | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_AuthorizationRule_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_AuthorizationRule_Spec | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_Consumergroup_Properties_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_Consumergroup_Properties_Spec | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_Consumergroup_STATUS | v1api20211101 | v1api20240101 | -| Namespaces_Eventhubs_Consumergroup_Spec | v1api20211101 | v1api20240101 | -| PrivateEndpointConnection_STATUS | v1api20211101 | v1api20240101 | -| RetentionDescription | | v1api20240101 | -| RetentionDescription_CleanupPolicy | | v1api20240101 | -| RetentionDescription_CleanupPolicy_STATUS | | v1api20240101 | -| RetentionDescription_STATUS | | v1api20240101 | -| Sku | v1api20211101 | v1api20240101 | -| Sku_Name | v1api20211101 | v1api20240101 | -| Sku_Name_STATUS | v1api20211101 | v1api20240101 | -| Sku_STATUS | v1api20211101 | v1api20240101 | -| Sku_Tier | v1api20211101 | v1api20240101 | -| Sku_Tier_STATUS | v1api20211101 | v1api20240101 | -| SystemData_CreatedByType_STATUS | v1api20211101 | v1api20240101 | -| SystemData_LastModifiedByType_STATUS | v1api20211101 | v1api20240101 | -| SystemData_STATUS | v1api20211101 | v1api20240101 | -| UserAssignedIdentityDetails | v1api20211101 | v1api20240101 | -| UserAssignedIdentityProperties | v1api20211101 | v1api20240101 | -| UserAssignedIdentityProperties_STATUS | v1api20211101 | v1api20240101 | -| UserAssignedIdentity_STATUS | v1api20211101 | v1api20240101 | +| Type Definitions in package "eventhub" | v1api20211101 | +|-----------------------------------------------------------------|---------------| +| APIVersion | v1api20211101 | +| CaptureDescription | v1api20211101 | +| CaptureDescription_Encoding | v1api20211101 | +| CaptureDescription_Encoding_STATUS | v1api20211101 | +| CaptureDescription_STATUS | v1api20211101 | +| Destination | v1api20211101 | +| Destination_Properties | v1api20211101 | +| Destination_Properties_STATUS | v1api20211101 | +| Destination_STATUS | v1api20211101 | +| Encryption | v1api20211101 | +| Encryption_KeySource | v1api20211101 | +| Encryption_KeySource_STATUS | v1api20211101 | +| Encryption_STATUS | v1api20211101 | +| Identity | v1api20211101 | +| Identity_STATUS | v1api20211101 | +| Identity_Type | v1api20211101 | +| Identity_Type_STATUS | v1api20211101 | +| KeyVaultProperties | v1api20211101 | +| KeyVaultProperties_STATUS | v1api20211101 | +| Namespace | v1api20211101 | +| Namespace_Properties_STATUS | v1api20211101 | +| Namespace_Properties_Spec | v1api20211101 | +| Namespace_STATUS | v1api20211101 | +| Namespace_Spec | v1api20211101 | +| NamespacesAuthorizationRule | v1api20211101 | +| NamespacesEventhub | v1api20211101 | +| NamespacesEventhubsAuthorizationRule | v1api20211101 | +| NamespacesEventhubsConsumerGroup | v1api20211101 | +| Namespaces_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | +| Namespaces_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | +| Namespaces_AuthorizationRule_Properties_STATUS | v1api20211101 | +| Namespaces_AuthorizationRule_Properties_Spec | v1api20211101 | +| Namespaces_AuthorizationRule_STATUS | v1api20211101 | +| Namespaces_AuthorizationRule_Spec | v1api20211101 | +| Namespaces_Eventhub_Properties_STATUS | v1api20211101 | +| Namespaces_Eventhub_Properties_Spec | v1api20211101 | +| Namespaces_Eventhub_Properties_Status_STATUS | v1api20211101 | +| Namespaces_Eventhub_STATUS | v1api20211101 | +| Namespaces_Eventhub_Spec | v1api20211101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_STATUS | v1api20211101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec | v1api20211101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_STATUS | v1api20211101 | +| Namespaces_Eventhubs_AuthorizationRule_Properties_Spec | v1api20211101 | +| Namespaces_Eventhubs_AuthorizationRule_STATUS | v1api20211101 | +| Namespaces_Eventhubs_AuthorizationRule_Spec | v1api20211101 | +| Namespaces_Eventhubs_Consumergroup_Properties_STATUS | v1api20211101 | +| Namespaces_Eventhubs_Consumergroup_Properties_Spec | v1api20211101 | +| Namespaces_Eventhubs_Consumergroup_STATUS | v1api20211101 | +| Namespaces_Eventhubs_Consumergroup_Spec | v1api20211101 | +| PrivateEndpointConnection_STATUS | v1api20211101 | +| Sku | v1api20211101 | +| Sku_Name | v1api20211101 | +| Sku_Name_STATUS | v1api20211101 | +| Sku_STATUS | v1api20211101 | +| Sku_Tier | v1api20211101 | +| Sku_Tier_STATUS | v1api20211101 | +| SystemData_CreatedByType_STATUS | v1api20211101 | +| SystemData_LastModifiedByType_STATUS | v1api20211101 | +| SystemData_STATUS | v1api20211101 | +| UserAssignedIdentityDetails | v1api20211101 | +| UserAssignedIdentityProperties | v1api20211101 | +| UserAssignedIdentityProperties_STATUS | v1api20211101 | +| UserAssignedIdentity_STATUS | v1api20211101 | diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 389de313114..e4da7043e8a 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -2029,49 +2029,6 @@ objectModelConfiguration: UserAssignedIdentityProperties: UserAssignedIdentity: $armReference: true - 2024-01-01: - Destination_Properties: - StorageAccountResourceId: - $armReference: true - Namespace: - $export: true - $supportedFrom: v2.7.0 - $azureGeneratedSecrets: - - PrimaryKey - - SecondaryKey - - PrimaryConnectionString - - SecondaryConnectionString - Namespaces_AuthorizationRule: - $exportAs: NamespacesAuthorizationRule - $supportedFrom: v2.7.0 - $azureGeneratedSecrets: - - PrimaryKey - - SecondaryKey - - PrimaryConnectionString - - SecondaryConnectionString - Namespaces_Eventhub: - $exportAs: NamespacesEventhub - $supportedFrom: v2.7.0 - Namespaces_Eventhubs_AuthorizationRule: - $exportAs: NamespacesEventhubsAuthorizationRule - $supportedFrom: v2.7.0 - $azureGeneratedSecrets: - - PrimaryKey - - SecondaryKey - - PrimaryConnectionString - - SecondaryConnectionString - Namespaces_Eventhubs_Consumergroup: - $exportAs: NamespacesEventhubsConsumerGroup - $supportedFrom: v2.7.0 - Namespace_Properties_Spec: - ClusterArmId: - $armReference: true - UserAssignedIdentityProperties: - UserAssignedIdentity: - $armReference: true - CaptureIdentity: - UserAssignedIdentity: - $armReference: true insights: 2018-05-01-preview: Webtest: diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index a80c1bf7f6f..fbd816c5454 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -99,8 +99,6 @@ import ( eventhub_customizations "github.com/Azure/azure-service-operator/v2/api/eventhub/customizations" eventhub_v20211101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101" eventhub_v20211101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" - eventhub_v20240101 "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" - eventhub_v20240101s "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/storage" insights_customizations "github.com/Azure/azure-service-operator/v2/api/insights/customizations" insights_v20180301 "github.com/Azure/azure-service-operator/v2/api/insights/v1api20180301" insights_v20180301s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20180301/storage" @@ -676,11 +674,11 @@ func getKnownStorageTypes() []*registration.StorageType { }, }) result = append(result, ®istration.StorageType{Obj: new(eventgrid_v20200601s.Topic)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.Namespace)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesAuthorizationRule)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesEventhub)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesEventhubsAuthorizationRule)}) - result = append(result, ®istration.StorageType{Obj: new(eventhub_v20240101s.NamespacesEventhubsConsumerGroup)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.Namespace)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesAuthorizationRule)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesEventhub)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesEventhubsAuthorizationRule)}) + result = append(result, ®istration.StorageType{Obj: new(eventhub_v20211101s.NamespacesEventhubsConsumerGroup)}) result = append(result, ®istration.StorageType{Obj: new(insights_v20180301s.MetricAlert)}) result = append(result, ®istration.StorageType{Obj: new(insights_v20180501ps.Webtest)}) result = append(result, ®istration.StorageType{Obj: new(insights_v20200202s.Component)}) @@ -1429,20 +1427,6 @@ func getKnownTypes() []client.Object { new(eventhub_v20211101s.NamespacesEventhub), new(eventhub_v20211101s.NamespacesEventhubsAuthorizationRule), new(eventhub_v20211101s.NamespacesEventhubsConsumerGroup)) - result = append( - result, - new(eventhub_v20240101.Namespace), - new(eventhub_v20240101.NamespacesAuthorizationRule), - new(eventhub_v20240101.NamespacesEventhub), - new(eventhub_v20240101.NamespacesEventhubsAuthorizationRule), - new(eventhub_v20240101.NamespacesEventhubsConsumerGroup)) - result = append( - result, - new(eventhub_v20240101s.Namespace), - new(eventhub_v20240101s.NamespacesAuthorizationRule), - new(eventhub_v20240101s.NamespacesEventhub), - new(eventhub_v20240101s.NamespacesEventhubsAuthorizationRule), - new(eventhub_v20240101s.NamespacesEventhubsConsumerGroup)) result = append(result, new(insights_v20180301.MetricAlert)) result = append(result, new(insights_v20180301s.MetricAlert)) result = append(result, new(insights_v20180501p.Webtest)) @@ -1850,8 +1834,6 @@ func createScheme() *runtime.Scheme { _ = eventgrid_v20200601s.AddToScheme(scheme) _ = eventhub_v20211101.AddToScheme(scheme) _ = eventhub_v20211101s.AddToScheme(scheme) - _ = eventhub_v20240101.AddToScheme(scheme) - _ = eventhub_v20240101s.AddToScheme(scheme) _ = insights_v20180301.AddToScheme(scheme) _ = insights_v20180301s.AddToScheme(scheme) _ = insights_v20180501p.AddToScheme(scheme) diff --git a/v2/internal/controllers/crd_eventhub_namespace_20240101_test.go b/v2/internal/controllers/crd_eventhub_namespace_20240101_test.go deleted file mode 100644 index e7fe0889061..00000000000 --- a/v2/internal/controllers/crd_eventhub_namespace_20240101_test.go +++ /dev/null @@ -1,257 +0,0 @@ -/* -Copyright (c) Microsoft Corporation. -Licensed under the MIT license. -*/ - -package controllers_test - -import ( - "testing" - - . "github.com/onsi/gomega" - "sigs.k8s.io/controller-runtime/pkg/client" - - eventhub "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101" - "github.com/Azure/azure-service-operator/v2/internal/testcommon" - "github.com/Azure/azure-service-operator/v2/internal/util/to" - "github.com/Azure/azure-service-operator/v2/pkg/genruntime" -) - -func Test_EventHub_Namespace_20240101_CRUD(t *testing.T) { - t.Parallel() - - tc := globalTestContext.ForTest(t) - - rg := tc.CreateTestResourceGroupAndWait() - - skuTier := eventhub.Sku_Tier_Standard - skuName := eventhub.Sku_Name_Standard - namespace := &eventhub.Namespace{ - ObjectMeta: tc.MakeObjectMeta("namespace"), - Spec: eventhub.Namespace_Spec{ - // Fails with NoRegisteredProviderFound error in westus2 - Location: tc.AzureRegion, - Owner: testcommon.AsOwner(rg), - Sku: &eventhub.Sku{ - Name: &skuName, - Tier: &skuTier, - }, - IsAutoInflateEnabled: to.Ptr(true), - MaximumThroughputUnits: to.Ptr(1), - }, - } - - tc.CreateResourceAndWait(namespace) - - tc.Expect(namespace.Status.Id).ToNot(BeNil()) - tc.Expect(namespace.Status.MaximumThroughputUnits).To(Equal(to.Ptr(1))) - armId := *namespace.Status.Id - - // Perform a simple patch - old := namespace.DeepCopy() - namespace.Spec.MaximumThroughputUnits = to.Ptr(2) - tc.PatchResourceAndWait(old, namespace) - tc.Expect(namespace.Status.MaximumThroughputUnits).To(Equal(to.Ptr(2))) - - // Run secret sub tests - tc.RunSubtests( - testcommon.Subtest{ - Name: "Namespace_SecretsWrittenToSameKubeSecret", - Test: func(tc *testcommon.KubePerTestContext) { - Namespace_20240101_SecretsWrittenToSameKubeSecret(tc, namespace) - }, - }, - ) - - // Run sub tests - tc.RunParallelSubtests( - testcommon.Subtest{ - Name: "EventHub CRUD", - Test: func(tc *testcommon.KubePerTestContext) { - EventHub_20240101_CRUD(tc, namespace) - }, - }, - testcommon.Subtest{ - Name: "EventHub namespace auth rule CRUD", - Test: func(tc *testcommon.KubePerTestContext) { - Namespace_AuthorizationRules_20240101_CRUD(tc, namespace) - }, - }, - ) - - tc.DeleteResourceAndWait(namespace) - - // Ensure that the resource was really deleted in Azure - tc.ExpectResourceIsDeletedInAzure(armId, string(eventhub.APIVersion_Value)) -} - -func Namespace_20240101_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.Namespace) { - old := ns.DeepCopy() - namespaceKeysSecret := "namespacekeys" - ns.Spec.OperatorSpec = &eventhub.NamespaceOperatorSpec{ - Secrets: &eventhub.NamespaceOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, - }, - } - tc.PatchResourceAndWait(old, ns) - - tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") -} - -func EventHub_20240101_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { - eh := &eventhub.NamespacesEventhub{ - ObjectMeta: tc.MakeObjectMeta("eventhub"), - Spec: eventhub.Namespaces_Eventhub_Spec{ - Owner: testcommon.AsOwner(namespace), - MessageRetentionInDays: to.Ptr(7), - PartitionCount: to.Ptr(1), - }, - } - - tc.CreateResourceAndWait(eh) - defer tc.DeleteResourceAndWait(eh) - - tc.Expect(eh.Status.Id).ToNot(BeNil()) - - // a basic assertion on a property - tc.Expect(eh.Status.MessageRetentionInDays).ToNot(BeNil()) - tc.Expect(*eh.Status.MessageRetentionInDays).To(Equal(7)) - - // Run sub tests - tc.RunParallelSubtests( - testcommon.Subtest{ - Name: "EventHub auth rule CRUD", - Test: func(tc *testcommon.KubePerTestContext) { - EventHub_AuthorizationRules_20240101_CRUD(tc, eh) - }, - }, - testcommon.Subtest{ - Name: "EventHub consumer group CRUD", - Test: func(tc *testcommon.KubePerTestContext) { - EventHub_ConsumerGroup_20240101_CRUD(tc, eh) - }, - }, - ) - - // Perform a simple patch - old := eh.DeepCopy() - eh.Spec.MessageRetentionInDays = to.Ptr(3) - tc.PatchResourceAndWait(old, eh) - tc.Expect(eh.Status.MessageRetentionInDays).To(Equal(to.Ptr(3))) -} - -func Namespace_AuthorizationRules_20240101_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { - rule := &eventhub.NamespacesAuthorizationRule{ - ObjectMeta: tc.MakeObjectMeta("eventhub"), - Spec: eventhub.Namespaces_AuthorizationRule_Spec{ - Owner: testcommon.AsOwner(namespace), - Rights: []eventhub.Namespaces_AuthorizationRule_Properties_Rights_Spec{ - eventhub.Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, - eventhub.Namespaces_AuthorizationRule_Properties_Rights_Spec_Send, - }, - }, - } - - tc.CreateResourceAndWait(rule) - defer tc.DeleteResourceAndWait(rule) - - tc.Expect(rule.Status.Id).ToNot(BeNil()) - - // Run secret sub tests - tc.RunSubtests( - testcommon.Subtest{ - Name: "NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret", - Test: func(tc *testcommon.KubePerTestContext) { - NamespacesAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc, rule) - }, - }, - ) - - // a basic assertion on a property - tc.Expect(rule.Status.Rights).To(HaveLen(2)) -} - -func NamespacesAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesAuthorizationRule) { - old := ns.DeepCopy() - namespaceKeysSecret := "namespaceauthrulekeys" - ns.Spec.OperatorSpec = &eventhub.NamespacesAuthorizationRuleOperatorSpec{ - Secrets: &eventhub.NamespacesAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, - }, - } - tc.PatchResourceAndWait(old, ns) - - tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") -} - -func EventHub_AuthorizationRules_20240101_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { - rule := &eventhub.NamespacesEventhubsAuthorizationRule{ - ObjectMeta: tc.MakeObjectMeta("eventhub"), - Spec: eventhub.Namespaces_Eventhubs_AuthorizationRule_Spec{ - Owner: testcommon.AsOwner(eh), - Rights: []eventhub.Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec{ - eventhub.Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Listen, - eventhub.Namespaces_Eventhubs_AuthorizationRule_Properties_Rights_Spec_Send, - }, - }, - } - - tc.CreateResourceAndWait(rule) - defer tc.DeleteResourceAndWait(rule) - - tc.Expect(rule.Status.Id).ToNot(BeNil()) - - // Run secret sub tests - tc.RunSubtests( - testcommon.Subtest{ - Name: "EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret", - Test: func(tc *testcommon.KubePerTestContext) { - EventHubAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc, rule) - }, - }, - ) - - // a basic assertion on a property - tc.Expect(rule.Status.Rights).To(HaveLen(2)) -} - -func EventHubAuthorizationRule_20240101_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesEventhubsAuthorizationRule) { - old := ns.DeepCopy() - namespaceKeysSecret := "eventhubauthrulekeys" - ns.Spec.OperatorSpec = &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSpec{ - Secrets: &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, - }, - } - tc.PatchResourceAndWait(old, ns) - - tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") -} - -func EventHub_ConsumerGroup_20240101_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { - userMetadata := to.Ptr("This is some fun metadata") - consumerGroup := &eventhub.NamespacesEventhubsConsumerGroup{ - ObjectMeta: tc.MakeObjectMeta("eventhub"), - Spec: eventhub.Namespaces_Eventhubs_Consumergroup_Spec{ - Owner: testcommon.AsOwner(eh), - UserMetadata: to.Ptr("This is some fun metadata"), - }, - } - - tc.CreateResourceAndWait(consumerGroup) - defer tc.DeleteResourceAndWait(consumerGroup) - - tc.Expect(consumerGroup.Status.Id).ToNot(BeNil()) - - // a basic assertion on a property - tc.Expect(consumerGroup.Status.UserMetadata).To(Equal(userMetadata)) -} diff --git a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api20211101_CreationAndDeletion.yaml b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api20211101_CreationAndDeletion.yaml new file mode 100644 index 00000000000..3c8085085d0 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Eventhub_v1api20211101_CreationAndDeletion.yaml @@ -0,0 +1,1627 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-rg-rrfcvr","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "93" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 2b0f0ea57df2d3168393a325e584c5b5f6716e685cf84dc86523d5ac82e5b328 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr?api-version=2020-06-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr","name":"asotest-rg-rrfcvr","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-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: D8FF701F51A245FA94BB17B3694D4828 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:24:24Z' + status: 201 Created + code: 201 + duration: 4.286228459s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr?api-version=2020-06-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr","name":"asotest-rg-rrfcvr","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-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: C37460ABE5CC4227996E8B766FD5FAE6 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:24:32Z' + status: 200 OK + code: 200 + duration: 294.44775ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 95 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westcentralus","name":"asotestqvqskg","sku":{"name":"Standard","tier":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "95" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 3cd11d359ffb1fa23f921f29c655eac8a6d8366e46f38a74bf51ff8f983e31e2 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 715 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg","name":"asotestqvqskg","type":"Microsoft.EventHub/Namespaces","location":"westcentralus","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotestqvqskg","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestqvqskg.servicebus.windows.net:443/","isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "715" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 4d722384-3d31-405f-9d56-d5f6fe49cbb3 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2024-03-20T04:24:42 + X-Ms-Ratelimit-Remaining-Subscription-Resource-Requests: + - "49" + X-Msedge-Ref: + - 'Ref A: BC6734F4CD924D65A84D226DCF8860B5 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:24:38Z' + status: 201 Created + code: 201 + duration: 4.145496625s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 747 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg","name":"asotestqvqskg","type":"Microsoft.EventHub/Namespaces","location":"westcentralus","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotestqvqskg","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestqvqskg.servicebus.windows.net:443/","isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "747" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 20ffdcbf-4af9-4923-86b0-c75473077012 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2024-03-20T04:24:49 + X-Msedge-Ref: + - 'Ref A: 498A90DCB68D46B598ECEAC496CB06B1 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:24:48Z' + status: 200 OK + code: 200 + duration: 432.504375ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 747 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg","name":"asotestqvqskg","type":"Microsoft.EventHub/Namespaces","location":"westcentralus","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotestqvqskg","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestqvqskg.servicebus.windows.net:443/","isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "747" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - edd5a715-f26a-464e-a027-8eca4a1824df + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2024-03-20T04:24:54 + X-Msedge-Ref: + - 'Ref A: 30DACF75FFC647199C249EFC3A2764E2 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:24:53Z' + status: 200 OK + code: 200 + duration: 1.478339875s + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 747 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg","name":"asotestqvqskg","type":"Microsoft.EventHub/Namespaces","location":"westcentralus","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotestqvqskg","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestqvqskg.servicebus.windows.net:443/","isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "747" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 9b0128e3-3b9b-4487-9cc1-2f6fc4252d4a + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2024-03-20T04:25:07 + X-Msedge-Ref: + - 'Ref A: C18D8725FED24EAB950A726D3FE18A60 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:25:07Z' + status: 200 OK + code: 200 + duration: 3.336371209s + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 746 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg","name":"asotestqvqskg","type":"Microsoft.EventHub/Namespaces","location":"westcentralus","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotestqvqskg","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestqvqskg.servicebus.windows.net:443/","isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "746" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 5c171ae6-7e36-415d-bde5-b8f1fbd77e5a + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2024-03-20T04:25:27 + X-Msedge-Ref: + - 'Ref A: 01D9982EDCC94431A2D4EB32FDE0BEC8 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:25:27Z' + status: 200 OK + code: 200 + duration: 405.052125ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 746 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg","name":"asotestqvqskg","type":"Microsoft.EventHub/Namespaces","location":"westcentralus","tags":{},"properties":{"disableLocalAuth":false,"privateEndpointConnections":[],"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotestqvqskg","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestqvqskg.servicebus.windows.net:443/","isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard","capacity":1}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "746" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 06d38a06-aba3-423f-9cf1-e65224d38ae8 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2024-03-20T04:25:29 + X-Msedge-Ref: + - 'Ref A: D19697577E034F0C9B437D6413662029 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:25:28Z' + status: 200 OK + code: 200 + duration: 1.460931917s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 85 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestfoqxyq","properties":{"messageRetentionInDays":7,"partitionCount":1}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "85" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 99bcf6d9989618c0d17ab2e19dcdc5bc96b9f5c65271cf4e11e5d2b25ccf31c0 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 448 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq","name":"asotestfoqxyq","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westcentralus","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","partitionIds":["0"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "448" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - ccbe22e9-974c-414d-ba5a-4f2b43be17df + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G2|2024-03-20T04:25:45 + X-Msedge-Ref: + - 'Ref A: 317193ED09AD4F94AF2AB4C484D63F19 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:25:41Z' + status: 200 OK + code: 200 + duration: 3.980545542s + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 66 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotesteageir","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "66" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - a0c5cb77ae4a88db34911b1c31a246af4e672d029a013df339ef11d4adcd3740 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/authorizationRules/asotesteageir?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 330 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/authorizationRules/asotesteageir","name":"asotesteageir","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "330" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 0426b277-c2ec-4123-9510-f62725d3a25b + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G1|2024-03-20T04:25:49 + X-Msedge-Ref: + - 'Ref A: 72A94F60469A42D58AD6E6F9CEF87AA0 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:25:41Z' + status: 200 OK + code: 200 + duration: 8.196933458s + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 446 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq","name":"asotestfoqxyq","type":"Microsoft.EventHub/namespaces/eventhubs","location":"westcentralus","properties":{"messageRetentionInDays":7,"partitionCount":1,"status":"Active","createdAt":"2024-03-20T04:25:44.667","updatedAt":"2024-03-20T04:25:44.863","partitionIds":["0"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "446" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 99e68d4d-3c89-4ec5-8814-7fa2eef9c4f6 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G2|2024-03-20T04:25:49 + X-Msedge-Ref: + - 'Ref A: 0DD826B1847A4DDFAE031B806D65C72B Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:25:49Z' + status: 200 OK + code: 200 + duration: 399.768167ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/authorizationRules/asotesteageir?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 330 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/authorizationrules/asotesteageir","name":"asotesteageir","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "330" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 66b6905e-9726-4d4b-9def-da841ce848dc + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G1|2024-03-20T04:25:58 + X-Msedge-Ref: + - 'Ref A: EF0C1984B298496F960E9C34EC17AD12 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:25:57Z' + status: 200 OK + code: 200 + duration: 737.735167ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 66 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestljdbvl","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "66" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - acbed233486c2b3f38b10a72003b9a3340a53d0cc7ebea5eebdfa90a09d03dcb + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/authorizationRules/asotestljdbvl?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 337 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/authorizationRules/asotestljdbvl","name":"asotestljdbvl","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "337" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - e83c766b-60f5-4730-be73-72cebecebc46 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G1|2024-03-20T04:26:44 + X-Msedge-Ref: + - 'Ref A: F7FFFC024FBA41E38F6EE5F7DE5C941D Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:26:41Z' + status: 200 OK + code: 200 + duration: 2.71375675s + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 82 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestmtqisi","properties":{"userMetadata":"Some interesting metadata"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "82" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + Test-Request-Hash: + - 0847c7b92a18987a9244b4fed9ded30c30e24c12e0e9948a08a29fda53997760 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/consumergroups/asotestmtqisi?api-version=2021-11-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 458 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/consumergroups/asotestmtqisi","name":"asotestmtqisi","type":"Microsoft.EventHub/namespaces/eventhubs/consumergroups","location":"westcentralus","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"Some interesting metadata"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "458" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 2893e8df-71b5-4c33-93ef-85bdd9a41558 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2024-03-20T04:26:44 + X-Msedge-Ref: + - 'Ref A: 43A37F95F9C54B0E9B9906936EAC213D Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:26:41Z' + status: 200 OK + code: 200 + duration: 2.998755834s + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/authorizationRules/asotestljdbvl?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 364 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/authorizationrules/asotestljdbvl","name":"asotestljdbvl","type":"Microsoft.EventHub/namespaces/eventhubs/authorizationrules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "364" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 41087e68-9bfa-4012-a86f-a4a0dabaf8bf + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G1|2024-03-20T04:26:47 + X-Msedge-Ref: + - 'Ref A: C28EBA898EA54471B305E7E0F889987A Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:26:47Z' + status: 200 OK + code: 200 + duration: 836.842875ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/consumergroups/asotestmtqisi?api-version=2021-11-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 450 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/consumergroups/asotestmtqisi","name":"asotestmtqisi","type":"Microsoft.EventHub/namespaces/eventhubs/consumergroups","location":"westcentralus","properties":{"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","userMetadata":"Some interesting metadata"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "450" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 10241179-3fd5-4aed-8ea8-c5ca63909f39 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G1|2024-03-20T04:26:49 + X-Msedge-Ref: + - 'Ref A: 2EE3D98CC30B4686BB3A27D50060C4E7 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:26:47Z' + status: 200 OK + code: 200 + duration: 1.5420395s + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr?api-version=2020-06-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: 7640482547CF4F9D84A31763A6361CD4 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:26:52Z' + status: 202 Accepted + code: 202 + duration: 5.406014083s + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056396279560&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=H8CLz-kQgjdtPsxOU4Ues6R2jyisoHs9YoGMVNsvao4KNOf2ximplOk4BjMeEHOnMwughQSR_ZMbzKWYbUKWl1Q43oxKsWBXJWzrNmSpb8_EsNEImCng1LQgP03NA2ZvYunAepL6_HSG9nuOkprXGEhWE0CjiIL798pRgueQwmOH68N439pUYKmU9AwlUXBBJc9iu-5OtwFktHMcAtnMhQ2KRP82S2TjwHW_fsq2ZuQYnFNSlJ4J8g-uwjDCu-gVJpUr0zjA5Ff_WzrpqS3FhsvDU2o_RNfrdvu2QKNQgDWWg6VK-0rkCt72Quce8QbOG0n_X7vW1kVpn2Osuwu4rQ&h=6OvHX9mbT7ZLQXQxJGORSeDCVH8TEMcWt4xfKvosgYc + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: F83F86232FE7450B9A69CA0797A6CDE5 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:27:18Z' + status: 202 Accepted + code: 202 + duration: 1.116898208s + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056569240437&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=RTKoL4asrZYHu31fer31UKphOZ1oQSyrALQwOa8Rgd0Eb8HlbNgWR2Nhexp4g4WbuRM2KNl552iuT3bxqLd-w2Wqriun45MJu13B-E6iim6TEt1USkWMhwHQbxML8qjMayY-RXBq5eVGA5RlM9EXptdH9gTH1YxQV8zAe4AbmBaGO8IE-RbgUdOkZmqOe75_Wm7aTJRNEtn_bVfPcoMoV_0V6gYGj4VJp0SFp_CzkuCHlRYrhlCzgO50-3bfB63DlR9y1blijMRYTioqTpQYdP-Q5UoHxzUacY-gBPaOz8v2yreVJWwQfk6gwYtce9ZrZXEN44qWaI_28GTqydOsDQ&h=9OzXLrNMCWWaec7S2IATDw71BfeaAfKR67YcuhGM2P8 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: EFC6C31B26D14E0EA2788077DD44603D Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:27:35Z' + status: 202 Accepted + code: 202 + duration: 1.157137292s + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056735049141&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=ZJ-xKv7PynTEY4f3n7QJXoZkhQo5biqeXCTlB1PHgP4p3Lf2carxSntsf_DCF0uz2z_h9JcTxMNGruA1kznNBAQCBE7KgYvyGxK5dUI-m5l4htZRvQEI5MjZ2nNRND_PQew9Eos_uT4afREMxHTlmpe0poccjMP_85ZAm7CXbyn3khrp5p1WRX-d971aIQsuN-eHtwAXgaV9lipAoBVwRWqrQbbVoMTKJ6YI_WrV2GkrwBT2mqg4thkuOzAUBkWE3Cv2-2QLWwCujBCy4x1tONj8H8oZgX0-2fvpJ5SzuzgvZPAZIzKpdSe11r3THJ7yIEr0maLvJBoWcGla9NNRNA&h=ry9jGnZHEFqnE0TwvC_p0yZB324lGA6jGz1HKKS3bpo + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: ED2058B4A0F84488A64164118F726B3A Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:27:53Z' + status: 202 Accepted + code: 202 + duration: 430.417458ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056898746675&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=L6Dc1BseZJM26HHe2XEHRuuH4YBmstPL-M2aCJTJdR3BA_SYEKNphFsNmJWTJ4rIE5yIOrJvJjFSiwKkjngOHiAcy27GnEi6ZurfH29krhML3LrtKgxgg8-OVIcQzAE5_2n-mVYBHfMAr3M8CPsZ2b5NJGxpy35jv4aNB3dyQPp8iftxzqGct-sWIjmEWDb7wvRCBLKEJIRB3olwyZr-kondpAGA-1HUmUqjsnwibIZb2gU3iOdwCQ5JiF1u51PI6Du1RT7N7VczteX4MHm6VuMuGdEHZ4IDcBcUg2ZarIGtS-T1p7GbJXdHvuoJ04gC5vmtp8yNRV97qODmqXc3kQ&h=yFVk2dCLyK0_DWqTVKCb8-tFrw5VYSBuChJkYvxJoP8 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: C59160212BFB4F11866C18DDB1B5A51A Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:28:09Z' + status: 202 Accepted + code: 202 + duration: 918.971375ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465057069907856&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=S0DmjUDEtPSMkLMy263vMqbUf8_82IFx7oZHgRweYr2A4ZSHpHfU4rcPTKOl7kYOxqXmSl-gUeew131v_deiX4sWpRLO7GwVHdYfTT02qlUeQgedfEhGyyqIQIw3e2JSBQwrfDOiCAthhfNEtEJvTSp7Jt9NZTV8458jf3hT9DBk7Fe_59tC4JBfYiD0taMK3Qt9GVYAgbgqPvwaswRnvfIuLg5V3hx-F0r7_NCdlf0Idvt15mRywOs1X5jmUQpJMVj4shoA0Y6-lSo3SwwdW7olryKNiKIokI5eW3WWjQscLiibFE7tq6PoiUKencFodW7e6l866OSlYknFKXi21w&h=8RuL3xwc2je-wy7NrVfBr5luxpP2GUBCth3dQML_kDk + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: B45EA492A9114ACEBF3DD892468BE7B3 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:28:25Z' + status: 202 Accepted + code: 202 + duration: 1.187192083s + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465057236162555&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=jxbGOF3Y1aFtDp48J04EP_EjJnudHYuUyQsffogT-3RWRfDMtlRgxfhu5A2z1L2syZEVTCWVNA2h2IvyOzz54nz1RYypO4nd06SJtz1-RnAqRKYH871gH0ObWmXuTsTQuoQgOq5xRdndziAcohg3LsIuoJKug1RrKud4GyGLoom1HcLsmF8c-ig4R7G924UE3p6XeeyrhPeXka_vKxYLaFb0P2KvWpDPjpCnuGbbfkoGqj088BmP0G-dXpJCzul2VRVgDGi99S2clpOQCBu4_Pu0ixq8kr1U-hEG1yV1as-K_6EhKPRGTvIfBNoZAfNCRbRehnawsBKt5vXgn0XNMg&h=TuUWKCNbk8JKkIfj-sNyIEquaX8poIjsGvBsGWUbVO8 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: 35F368B20A694BE8AF7B715E460042FE Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:28:43Z' + status: 202 Accepted + code: 202 + duration: 445.838291ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "6" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465057400191028&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=MkyyStLuiLkOGc-N3UbColIRQenNDczGH8tznKGgq45EFP4N4GCH607nfsCpjkboTLjVjtaaoWgvmS2eBLXwIguJVpINJT3-oVDAs-GAz_lErJ32yVlfvAghaKnu1pu4UAFMHJ_ckhhct9_DazNfyZP-laDi88e3DY_hHwOhQ86oOX-6JK6kq8J2fl-6GPjPA4Fqu2YrcnwKCLD8dki7cDacT7hC3w2iF8IjLej88C4nm2ceWI1aP1ZUV8saFN88wygQ2BfFXrIX1eY49fXMdqXPZ2iK_99as-Uhe1QrbLMlwZ8RhGDMCDHri1eJD9sDs9SvXcwuDAECuH-ogz8Xqg&h=XQW1ZI4_agEnSIy02WrxQxbH15xwPrdZn0rRtbslgcA + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: 4531ED309B314B92A57F9098E4BE7CB6 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:28:59Z' + status: 202 Accepted + code: 202 + duration: 934.224958ms + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "7" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRSUkZDVlItV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638465056180782848&c=MIIHHjCCBgagAwIBAgITfwKXFzbGGgPgVcu6mgAEApcXNjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMxMDEyNTU4WhcNMjUwMTI1MDEyNTU4WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJxPlIQ7Jbmds-4zdEZaqQagDv2sidjQfqQoYutBv4nHcOkze7iy3FKOs6qCmZ2GdYT1GD9x5sWubIKr4DZpwkyn2h19H5uzOjQPDmKHI4xI9e7vKMBvxuYZ8z1PTQVe4C25HgjpLsbO1m2e5F20ryjVrL3jDLQnot8w1nf2zbq-tXEMmLwK7X6fzJA37d9DcoSW06d7CI37ABQTYsY0mlkrinMwUpddCqWMWWLFaDX1-vZC01IoCB6Ap8Rn1VBSB7xgtGXpkGN9DtHsVnrbLHVBnZEkxFO5k9M-mvew8IuSFKUHijf9dis7ofYQX8ixiDljlqw_D_S8oB-5q-D7akCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFggvX2K4Py0SACAWQCAQowggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQzte4chjJq6JngLuku5hmj3eRM5TAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMBcGA1UdIAQQMA4wDAYKKwYBBAGCN3sBATAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAAG8ycqaLP7B0nOSoZgoxwAu04lyZT934Utu0bhvMKZHG4XGIL74hWLOxHtiuOg8OYR_ir41kpsvAvPLZ7FKFCMOuMgbXaMnOauwF7wqB3Izr6t1XRMgaYOGv0AtV2drHLdVRewEbAlgLn9vLG-YnxuzDExdkCIq5jqQ4Z0yZUUIM01AGdVm6rYqa7Q0PlO8bWwqRpeXoD3rjB_qHeKAO4t1OpXSJtSl2waXMlYYGuHA3XRH5c-01iM1_MZMXm0JPo1OIta9hPNvTtu7Scj1Tb3VxRlH06hvWBdTAsSdpW-z4tUtXC9FKllv_kH34YGNtvK0cRkCBIBjTzPkJhdx-4&s=bW49fmURGcPl699RGK0je3CjXSpdLmHtgLUMrX1hrw0yZn0_FcYUhs6t2pPdbfl7y5kMt40r25HS3pNWchfud4472tz0cM5BlSvHiGlenbAd3F0Fsyagxz8gzJBUfKPpPY1UK1GTDQDo2xyozDPaPhPsJDdIVckb8GpAcF0CuKM11_bmc1xTErpgLKVC9cLs-5VU24U4E1WV17gWvh4oxHSjYRgjAPzdDOkLlutNVZ3nhByHNL_D_QAh5gQ-TMZoeQuhgFayfmZIzBQMQ_S8-aXHxnQmCkRLNrhS9HCQoK2Zw6XiKifEcOgRmYScU0hCWEKJihy7jIzPozFX0V3UZA&h=9-GvkEpoU-i2ryQ9LROSiCjYI-V9F_XTsptIRROl-xg + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Msedge-Ref: + - 'Ref A: CF4B980B12C8471DB7FBF1A355291B51 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:29:16Z' + status: 200 OK + code: 200 + duration: 917.715667ms + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-rrfcvr'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: 3B26334CFAF14EA0B86F500233EA52D0 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:29:18Z' + status: 404 Not Found + code: 404 + duration: 660.854666ms + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 318 + uncompressed: false + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform ''delete'' on resource(s) of type ''namespaces/eventhubs'', because the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "318" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: A2A2C41211894BF39EB8CF43CC7B4EA2 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:29:23Z' + status: 404 Not Found + code: 404 + duration: 593.168834ms + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/authorizationRules/asotesteageir?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 327 + uncompressed: false + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform ''delete'' on resource(s) of type ''namespaces/authorizationrules'', because the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "327" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: D8122FFE892E452CAC445D08858C03C0 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:29:23Z' + status: 404 Not Found + code: 404 + duration: 857.848666ms + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/consumergroups/asotestmtqisi?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 357 + uncompressed: false + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform ''delete'' on resource(s) of type ''namespaces/eventhubs/consumergroups'', because the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "357" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: 7815FD70A40D43D4886F50FFE4C32634 Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:29:28Z' + status: 404 Not Found + code: 404 + duration: 534.944375ms + - id: 29 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-rrfcvr/providers/Microsoft.EventHub/namespaces/asotestqvqskg/eventhubs/asotestfoqxyq/authorizationRules/asotestljdbvl?api-version=2021-11-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-rrfcvr'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: A47837C1977543B6B4943EAEFCD6575E Ref B: SYD03EDGE2108 Ref C: 2024-03-20T04:29:28Z' + status: 404 Not Found + code: 404 + duration: 647.405208ms diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml deleted file mode 100644 index 2ecf324e714..00000000000 --- a/v2/samples/eventhub/v1api20240101/v1api20240101_namespace.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: eventhub.azure.com/v1api20240101 -kind: Namespace -metadata: - name: aso-sample-namespace - namespace: default -spec: - location: westcentralus - owner: - name: aso-sample-rg - sku: - name: Standard - tier: Standard - operatorSpec: - secrets: - primaryKey: - name: my-secret - key: primary-key - primaryConnectionString: - name: my-secret - key: primary-connection-string diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml deleted file mode 100644 index d01efd513e5..00000000000 --- a/v2/samples/eventhub/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: eventhub.azure.com/v1api20240101 -kind: NamespacesAuthorizationRule -metadata: - name: sample-authrule - namespace: default -spec: - owner: - name: aso-sample-namespace - rights: - - Listen - - Send - operatorSpec: - secrets: - primaryKey: - name: my-ns-secret - key: primary-key - primaryConnectionString: - name: my-ns-secret - key: primary-connection-string \ No newline at end of file diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml deleted file mode 100644 index 19927755eb0..00000000000 --- a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhub.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: eventhub.azure.com/v1api20240101 -kind: NamespacesEventhub -metadata: - name: sample-eventhub - namespace: default -spec: - owner: - name: aso-sample-namespace - messageRetentionInDays: 7 - partitionCount: 1 diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml deleted file mode 100644 index 1f3fee6f50c..00000000000 --- a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsauthorizationrule.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: eventhub.azure.com/v1api20240101 -kind: NamespacesEventhubsAuthorizationRule -metadata: - name: sample-eventhub-authrule - namespace: default -spec: - owner: - name: sample-eventhub - rights: - - Listen - - Send - operatorSpec: - secrets: - primaryKey: - name: my-eh-secret - key: primary-key - primaryConnectionString: - name: my-eh-secret - key: primary-connection-string \ No newline at end of file diff --git a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml b/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml deleted file mode 100644 index efb9e95f2c5..00000000000 --- a/v2/samples/eventhub/v1api20240101/v1api20240101_namespaceseventhubsconsumergroup.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: eventhub.azure.com/v1api20240101 -kind: NamespacesEventhubsConsumerGroup -metadata: - name: sample-consumergroup - namespace: default -spec: - owner: - name: sample-eventhub - userMetadata: Some interesting metadata From c22dc3b4854ec0f7fe742ac4de75c2caf0857b20 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Thu, 21 Mar 2024 09:56:03 +1300 Subject: [PATCH 03/10] Update secret names --- .../crd_eventhub_namespace_20211101_test.go | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go index 14f52cafcd7..68eabe25b0f 100644 --- a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go +++ b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go @@ -86,18 +86,18 @@ func Test_EventHub_Namespace_20211101_CRUD(t *testing.T) { func Namespace_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.Namespace) { old := ns.DeepCopy() - namespaceKeysSecret := "namespacekeys" + keysSecret := "namespacesecret" ns.Spec.OperatorSpec = &eventhub.NamespaceOperatorSpec{ Secrets: &eventhub.NamespaceOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(keysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { @@ -175,18 +175,18 @@ func Namespace_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, namesp func NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesAuthorizationRule) { old := ns.DeepCopy() - namespaceKeysSecret := "namespaceauthrulekeys" + keysSecret := "namespaceauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(keysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { @@ -222,18 +222,18 @@ func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh clie func EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesEventhubsAuthorizationRule) { old := ns.DeepCopy() - namespaceKeysSecret := "eventhubauthrulekeys" + keysSecret := "eventhubauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceKeysSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(namespaceKeysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(keysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_ConsumerGroup_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { From 7515a5e37a094cc0e4c845b5565146c5c89af0fc Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:28:28 +1300 Subject: [PATCH 04/10] Update secret names --- .../crd_eventhub_namespace_20211101_test.go | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go index 68eabe25b0f..80539161bfa 100644 --- a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go +++ b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go @@ -86,18 +86,18 @@ func Test_EventHub_Namespace_20211101_CRUD(t *testing.T) { func Namespace_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.Namespace) { old := ns.DeepCopy() - keysSecret := "namespacesecret" + nsSecret := "namespacesecret" ns.Spec.OperatorSpec = &eventhub.NamespaceOperatorSpec{ Secrets: &eventhub.NamespaceOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: nsSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: nsSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: nsSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: nsSecret, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(keysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(nsSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { @@ -175,18 +175,18 @@ func Namespace_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, namesp func NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesAuthorizationRule) { old := ns.DeepCopy() - keysSecret := "namespaceauthrulesecret" + namespaceAuthRuleSecret := "namespaceauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(keysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(namespaceAuthRuleSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { @@ -222,18 +222,18 @@ func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh clie func EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesEventhubsAuthorizationRule) { old := ns.DeepCopy() - keysSecret := "eventhubauthrulesecret" + eventHubAuthRuleSecret := "eventhubauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: keysSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(keysSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(eventHubAuthRuleSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_ConsumerGroup_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { From 5f5157c85b5835eb7d7b362afbafe2fac5f5593c Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:06:47 +1300 Subject: [PATCH 05/10] Update secret names --- .../crd_eventhub_namespace_20211101_test.go | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go index 80539161bfa..1d36c60f268 100644 --- a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go +++ b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go @@ -86,18 +86,18 @@ func Test_EventHub_Namespace_20211101_CRUD(t *testing.T) { func Namespace_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.Namespace) { old := ns.DeepCopy() - nsSecret := "namespacesecret" + nsSecretName := "namespacesecret" ns.Spec.OperatorSpec = &eventhub.NamespaceOperatorSpec{ Secrets: &eventhub.NamespaceOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: nsSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: nsSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: nsSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: nsSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: nsSecretName, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: nsSecretName, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: nsSecretName, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: nsSecretName, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(nsSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(nsSecretName, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_CRUD(tc *testcommon.KubePerTestContext, namespace client.Object) { @@ -175,18 +175,18 @@ func Namespace_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, namesp func NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesAuthorizationRule) { old := ns.DeepCopy() - namespaceAuthRuleSecret := "namespaceauthrulesecret" + namespaceAuthRuleSecretName := "namespaceauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceAuthRuleSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: namespaceAuthRuleSecretName, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: namespaceAuthRuleSecretName, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: namespaceAuthRuleSecretName, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: namespaceAuthRuleSecretName, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(namespaceAuthRuleSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(namespaceAuthRuleSecretName, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { @@ -222,18 +222,18 @@ func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh clie func EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesEventhubsAuthorizationRule) { old := ns.DeepCopy() - eventHubAuthRuleSecret := "eventhubauthrulesecret" + eventHubAuthRuleSecretName := "eventhubauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSecrets{ - PrimaryKey: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "primary-key"}, - PrimaryConnectionString: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "primary-connection-string"}, - SecondaryKey: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "secondary-key"}, - SecondaryConnectionString: &genruntime.SecretDestination{Name: eventHubAuthRuleSecret, Key: "secondary-connection-string"}, + PrimaryKey: &genruntime.SecretDestination{Name: eventHubAuthRuleSecretName, Key: "primary-key"}, + PrimaryConnectionString: &genruntime.SecretDestination{Name: eventHubAuthRuleSecretName, Key: "primary-connection-string"}, + SecondaryKey: &genruntime.SecretDestination{Name: eventHubAuthRuleSecretName, Key: "secondary-key"}, + SecondaryConnectionString: &genruntime.SecretDestination{Name: eventHubAuthRuleSecretName, Key: "secondary-connection-string"}, }, } tc.PatchResourceAndWait(old, ns) - tc.ExpectSecretHasKeys(eventHubAuthRuleSecret, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") + tc.ExpectSecretHasKeys(eventHubAuthRuleSecretName, "primary-key", "primary-connection-string", "secondary-key", "secondary-connection-string") } func EventHub_ConsumerGroup_CRUD(tc *testcommon.KubePerTestContext, eh client.Object) { From c111ed1f592aa93929b0c1429d70aad896b84223 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:43:01 +1300 Subject: [PATCH 06/10] Add //nolint:gosec --- .../controllers/crd_eventhub_namespace_20211101_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go index 1d36c60f268..607f3cce632 100644 --- a/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go +++ b/v2/internal/controllers/crd_eventhub_namespace_20211101_test.go @@ -86,6 +86,7 @@ func Test_EventHub_Namespace_20211101_CRUD(t *testing.T) { func Namespace_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.Namespace) { old := ns.DeepCopy() + //nolint:gosec nsSecretName := "namespacesecret" ns.Spec.OperatorSpec = &eventhub.NamespaceOperatorSpec{ Secrets: &eventhub.NamespaceOperatorSecrets{ @@ -175,6 +176,7 @@ func Namespace_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, namesp func NamespacesAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesAuthorizationRule) { old := ns.DeepCopy() + //nolint:gosec namespaceAuthRuleSecretName := "namespaceauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesAuthorizationRuleOperatorSecrets{ @@ -222,6 +224,7 @@ func EventHub_AuthorizationRules_CRUD(tc *testcommon.KubePerTestContext, eh clie func EventHubAuthorizationRule_SecretsWrittenToSameKubeSecret(tc *testcommon.KubePerTestContext, ns *eventhub.NamespacesEventhubsAuthorizationRule) { old := ns.DeepCopy() + //nolint:gosec eventHubAuthRuleSecretName := "eventhubauthrulesecret" ns.Spec.OperatorSpec = &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSpec{ Secrets: &eventhub.NamespacesEventhubsAuthorizationRuleOperatorSecrets{ From 4e7b22d614d0ea5237ac77da32362222a04442e5 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:15:26 +1300 Subject: [PATCH 07/10] Update go mod --- v2/go.mod | 2 +- v2/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/go.mod b/v2/go.mod index eab98518408..f3631031736 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -10,7 +10,7 @@ require ( 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/eventgrid/armeventgrid v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.1.1 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0 diff --git a/v2/go.sum b/v2/go.sum index 59d3e4c224d..84d574b5212 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -16,8 +16,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0 h1 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/eventgrid/armeventgrid v1.0.0 h1:w6b0+FygDpqM7g5cjbeyPoBzgxVHwwt2vCUvTz1oFY8= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid v1.0.0/go.mod h1:t8kRpcgm+RdImuJgHG6SfoQ0tpb9LGl7MF1E6u0yeeA= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.1.1 h1:gZ1ZZvrVUhDNsGNpbo2N87Y0CJB8p3IS5UH9Z4Ui97g= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.1.1/go.mod h1:7fQVOnRA11ScLE8dOCWanXHQa2NMFOM2i0u/1VRICXA= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0 h1:+dggnR89/BIIlRlQ6d19dkhhdd/mQUiQbXhyHUFiB4w= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0/go.mod h1:tI9M2Q/ueFi287QRkdrhb9LHm6ZnXgkVYLRC3FhYkPw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0 h1:NZP+oPbAVFy7PhQ4PTD3SuGWbEziNhp7lphGkkN707s= From 0690a63bc2896159abb3d1df51a798862b569881 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Tue, 2 Apr 2024 10:48:53 +1300 Subject: [PATCH 08/10] go mod tidy --- v2/go.sum | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/v2/go.sum b/v2/go.sum index 2ec6a5fb878..7c978d1fc26 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -19,7 +19,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0 h1:+dggnR89/BIIlRlQ6d19dkhhdd/mQUiQbXhyHUFiB4w= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0/go.mod h1:tI9M2Q/ueFi287QRkdrhb9LHm6ZnXgkVYLRC3FhYkPw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0 h1:NZP+oPbAVFy7PhQ4PTD3SuGWbEziNhp7lphGkkN707s= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0/go.mod h1:djbLk3ngutFfQ9fSOM29UzywAkcBI1YUsuUnxTQGsqU= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 h1:HlZMUZW8S4P9oob1nCHxCCKrytxyLc+24nUJGssoEto= @@ -29,6 +31,7 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachine 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.1.1 h1:7CBQ+Ei8SP2c6ydQTGCCrS35bDxgTMfoP2miAwK++OU= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1/go.mod h1:c/wcGeGx5FUPbM/JltUYHZcKmigwyVLJlDq+4HdtXaw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch v1.3.0 h1:HpCtTs500PzKoBWKBLZVFEG9Zh20f7cAFbWj8D9JWkg= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch v1.3.0/go.mod h1:3uruTckNIGQ4iNsvAs/qrLgWBoS1pA7pCzHFmTFU+LU= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus v1.2.0 h1:jngSeKBnzC7qIk3rvbWHsLI7eeasEucORHWr2CHX0Yg= @@ -40,7 +43,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0 h1:UrGzkHueDwAWDdjQxC+QaXHd4tVCkISYE9j7fSSXF8k= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0/go.mod h1:qskvSQeW+cxEE2bcKYyKimB1/KiQ9xpJ99bcHY0BX6c= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= @@ -78,6 +83,7 @@ github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= @@ -87,6 +93,7 @@ github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF github.com/go-sql-driver/mysql v1.8.0 h1:UtktXaU2Nb64z/pLiGIxY4431SJ4/dR5cjMmlVHgnT4= github.com/go-sql-driver/mysql v1.8.0/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= @@ -96,6 +103,7 @@ github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2V github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -114,6 +122,7 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= @@ -159,6 +168,7 @@ github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3P github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -191,6 +201,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -211,8 +222,11 @@ go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmY go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -268,6 +282,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -277,6 +292,7 @@ gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuB google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= @@ -289,6 +305,7 @@ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGm google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/dnaeon/go-vcr.v3 v3.2.0 h1:Rltp0Vf+Aq0u4rQXgmXgtgoRDStTnFN83cWgSGSoRzM= gopkg.in/dnaeon/go-vcr.v3 v3.2.0/go.mod h1:2IMOnnlx9I6u9x+YBsM3tAMx6AlOxnJ0pWxQAzZ79Ag= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= From 6e43f080a0d4a6c558279343bf41688ee6cf142d Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:04:13 +1300 Subject: [PATCH 09/10] Resolve comments --- v2/api/eventhub/customizations/namespace_extension.go | 10 +++++----- .../namespaces_authorization_rule_extension.go | 10 +++++----- ...amespaces_eventhubs_authorization_rule_extension.go | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/v2/api/eventhub/customizations/namespace_extension.go b/v2/api/eventhub/customizations/namespace_extension.go index fe412313e04..141798920ed 100644 --- a/v2/api/eventhub/customizations/namespace_extension.go +++ b/v2/api/eventhub/customizations/namespace_extension.go @@ -18,6 +18,7 @@ import ( "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" "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/internal/util/to" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" ) @@ -70,7 +71,6 @@ func (ext *NamespaceExtension) ExportKubernetesResources( if err != nil { return nil, errors.Wrapf(err, "failed to retreive response") } - } secretSlice, err := namespaceSecretsToWrite(typedObj, res.AccessKeys) @@ -106,10 +106,10 @@ func namespaceSecretsToWrite(obj *storage.Namespace, keys armeventhub.AccessKeys collector := secrets.NewCollector(obj.Namespace) - collector.AddValue(operatorSpecSecrets.PrimaryKey, *keys.PrimaryKey) - collector.AddValue(operatorSpecSecrets.SecondaryKey, *keys.SecondaryKey) - collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, *keys.PrimaryConnectionString) - collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, *keys.SecondaryConnectionString) + collector.AddValue(operatorSpecSecrets.PrimaryKey, to.Value(keys.PrimaryKey)) + collector.AddValue(operatorSpecSecrets.SecondaryKey, to.Value(keys.SecondaryKey)) + collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, to.Value(keys.PrimaryConnectionString)) + collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, to.Value(keys.SecondaryConnectionString)) return collector.Values() } diff --git a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go index 238e51fef0c..05c49616242 100644 --- a/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go +++ b/v2/api/eventhub/customizations/namespaces_authorization_rule_extension.go @@ -18,6 +18,7 @@ import ( "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" "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/internal/util/to" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" ) @@ -68,7 +69,6 @@ func (ext *NamespacesAuthorizationRuleExtension) ExportKubernetesResources( if err != nil { return nil, errors.Wrapf(err, "failed to retreive response") } - } secretSlice, err := namespacesAuthorizationRuleSecretsToWrite(typedObj, res.AccessKeys) @@ -104,10 +104,10 @@ func namespacesAuthorizationRuleSecretsToWrite(obj *storage.NamespacesAuthorizat collector := secrets.NewCollector(obj.Namespace) - collector.AddValue(operatorSpecSecrets.PrimaryKey, *keys.PrimaryKey) - collector.AddValue(operatorSpecSecrets.SecondaryKey, *keys.SecondaryKey) - collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, *keys.PrimaryConnectionString) - collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, *keys.SecondaryConnectionString) + collector.AddValue(operatorSpecSecrets.PrimaryKey, to.Value(keys.PrimaryKey)) + collector.AddValue(operatorSpecSecrets.SecondaryKey, to.Value(keys.SecondaryKey)) + collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, to.Value(keys.PrimaryConnectionString)) + collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, to.Value(keys.SecondaryConnectionString)) return collector.Values() } diff --git a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go index 3ed2db41733..8698f6b34e3 100644 --- a/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go +++ b/v2/api/eventhub/customizations/namespaces_eventhubs_authorization_rule_extension.go @@ -18,6 +18,7 @@ import ( "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20211101/storage" "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/internal/util/to" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" ) @@ -68,7 +69,6 @@ func (ext *NamespacesEventhubsAuthorizationRuleExtension) ExportKubernetesResour if err != nil { return nil, errors.Wrapf(err, "failed to retreive response") } - } secretSlice, err := namespacesEventHubAuthorizationRuleSecretsToWrite(typedObj, res.AccessKeys) @@ -104,10 +104,10 @@ func namespacesEventHubAuthorizationRuleSecretsToWrite(obj *storage.NamespacesEv collector := secrets.NewCollector(obj.Namespace) - collector.AddValue(operatorSpecSecrets.PrimaryKey, *keys.PrimaryKey) - collector.AddValue(operatorSpecSecrets.SecondaryKey, *keys.SecondaryKey) - collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, *keys.PrimaryConnectionString) - collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, *keys.SecondaryConnectionString) + collector.AddValue(operatorSpecSecrets.PrimaryKey, to.Value(keys.PrimaryKey)) + collector.AddValue(operatorSpecSecrets.SecondaryKey, to.Value(keys.SecondaryKey)) + collector.AddValue(operatorSpecSecrets.PrimaryConnectionString, to.Value(keys.PrimaryConnectionString)) + collector.AddValue(operatorSpecSecrets.SecondaryConnectionString, to.Value(keys.SecondaryConnectionString)) return collector.Values() } From af6d7282db2db0114c900e47095cd26fc57da399 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <38904804+super-harsh@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:29:47 +1300 Subject: [PATCH 10/10] go mod tidy --- v2/cmd/asoctl/go.mod | 39 +------------- v2/cmd/asoctl/go.sum | 126 +++++++------------------------------------ 2 files changed, 20 insertions(+), 145 deletions(-) diff --git a/v2/cmd/asoctl/go.mod b/v2/cmd/asoctl/go.mod index 303eab8a25c..0152312249c 100644 --- a/v2/cmd/asoctl/go.mod +++ b/v2/cmd/asoctl/go.mod @@ -36,6 +36,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid v1.0.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning v1.0.0 // indirect @@ -46,25 +47,16 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect - github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/VividCortex/ewma v1.2.0 // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect - github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/blang/semver/v4 v4.0.0 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/coreos/go-semver v0.3.1 // indirect - github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.2 // indirect github.com/evanphx/json-patch v5.8.1+incompatible // indirect github.com/evanphx/json-patch/v5 v5.8.1 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.20.2 // indirect github.com/go-openapi/jsonreference v0.20.4 // indirect github.com/go-openapi/swag v0.22.8 // indirect @@ -75,14 +67,10 @@ require ( github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/cel-go v0.17.7 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hbollon/go-edlib v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -98,11 +86,9 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/microsoft/go-mssqldb v1.7.0 // indirect - github.com/moby/spdystream v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect @@ -110,21 +96,6 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stoewer/go-strcase v1.2.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.10 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect - go.etcd.io/etcd/client/v3 v3.5.10 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 // indirect - go.opentelemetry.io/otel v1.20.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.20.0 // indirect - go.opentelemetry.io/otel/sdk v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.20.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.21.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect @@ -135,22 +106,14 @@ require ( golang.org/x/time v0.5.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiserver v0.29.3 // indirect k8s.io/component-base v0.29.3 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kms v0.29.3 // indirect k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 // indirect k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/v2/cmd/asoctl/go.sum b/v2/cmd/asoctl/go.sum index 474f80277a0..8c0b1165d33 100644 --- a/v2/cmd/asoctl/go.sum +++ b/v2/cmd/asoctl/go.sum @@ -16,8 +16,12 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos v1.0.0 h1 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/eventgrid/armeventgrid v1.0.0 h1:w6b0+FygDpqM7g5cjbeyPoBzgxVHwwt2vCUvTz1oFY8= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid v1.0.0/go.mod h1:t8kRpcgm+RdImuJgHG6SfoQ0tpb9LGl7MF1E6u0yeeA= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0 h1:+dggnR89/BIIlRlQ6d19dkhhdd/mQUiQbXhyHUFiB4w= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub v1.2.0/go.mod h1:tI9M2Q/ueFi287QRkdrhb9LHm6ZnXgkVYLRC3FhYkPw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0 h1:NZP+oPbAVFy7PhQ4PTD3SuGWbEziNhp7lphGkkN707s= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iothub/armiothub v1.3.0/go.mod h1:djbLk3ngutFfQ9fSOM29UzywAkcBI1YUsuUnxTQGsqU= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 h1:HlZMUZW8S4P9oob1nCHxCCKrytxyLc+24nUJGssoEto= @@ -27,6 +31,7 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachine 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.1.1 h1:7CBQ+Ei8SP2c6ydQTGCCrS35bDxgTMfoP2miAwK++OU= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1/go.mod h1:c/wcGeGx5FUPbM/JltUYHZcKmigwyVLJlDq+4HdtXaw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch v1.3.0 h1:HpCtTs500PzKoBWKBLZVFEG9Zh20f7cAFbWj8D9JWkg= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch v1.3.0/go.mod h1:3uruTckNIGQ4iNsvAs/qrLgWBoS1pA7pCzHFmTFU+LU= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus v1.2.0 h1:jngSeKBnzC7qIk3rvbWHsLI7eeasEucORHWr2CHX0Yg= @@ -38,55 +43,40 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0 h1:UrGzkHueDwAWDdjQxC+QaXHd4tVCkISYE9j7fSSXF8k= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0/go.mod h1:qskvSQeW+cxEE2bcKYyKimB1/KiQ9xpJ99bcHY0BX6c= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= -github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU= github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.8.1+incompatible h1:2toJaoe7/rNa1zpeQx0UnVEjqk6z2ecyA20V/zg8vTU= github.com/evanphx/json-patch v5.8.1+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.8.1 h1:iPEdwg0XayoS+E7Mth9JxwUtOgyVxnDTXHtKhZPlZxA= github.com/evanphx/json-patch/v5 v5.8.1/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= -github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-logr/zerologr v1.2.3 h1:up5N9vcH9Xck3jJkXzgyOxozT14R47IyDODz8LM1KSs= github.com/go-logr/zerologr v1.2.3/go.mod h1:BxwGo7y5zgSHYR1BjbnHPyF/5ZjVKfKxAZANVu6E8Ho= github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= @@ -98,10 +88,10 @@ github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF github.com/go-sql-driver/mysql v1.8.0 h1:UtktXaU2Nb64z/pLiGIxY4431SJ4/dR5cjMmlVHgnT4= github.com/go-sql-driver/mysql v1.8.0/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= @@ -114,8 +104,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/cel-go v0.17.7 h1:6ebJFzu1xO2n7TLtN+UBqShGBhlD85bhvglh5DpcfqQ= -github.com/google/cel-go v0.17.7/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -126,16 +114,9 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/hbollon/go-edlib v1.6.0 h1:ga7AwwVIvP8mHm9GsPueC0d71cfRU/52hmPJ7Tprv4E= github.com/hbollon/go-edlib v1.6.0/go.mod h1:wnt6o6EIVEzUfgbUZY7BerzQ2uvzp354qmS2xaLkrhM= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= @@ -150,21 +131,20 @@ github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -177,8 +157,6 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/microsoft/go-mssqldb v1.7.0 h1:sgMPW0HA6Ihd37Yx0MzHyKD726C2kY/8KJsQtXHNaAs= github.com/microsoft/go-mssqldb v1.7.0/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -186,12 +164,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= -github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -212,6 +186,7 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= @@ -220,52 +195,18 @@ github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/vbauerster/mpb/v8 v8.7.2 h1:SMJtxhNho1MV3OuFgS1DAzhANN1Ejc5Ct+0iSaIkB14= github.com/vbauerster/mpb/v8 v8.7.2/go.mod h1:ZFnrjzspgDHoxYLGvxIruiNk73GNTPG4YHgVNpR10VY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= -go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= -go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= -go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= -go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= -go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 h1:ZOLJc06r4CB42laIXg/7udr0pbZyuAihN10A/XuiQRY= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0/go.mod h1:5z+/ZWJQKXa9YT34fQNx5K8Hd1EoIhvtUygUQPqEOgQ= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= -go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= @@ -328,6 +269,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -336,20 +278,6 @@ gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY= -google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -358,11 +286,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/dnaeon/go-vcr.v3 v3.2.0 h1:Rltp0Vf+Aq0u4rQXgmXgtgoRDStTnFN83cWgSGSoRzM= +gopkg.in/dnaeon/go-vcr.v3 v3.2.0/go.mod h1:2IMOnnlx9I6u9x+YBsM3tAMx6AlOxnJ0pWxQAzZ79Ag= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -371,34 +297,20 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= -k8s.io/apiextensions-apiserver v0.29.2 h1:UK3xB5lOWSnhaCk0RFZ0LUacPZz9RY4wi/yt2Iu+btg= -k8s.io/apiextensions-apiserver v0.29.2/go.mod h1:aLfYjpA5p3OwtqNXQFkhJ56TB+spV8Gc4wfMhUA3/b8= k8s.io/apiextensions-apiserver v0.29.3 h1:9HF+EtZaVpFjStakF4yVufnXGPRppWFEQ87qnO91YeI= k8s.io/apiextensions-apiserver v0.29.3/go.mod h1:po0XiY5scnpJfFizNGo6puNU6Fq6D70UJY2Cb2KwAVc= -k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= -k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= -k8s.io/apiserver v0.29.3 h1:xR7ELlJ/BZSr2n4CnD3lfA4gzFivh0wwfNfz9L0WZcE= -k8s.io/apiserver v0.29.3/go.mod h1:hrvXlwfRulbMbBgmWRQlFru2b/JySDpmzvQwwk4GUOs= -k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= -k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= -k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8= -k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM= k8s.io/component-base v0.29.3 h1:Oq9/nddUxlnrCuuR2K/jp6aflVvc0uDvxMzAWxnGzAo= k8s.io/component-base v0.29.3/go.mod h1:Yuj33XXjuOk2BAaHsIGHhCKZQAgYKhqIxIjIr2UXYio= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.29.3 h1:ReljsAUhYlm2spdT4yXmY+9a8x8dc/OT4mXvwQPPteQ= -k8s.io/kms v0.29.3/go.mod h1:TBGbJKpRUMk59neTMDMddjIDL+D4HuFUbpuiuzmOPg0= k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 h1:m6dl1pkxz3HuE2mP9MUYPCCGyy6IIFlv/vTlLBDxIwA= k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2SGwkQasmbeqDo8th5wOBA5h/AjTKA4I= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=